ioreg -l | grep IOPlatformSerialNumber
How To: Get Your Mac Serial Number From Terminal
January 24th, 2010 by boogybrenRun A Command Every N Seconds
January 21st, 2010 by boogybrenShort story long…
This week, Apple officially release support for Windows 7 in BootCamp 3.1. I thought to myself “Self, you have a wonderfully powerful Mac Pro with 8 cores and 10GB RAM that is being completely unused by your XP install, you really should upgrade to to Win7 x64 now that Apple officially supports it”.
So, that’s what I did, with no thought as to how much MORE disk space I would need on my BootCamp partition.
So after installing Windows 7 and a bunch of games, I received my you only have < 500MB of disk space left alert.
This brought me to a point where I needed to resize my OSX HFS partition and grow my Windows NTFS partition. During this madness, I realized that with BootCamp 3.1, I could view my HFS partitions from Windows! But much to my chagrin, I couldn’t see my slice that had all of my useful data because it was a part of a concatenated RAID.
After resizing my OS partitions, I decided to move data off my RAID slice so I could break it then just create a normal HFS partition that can be viewed from Windows. The problem is, moving almost a TB of data can take a long time and turning from my laptop to my left 45 degrees to my desktop on my right every time I wanted to see how my disk space looked left me with a pain in my neck!
I was at that very moment reminded about using while & sleep. Below is a handy little command that will run any command every number of seconds until you break (ctrl-c) it.
while true do command sleep 30 (seconds) done
I personally ran:
while true do df -h | grep disk1s2 sleep 30 done
Which allowed me to monitor the growth of the destination disk I was copying to.
-boogybren
Grep For More Than One Word Recursively
January 19th, 2010 by boogybrenI have an application that runs on AIX that is nothing short of ugly when it comes to pointing it to a different datasource. This application currently uses an outdated version of Savvion BPM that requires manual editing of any config file that contains the datasource and/or credentials. To complicate things further, our application which runs in WebSphere also has some config files that need manual updating.
Today…I decided to try and document the process as to save me and anyone else who comes behind me some serious grief.
Because AIX’s version of grep doesn’t have a -R option, I will give you syntax that *should* work on any flavor of UNIX/Linux with grep.
find /path/to/parent/directory -type f -print | xargs grep -i -E 'word1|credential1|server1|server2|server3' > /path/to/output/file
Let’s dissect this for clarification:
find /path/to/parent/directory -type f -print
We are telling the find command where we want grep to search. You can either specify the explicit path for example, I searched under /opt, or you can change directory to the parent directory then issue a “.” (sans double quotes) to tell find to “search from here”.
The -type f simply tells find to locate regular text files, not binary files.
The -print is important. It will print the full path to the file. The reason this is important is because when grep finds a match in one of the files, it will print the full path out in addition to the line it found within the file so you know exactly where the file is located for future reference.
xargs
xargs simply is a command that allows you to issue any command (grep in our case) against the list of standard-in (list of regular files) one at a time. As if you did it one at a time manually.
grep -i -E 'word1|credential1|server1|server2|server3'
grep is a command that allows you to search the contents of a file for a specific pattern. The -i tells grep that this search is case insensitive. The -E tells grep that we want to use regular expressions in our search.
We then follow with a basic regular expression. Our search is in single quotes and each word we want to search for is separated by the pipe symbol. We are just asking grep to find any word that matches in the list.
> /path/to/output/file
Here we are just redirecting the results of our search to a file so that we can review and modify as we deem necessary. Remember that if you already have data in the destination file, a > will overwrite the contents with the new data found. A >> will just append to the file.
Once this command has finished, you will be able to edit the file and remove any false positives that grep might have come across.
Some what dirty, but a simple solution.
What Was YOUR College Value?
December 28th, 2009 by boogybrenBeen a Part of Big Business IT?
December 2nd, 2009 by dubI am not a big Computerworld fan, but I came across this article today and felt it had a lot of valid points. This more than likely will not translate to a lot of the readers here, but if you have had anything to do with IT in a large business I think its worth a few moments to read.
Opinion: The unspoken truth about why your IT sucks
~dub
HOWTO: Find the Top 50 Largest Files in Linux/Unix
November 12th, 2009 by boogybrenThis should be linux/unix OS agnostic.
sudo find . -type f -exec du -m {} \; | sort -nr | head -50
If you need more or less files, adjust the last digit following ‘head’.
-boogybren
Dialing Conference Calls On-the-go
October 23rd, 2009 by jonlikesbikesThough I’m usually at my desk, in my office (like a good worker bee), there are times when I want to be, um, away. Sometimes this is legit. Sometimes I want others to think it’s legit. And other times, I’m stuck dialing into a conference call whether I’m supposed to be away from the office or not.
This isn’t a big deal, since I almost always have my mobile phone with me (currently, a Blackberry Bold). I open up my appointment and click on the number to dial it. The only problem then is to remember the passcode to get into the meeting.
This wasn’t a problem when the numbers were 6 digits long–I’m just barely smart enough to remember 6 digits for 15 seconds while I dial.
However, for some reason, they’ve gone to 10 digit numbers now, and my brain can’t handle that much. This usually means that I have to get people around me to help me remember. Or I have to find a scrap of paper lying around and write it down.
However, I have found the end to all my woes, and it comes in the form of formatting numbers so that my Blackberry will dial BOTH the number AND the passcode with one click of my trackball. Here’s the secret:
1-800-555-5555×1234567890#
Where “1-800-555-5555″ is whatever your conference dial-in number is and “1234567890″ is whatever your passcode is. Though I don’t have a Windows Mobile device, I’ve heard it works on those, as well. Basically, with it formatted this way, one click dials the number and enters the passcode (complete with the obligatory pound/hash key).
Of course, in my excitement to discover this, I overlooked a major flaw in my logic: It isn’t MY meetings I’m dialing in to. So, in an effort to make my life better (and to help all those around me), I plead with those people that hold a bit of my future in their hands. Please, please, PLEASE use this whenever you send out a meeting invitation.
Thank you.
(source: http://forums.crackberry.com/f79/auto-dial-24126/#post690129)
HOWTO: Run VMWare vSphere Client 4.0 on Windows 7
October 19th, 2009 by boogybren1. Obtain a copy of %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\System.dll from a non Windows 7 machine that has .NET 3.5 SP1 installed.
2. Create a folder in the Windows 7 machine where the vSphere client is installed and copy the file from step 1 into this folder. For example, create the folder under the vSphere client launcher installation directory (+%ProgramFiles%\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\Lib+).
3. In the vSphere client launcher directory, open the VpxClient.exe.config file in a text editor and add a <runtime> element and a <developmentMode> element as shown below. Save the file.
<?xml version=”1.0″ encoding=”utf-8″?>
<configuration>
…
<runtime>
<developmentMode developerInstallation=”true”/>
</runtime>
</configuration>
3. Create a batch file (e.g. *VpxClient.cmd*) in a suitable location. In this file add a command to set the DEVPATH environment variable to the folder where you copied the System.dll assembly in step 2 and a second command to launch the vSphere client. Save the file. For example,
SET DEVPATH=%ProgramFiles%\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\Lib+
“%ProgramFiles%\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient.exe”
4. (Optional) Replace the shortcut on the start menu to point to the batch file created in the previous step. Change the shortcut properties to run minimized so that the command window is not shown.
You can now use the VpxClient.cmd (or the shortcut) to launch the vSphere client in Windows 7.
courtesy of Fernando
-boogybren
And suddenly I don’t feel so bad…?
September 15th, 2009 by dubI really got a kick out of this article. It makes me feel much better about my normalcy level in life. The article is an “oldie but a goodie”. I am not a Beatles fan, but couldn’t help but hum the tune to “With a Little Help from My Friends” while reading this. So in some way, I suppose this is a little shout-out of thanks to my friends for sticking around and ignoring my geeky-ness so I could avoid the predicament these fellas are in.
~dub
Apple thieves beware
September 1st, 2009 by dubYou know, I really hadn’t given the MobileMe service from Apple much thought. Why? Honestly, its just one more thing to pay for that I will never use. Or will I? This guys story made me think twice about it.
An incredible stolen Mac story without a final chapter.
~dub
