Determining Block Sizes in CentOS 5 & 6

Been a looooong time, but I felt this was worthy of continuing to build up my tips and tools library/blog with some block searching info since I ran into this today @ work.

lsblk is only available on CentOS 6+ to my best knowledge, so on CentOS 5, we’d want to run the following:

[root@deadbeef ~]# tune2fs -l /dev/disk/block/fun | grep 'Block' | tr -s ' ' | cut -f3 -d' '

471859163
4096
group:

So the first number is the amount of blocks and the second is the block size here.  Multiply them together to get your answer in bytes. The word group: is just an anomaly of the filtering and can be ignored.

In CentOS 6, we can leverage lsblk:

lsblk -o NAME,PHY-SeC

Output:
NAME   PHY-SEC 
sda        512 
├─sda1     512 
├─sda2     512 
└─sda5     512 

Advertisements

Desktop OCD (Why I switched from a 17″ Macbook Pro, to an 11″ Macbook Air)

IMG_1527Recently my employer was extremely kind enough to spoil me yet again and replace a late 2010 17″ Macbook Pro I was using with an 11″ 2013 Haswell Macbook Air.  It’s taken some time for me to define what a laptop should be, and have recently come to the conclusion that a laptop should be light, with form factor conventions that make it wieldy, convenient to take from one location to the next, and facilitate your work and entertainment on the go.

Over the years it’s taken me some time to realize what I need out a workstation, and laptop.  My original school of thought for the past 12 years was that I needed an extremely high resolution for desktop real estate whether it be a workstation or laptop. This was partly because I was battling with what some may consider mild OCD with my workspace and workflow in relation to my desktop scheme, and because I still wanted to play Blizzard and Steam games.  I believed that my desktop application placement had to be perfect, ranging from e-mail client, to terminal, and various other applications.  I was also determined to cram every regularly used application in tight order onto one screen, which is why I originally thought that a 17″ Macbook Pro for my work on the go was a good idea.

By now it should be pretty apparent that I was very slow to adopt multiple virtual desktops with what OSX implemented in Spaces (something that I was already aware of for years with Linux GUI desktop managers) some revisions of Macintosh exotic cat named operating systems ago.  When I started dealing with more Windows administration and VMWare for my job, I found that using multiple virtual desktops was a far more efficient way to work.  Finally, realization set in that it’s okay to have a “messy” desktop and in a sense was relieved by this.  After this minor technical enlightenment, I became increasingly more frustrated lugging around a 17″ Macbook Pro (#firstworldproblems).  It got to the point where I didn’t want to use it in any situation other than sitting at a desk.  Enter the Macbook Air.

Since I’ve been using the Macbook Air for the past 2 weeks, I have realized how well this ultrabook works for me and how impractical the 17″ Macbook Pro was.  I actually enjoy taking the Air to work, and meetings now, where as before I preferred to keep the 17″ Macbook Pro on my dining table, or desk and rarely traveled with it.  As for games, I found that I was hardly gaming after a while.  The other thing that I’m really impressed with is battery life.  9 hours of usage is very impressive compared to what I was seeing before with the Pro.

I guess the lesson learned here on a somewhat deeper level is to practice sensibility more often.  This is something I think I’m still struggling with and striving to be better at in my mid-30’s.

mkinitrd syntax error regarding conditional expression(s)

So working with an older CentOS 5.1 system today, I ran into a problem which I believed to be mkinitrd related when attempting to install kernel-PAE on a vmguest I upgraded to 4GB of vRAM.

I was seeing this upon yum installing kernel-PAE:

/sbin/mkinitrd: line 489: syntax error in conditional expression: unexpected token `('
/sbin/mkinitrd: line 489: syntax error near `^(d'
/sbin/mkinitrd: line 489: `        if [[ "$device" =~ ^(dm-|mapper/|mpath/) ]]; then'

So it turns out that bash was the problem here not mkinitrd.  I never thought that mkinitrd and bash would be so intertwined, but it makes perfect sense if you think about it.  I just never had to think about it ’til today.

I guess that serves us right for not keeping up with CentOS releases.  A big thanks to SmogMonkey for posting this find on http://www.howtoforge.com/software-raid1-grub-boot-fedora-8-p2#comment-33804.

Sneakerhead

It’s been a long time since I’ve posted, so I figured that I should break back into this blogging game and write about something I love as a hobby.  Basketball, and more importantly the shoes that go with them.  Call me a “sneakerhead”, that’s fine.  I appreciate sneakers, whether it’s shoe I wear casually, or more importantly, something I use on the court for the best performance possible.

Some have asked me, “Why do you spend so much on shoes for basketball?”.  My feet are the most important asset for basketball, so why not spend research time and money to make sure I get the best products available.  I don’t expect them to make me be like Mike, break ankles like Kobe, or dunk like Lebron.  I expect them to give me the best possible support, cushion, and performance money can buy.  I’m going to break into some thoughts on performance basketball shoes I’ve purchased and why.

Recently, Jordan Brand came out with some great innovation in terms of athletic science and support with the Air Jordan XX8 with the shoe itself focusing on energy efficiency.

IMG_1333

I am a custom orthotic user, and they fit perfectly inside the AJXX8, almost as if the shoes were designed to support them specifically if needed.  Some might call these ugly or non-conventional, but playing in these first hand, I can tell you that these are a great performance basketball shoe.

Kustoo.com got together with the Jordan Brand’s designer Josh Heard to go over the shoe itself, and what they were trying to accomplish other than making money off of us as consumers.  It’s a great read overall.

A detailed look at the Air Jordan XX8 with designer Josh Heard

Another great shoe I’ve been playing in with great success is the Kobe 8.  I haven’t played in the Kobe since I acquired custom orthotics with the Kobe 6.  The 6 unfortunately did not work well with my custom orthotics and I moved onto the Lebron line as a result back then.  Well now with the Kobe 8 “System”, a custom tailored midsole can be purchased from Nike to work with orthotics of all sorts.  Below is a picture of the Kobe 8, my orthotic on top of the removable midsole, and the default combo mid+insole the Kobe 8 ships with for reference.

BEy7shqCIAAsyWQ.jpg-large

In short, these remind me of the Nike Free run shoe with more stability, cushion, support, and most importantly a one to one fit. The default insole that comes with these mold to your feet, but are of course no where near as effective as the prescribed custom orthotics in my opinion.  If you want a detailed review of this shoe, check out Kicksoncourts.com’s thoughts on them.

Being someone that has played in the Lebron line for some time now, the Air Jordan XX8 and Kobe 8 made me realize how heavy and bulky they are for my size and athletic ability, effectively making me clumsy on the court.  This is of course due to the fact that Lebron’s shoe line are crafted to perform well for guys as freakishly built and as athletic as Lebron James. The Lebron X is a prime example of this.  Great cushion, lots of tech, but built for a beast, not a regular guy like me, and now this shoe has turned into an expensive outdoor shoe.  Don’t get me wrong, I enjoy the shoe, I just prefer others to it at this point in time.

IMG_1336

The only Lebron shoe that works extremely well for me is the Lebron 9 Elite.  These were released last year and was an effective re-design to the original Lebron 9 released in late 2011.  If the X Elite follows suit in this direction, it could be promising for the average guy as well.

IMG_1334

So why so many shoes, right?  Shoe rotation.  Most athletic podiatrists for pro and college teams suggest that after a shoe has been worn through extensive play for more than 60 hours, they should be retired and not used further due to midsole compression and stretching of the upper materials from the torque of use and moisture from sweat.  Well fortunately for my wallet’s sake, I don’t play any where near a professional level, so three shoes in my current rotation should last me a long time.

Cleanly uninstalling Google Chrome in OSX

So being the big nerd I am, I enjoy playing Fantasy Football.  The other day I noticed that Chrome was having an issue rendering projections, scores, and notes from player card previews on http://football.fantasysports.yahoo.com/.

Since I wasn’t really in the mood to debug, I decided to just cleanly remove Chrome to resolve my issue.  If you do feel like debugging you can do so via Chrome.app command arguments:

In terminal.app run the following:

open /Applications/Google\ Chrome.app --args --enable-logging --v=1

At any rate, after removing the following files in terminal.app, I was back to Fantasy Football browsing insanity:

rm -r /Applications/Google\ Chrome.app/
rm -r ~/Library/Application\ Support/Google/Chrome/
rm ~/Library/Preferences/com.google.Chrome.plist
rm ~/Library/Preferences/com.google.Chrome.plist.lockfile
rm ~/Library/Preferences/Google\ Chrome.plist
rm ~/Library/Preferences/Google\ Chrome.plist.lockfile
rm ~/Library/Saved Application State/com.google.Chrome.savedState
rm ~/Library/Application\ Support/CrashReporter/Google\ Chrome*.plist
rm ~/Library/Google/GoogleSoftwareUpdate/Actives/com.google.Chrome
rm -r ~/Library/Speech/Speakable\ Items/Application\ Speakable\ Items/Google\ Chrome/

OSX & Linux Disk Benchmarking

As a SysAdmin, you’ll need to benchmark disk performance from time to time, or rather just gloat that your system’s drive is better than your buddy’s. In my particular case, I have an existing need to quantify performance metrics on my work macbook pro’s disk speed with Symantec PGP (don’t get me started on this product), without it, and with Apple FileVault in place of it.

Perusing the web I came across a good article from cultofmac.com that assisted me with my disk benchmark testing.  This can apply to OSX and most Linux systems as well.

To test a system’s write speed, I used the following command from a terminal window:

time dd if=/dev/zero bs=1024k of=speedtest count=1024

Output from my work iMac w/SSD:

1024+0 records in
1024+0 records out
1073741824 bytes transferred in 8.948791 secs (119987362 bytes/sec)

real 0m8.954s
user 0m0.001s
sys 0m0.413s

The bytes per seconds number when converted to Megabytes equates to 114.42887 Mb per second.

To test the read speed of my disk, I ran the following from terminal.app:

dd if=speedtest bs=1024k of=/dev/null count=1024

Output:

1024+0 records in
1024+0 records out
1073741824 bytes transferred in 0.145955 secs (7356659197 bytes/sec)

So this is around 7016 Mb (6.8 Gb) per second with some rounding.  Based on the above output results, my work iMac w/ SSD can write at 114 Mb/s, and read at 6.8Gb/s.

When I get around to testing on my work laptop, these commands should give me good data metrics.

As far as bytes to Mb/Gb/etc conversioning goes, you can use google conversion web tools, or the “units” command on a Linux host if available.  There are several alternatives you can use as well.

Units Linux command sample for reference:

units –terse “119987362 bytes” “MiB”

Output:

114.42887

Running logrotate Manually

So the other day at work, I needed to modify logrotate.conf for one of our groups.  To test my changes, I forced a logrotate.d run in verbose mode to ensure that my changes were applied properly.

The command I used:

logrotate -vf /etc/logrotate.conf

Since I’m predominantly administering CentOS, /etc/logrotate.conf is where my logrotate config file lives.  In Debian or Ubuntu however, one might find their logrotate configuration file under /etc/logrotate.d/<hostname>.conf.