Monday, January 7, 2013

logrotate with date extensions

My recent problem?  The version of logrotate (logrotate 3.7.1) I'm running on an old web server doesn't support the "dateext" option.  I wanted to have my Apache logs rotate with a date as its extension instead of ".#".  Here's a sample of my /etc/logrotate.d/httpd that does this, if you have the same problem.

# cat /etc/logrotate.d/httpd
/var/log/httpd/*log {
    rotate 5
    daily
    create
    missingok
    ifempty
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
    endscript
    lastaction
        DATE=`date +%F`;
        for i in `ls /var/log/httpd/*.1`
          do
            mv $i ${i%.1}-$DATE
          done
    endscript
}


Info on manipulating shell variable strings can be found via http://tldp.org/LDP/abs/html/string-manipulation.html.  You can see I'm removing the ".1" substring in the mv step so that my logs do not look like log.1-$DATE.

Friday, September 21, 2012

Lose your ssh key pub file?

I somehow lost my ssh key pub file, which is inconvenient when I want to copy it out to other hosts.  I could grab it from another host's authorized_key file, but wouldn't it be easier just to recreate it?  Here's how to do it.

[reamer77@myhost .ssh]$ ssh-keygen -y > id_rsa.pub
Enter file in which the key is (/home/reamer77/.ssh/id_rsa):
Enter passphrase:


Viola.  You should now have your pub file back without having to generate a new private and pub key file.

Tuesday, August 28, 2012

VMworld 2012 - Day 1 Notes

 Keynote

 I won't go into too much detail.  You can see it for yourself at http://vmware.com/go/keynote. You can suffer through the dialogue in the beginning, or fast-forward to the actual start at around 5:18.

What you won't see is the insane performance before Paul Maritz came on stage.  The hall was packed when I showed up just in a nick of time.  A drum line came out and played on drum pads that spelled out VMworld 2012.  Then there was some beat boxing, singing and dancing.  Pretty nuts.  Pretty loud.  And I thought with the tag line "Right Here, Right Now" we'd have Jesus Jones or Van Halen.

During the reviews of the talks and events, I saw there is a speaker from Virginia Tech on Thursday (Dr. Dennis Hong, Director for Robotics and Mechanisms Lab). Go Hokies! I was disappointed to see they referenced him as from "Virginia Tech University".  When did my school become VTU?  It's VPISU (Virginia Polytechnic Institute and State University) from what I remember.

Maritz talked about where VMware is going, and about trying to find out how to give users new experiences in receiving information in real time.  Of course, the talk about integration and automation, and supporting multiple mobile devices.

And then I found out there's going to be a new sheriff in town.  May have not been news to anyone else, but I don't follow VMware's operations that closely.  A cartoonish screen shows a stage cane yanking Maritz off the screen and a big picture of the soon-to-be new CEO, Pat Gelsinger.  Gelsinger's delivery seems totally opposite from Maritz in his delivery.  In comparison, he sort of reminds me of that scene in Trainspotting with Spud's job interview (I'm grossly eexaggerating, but it's pretty polar).  I wonder how this will play out with VMware: an energetic head of the company.  It could bring life and energy, or will they lose focus with all of that energy?  Gelsinger's phrase was "Abstract.  Pool.  Automate."  He also talked about yearly releases of vSphere.  I wonder how that will change the product's lifecycle and support.

Then the CTO, Steve Herrod, was up.  His presentations seemed pretty rushed.  I'm guessing so he could fit in what he wanted to talk about.  vCloud Director seemed interesting, but I couldn't really follow from where I was sitting near the back of the room and right.  I didn't really understand the Serengeti/Hadoop presentation either..  I'll have to look into vCenter Operations Manager when I get back to the East Coast.

Architecting a Cloud Infrastructure

You may find something interesting from others that attended by searching Twitter and #VSP1168

This was a pretty good session.  No real dirty technical details, but really showed you how to give thought to developing your cloud infrastructure.  A lot are "common sense", but sometimes forgotten.  Some of my key takeaways were

  • Get good requirements from your customer or your business
  • Don't necessarily assume published "Best Practices" apply to you.  Read the Best Practices and determine for yourself.  For instance, some Best Practices developed during vSphere 4.x don't apply any longer, since some constraints were lifted in vSphere 5.x.  So, basically, use them as a guide, but not heavily depended on.
  • Add conceptual diagrams to your architecture diagrams.  Treat your architecture diagrams as a story book.
  • For sizing and scaling, VMware Capacity Planner is a really good tool.
  • For compute considerations, memory is generally your bottleneck, but don't assume that.  Know your apps.  The panel suggest the sweet spot for hardware is 96GB RAM with 2 sockets.
  • Networks are generally not the bottleneck.  10GbE networks should be adequate for growth.
  • In the discussion of booting ESXi servers, the panel said that the "best of all worlds" solution was PXE Boot, and to investigate GUI Fling.

Update Management for Physical and  Virtual Machines

OPS-CIM2661

I came into this one looking for tips on managing my OS's.  Come to find out, this was all about a VMware product called vCenter Protect.  For the foreseeable future, it only handles updating of Windows hosts, and nothing on the roadmap to support Linux or Mac.  I ended up leaving, since this isn't in my realm of operations, and the Windows guys use other products such as Altiris.

Avoiding the 19 Biggest HA & DRS Configuration Mistakes

You may find more information by searching Twitter hash tag, #VSP1232

This was presented by Greg Shields.  I've never been to one of his presentations, but I really found him entertaining.  Here's the high level 19.

1.  Not having similar processors in cluster for vMotion (whether at time of implementation or hardware refresh)
2.  Not planning for svMotion
3.  Not enough cluster hosts to support failover (use Admission Control Policy)
4.  Setting host failures the cluster tolerates to 1
5.  Forget to prioritize VM restarts (policy is defined per host, not globally)
6.  Disabling notifications from "Admission Control Policy" (see #3)
7.  Not updating percentage policy (the preferred method of setting failover resources)
8.  Buying the occasional big server (host failures must set aside outsources of the largest server)
9.  Neglecting Host Isolation Response
10.  Assuming that datastore heartbeat in vSphere 5.x will prevent isolation events
11.  Confusing "All Points Down (APD)" with "Permanent Device Lost (PDL)"
12.  Overdoing reservations, limits, and affinities
13.  Considering using shares without using shares
14.  Doing memory limits on VM's (DON'T DO IT)
15.  Thinking you're smarter than DRS
16.  Not understanding DRS equations
17.  Being too liberal (with DRS migration thresholds)
18.  Having VDI and server workloads in the same cluster
19.  Planning on overcommit (assign the right memory and CPU values to your VM's)

Become a Rock Star with Power CLI and vCenter Orchestrator

More information may be found by searching Twitter hash tag #VSP1856

This was presented by Josh Atwell (@josh_atwell), and was another entertaining talk.  It was pretty high level and didn't get into nitty-gritty scripting, but it was pretty informative for someone like me who never gave Power CLI much thought.

Some of my key takeaways (again some are Common Sense that you don't necessarily think of).
  • If you have common tasks that you do over and over again, try to automate it.  
  • Biggest strengths of Power CLI are data gathering, and bulk configuration changes to VM's
  • Planning of Automation - "Where are you now?  Where do you want to be?"
  • Check out Project Onyx.  It's a proxy to vSphere and will record the actual commands being executed within the GUI.  It will then output these to commands that can be run by Power CLI and vCenter Orchestrator
  • How to be a Rock Star?  Practice!  And finding items and implementing them.
  • "Today's miracles are tomorrow's expectations." Especially when you bust your hump to deliver miracles to the business or customer.
  • If you need help on something, post to Twitter with the appropriate hash tags.  People will generally respond.

Other notes

I finally got in to do a Hands On Labs (hasn't been less than a 60 minute wait these past two days to get in).  I did the vCloud Director lab.  It seemed pretty cool.

I missed out on #vFlipCup.  I'm disappointed.

Monday, August 27, 2012

VMworld 2012 - Day 0

Notes for Day 0 at San Francisco / VMworld


Here are my notes of my first full day in San Francisco. I call it Day 0 since none of the official talks have occurred yet. I will try to post my daily notes and experiences from SF/VMworld on this blog for the next few days, as time and other mitigating circumstances permit.

Walking

  • The hills in SF are no joke. We walked to the Wharf. I should've ditched my compadres and taken a bus or street car instead of walking back to the hotel.
  •  Chinatown is HUGE, and they like grocery shopping on Sunday.  It was tough walking up Stockton with all the produce shopping on the sidewalk.

Wharf 

  • Alcatraz doesn't look *that* far. Determined people couldn't swim that?
  • I didn't find the Bushman, but I wasn't looking either
  •  The pedestrian bridge crossing the street to Pier 39 is a good place to stop and look around and see the sights from a high, non-crowded vantage point
  •  After wondering why I was seeing helicopters hover around the Golden Gate Bridge for a while, I realize there's a big boat race going on. Come to find out later, it was an America's Cup race. You win again, Larry Ellison (damn you).

VMworld 

  •  This conference is a lot bigger than I thought it would be. It's in 3 buildings, and the fourth building has all the vendors
  •  The vendors really make you work for "free" tshirts now. You have to have your attendee badge scanned, sit through presentations, and tweet their company names. I was starting to think I was going on a free trip at a time-share
  •  Billy Mays would've been an awesome presenter for some of these products at the Vendor Booths
  •  I guess the usage of "Booth Babes" is dead now. Where did they go? 

I will try to post Day 1 notes tomorrow.  I'm signed up from 8:30am to 6pm.  It's gonna be a long day.

Tuesday, December 28, 2010

Transitioning from iPhone 3GS to HTC Evo 4G (Part 1)

I know. Long time, no blog, right? I'm on "vacation," I've got some spare time, and I just got the HTC Evo 4G yesterday afternoon. I figured I'm overdue, so here it goes.

Hi. Longtime iPhone user, first time Android ponderer. Love your show...

My contract has been up with AT&T for some time now, and I had been debating "the next phone." I had been using the iPhone 3G and 3GS for some time (gave my wife the 3G when she joined AT&T and took her new phone. I know, shame on me), but I wasn't ready for the iPhone 4. I've been growing tired of the New Wave Apple Fandom. You know what I'm talking about. All the people that want Mac Book Pro's, but then end up "needing" to run a Windows Virtual Machine to do work. Not to mention, like some of your luxury cars, you pay extra for the fancy Apple badge on the computer. Never mind the irony that I'm typing this on my home iMac, but don't pay attention to the man behind the curtain.

Don't get me wrong, Apple makes slick looking products. They are generally easy to use or figure out, and generally work well within their own universe. Shiny, pretty fast... and your user experience is controlled by Steve Stalin... I mean Jobs. That's what turned me off. I was already growing tired of those using Macs just because it was shiny, but wouldn't try to figure out how to let go of their Microsoft world. I've been annoyed by all the "Area 51" secrecy at Cupertino, creating overinflated hype and wild expectations for Apple Announcements that lead to a media frenzy, and the mild letdown when some of the rumors weren't true. I was aggravated that Apple wouldn't allow some useful mobile apps in their iTunes store, such as Google Voice. And then came the iPhone 4. With its issues, and the snarkiness of Steve Jobs when people were angry their expensive devices wouldn't work right, it was the last straw.

All that negative technical energy lead me to, "What's the alternative?" There was no way I was going to use Windows Mobile (Remember their aptly named WinCE... or Wince?). WebOS is kind of nostalgic, but sadly I think "Palm is dead." And don't get me started on Blackberry (hello "bland"). A few months ago, I wasn't sure about Android, but now I've taken the plunge. Their Android Market doesn't seem so restrictive and their OS is backed by Google. Even though Google is probably the next "Evil Big Company," I like their products. So yesterday, I went to the Sprint store (boy was it crowded) and got myself the HTC Evo 4G.


My, that's a big screen you have, Evo...

Today, I'll go through the hardware portion of the Evo 4G, and compare it to my old iPhone 3GS. I know it's comparing apples to oranges (pun not intended), but this is more intended for those that are in my boat of iPhone users that don't want iPhone users anymore.

First off, the size of the phone itself. Noticeably, the screen is bigger. The Evo has a 4.3" screen, compared to the 3GS 3.5" screen. However, the Evo (4.8 x 2.6 x .5) really isn't that much bigger than the 3GS (4.5 x 2.4 x .48). I know some people say the Evo is too big, but when you put it in that perspective, is it?

The camera(s) (8 megapixel camera with flash and a 1.3 megapixel front facing camera) on the Evo is much better than the one 3 megapixel, no flash, camera on the 3GS. Granted, you'd hope so since the Evo is much newer.

I will say Apple did one thing arguably right with the iPhone. I do like the buttons and controls on my iPhone better than the Evo. The iPhone has the one magic button to return you to the main screens, as opposed to Evo's web browser-ish four buttons for navigation. Although I'm starting to get the handle of how navigation is supposed to work with the Evo/Android, I don't see my 2 year old son figuring out my Evo like he did with my iPhone. No more just handing him the cell phone to play his games when he gets fussy and not having to help him.

Also, I like the overall volume buttons on the iPhone as well. They both have the up and down volume button, but the iPhone also had the useful "change to vibrate mode" button as well. Speaking of volume, I'm disappointed that the Evo didn't come with a corded, hands-free accessory. I liked that the iPhone 3GS came with one, and it had a volume and rudimentary music/voice control on the wire.

Now comes the real unpleasant fact about the Evo. Its battery life does not compare to the iPhone. I will definitely have to keep a car charger and the USB charging cable with me at all times. It also brings me to another gripe that I also have with the iPhone. The Evo uses YAPC (Yet Another Proprietary Cable). At first glance, it looks like it uses a micro-USB cable, which would've been GREAT (hey, Blackberry uses one!). It's not. It has about the same width and shape, yet just not as "tall".


When will this diatribe end???

So far, I'm not blown away by Evo if I think about it from a pragmatic approach. The buttons, the battery life are a bit disappointing. Not to forget the fact I'm now using Sprint/Nextel, my least favorite of the wireless providers I've used in the past, doesn't get me very enthused. However, the look and feel, and the freedom from Apple's Iron Curtain is exciting and pretty cool. It's sort of like the feeling you have when you're getting into a new relationship with someone you're been really interested in from afar. Unlike most of those kinds of relationships, I hope this one will last through its annoyances and flaws.

In the next few days, I will try to post more about my experiences with Sprint service quality, usability, the main apps that I use, and if I decide to run back to AT&T before my 30 days are up.

Wednesday, February 3, 2010

Quick and Dirty NetBackup Reporting

I needed a quick way to get the statuses of my NetBackup runs on a daily basis. This works for me, but maybe because there aren't that many servers (~30) that we are backing up. I'm sure there's nicer ways to do this, but if you want something quick and dirty, I have this line in my crontab.

/usr/openv/netbackup/bin/admincmd/bperror -U -backstat -s info -hoursago 24 | mail -s "Netbackup Report for `date +%D`" backup-admins@example.com

Monday, October 5, 2009

Info For Those Considering AT&T's Microcell

I wanted to send this out in case others are considering purchasing AT&T's Microcell.  Before this becomes an "AT&T stinks" thread, let me preface that my particular issue is with my apartment.  It's a proven dead zone for AT&T, Sprint, and Verizon.  Also note that the Microcell only works with AT&T 3G phones.

Yesterday, I purchased the Microcell from the AT&T store in Cary. After taxes, it was about $162. The sales rep also informed me that if I did sign up with the $20/month "unlimited minutes" Microcell plan at the time of purchase, there was a $100 mail in rebate for the Microcell.

After some issues trying to set me up with the rebate deal (a Microcell with 5 months of unlimited minutes?), we found out my account wasn't eligible since it was created in the Washington, DC Metro area. The deal is only good for plans created in these trial markets. This also goes for the ability to purchase the $20/month for unlimited minutes. The sales person did say that they've been told the Microcell was going to be further rolled out in January, and I'd be able to get the $20/month unlimited minutes plan then (sadly, minus the $100 rebate). However, the Microcell itself only has geographical constraints, so it would still work in my apartment.

Once I got home, my set up was pretty easy. The only caveat is that the Microcell needs to be able to get a GPS signal. That meant I couldn't place the Microcell where I really wanted to in my apartment. Once it was powered on and connected, it took about 90 minutes for the Microcell to connect, register with AT&T, get its GPS signal, and be ready to go. When it was online and ready, I received an SMS message saying something to the equivalent of "Thanks! You're Microcell is ready."

I now have full signal in my apartment (as opposed to none). A few test calls and text messages worked fine as well. I haven't tried web access over Microcell, since I use my wi-fi with my iPhone. You can have up to 10 phones that can connect to your Microcell. The numbers have to be added to your online AT&T account management page for others to be able to use it. Right now, it's just my wife's and my cell phone.