Page 8 of 28
Rick Ross' Financial Success
Since he was mentioned on The Daily Show a few weeks ago, Rick Ross has quickly become my favorite rapper. The king of repetition, Ross hails from Miami and makes much of his activities trafficking drugs despite allegations that he worked for the man during part of his life. Like many rappers, Rick Ross talks a lot about his expensive cars and I noticed a trend in the vehicles of which he spoke.
In his first album, Port of Miami, Ross’ makes a number of references to his white on white BMW 745i such as this line from the hit single Hustlin’:
Who tha fuck you think ya fuckin with? I’m tha fuckin boss
745 white on white, thats fuckin Ross
To be sure, any BMW 7 series is a fine car, but the 745i is the base model of the line. Is Rick Ross a poor rapper? Not too fast, in the song White House, he mentions a Rolls Royce Phantom:
we in the white house
big phantom on the lawn getting wiped down
Is this song a fantasy about occupying the White House proper, or is it simply hyperbole about his mansion, with a nod to cocaine usage and trade? Given the previous mention of a 745i, I can only assume that the Phantom was but a fantasy for Rick Ross in 2006.
Times change. In 2008, Rick Ross released the album Trilla and it sounds like he’s had a significant upgrade. The song Luxury Tax, makes specific mention of a 760, the top of the line BMW 7 Series:
Got my whole arm rocked.
Keep the 760 double parked in the wrong spot.
The cover of the album also features the rapper in the back seat of a Maybach, the sole car from the eponymous ultra-luxury brand owned by Mercedes. The album also includes a song Maybach Music, Ross says that he has 20 whips, one of which is a Maserati.
Shell Command Substitution
The other day I wanted to diff a pair of files on two different hosts, stg1 and stg2. Normally, I would do so by copying on of the files to the other host, or grabbing them both onto my workstation with scp
; “there must be a better way,” I thought.
Enter command substitution, a process by which you use the output from an executed command as the input to another. Many people have used this in a simple manner such as ls /usr/src/linux-`uname -r`
which takes the output of uname -r
, namely the kernel release you’re running, and uses that to flesh out the ls
command. There is a more complicated form, however, that I use for diffing remote files. In the aforementioned example, I used the following command to diff the files:
vimdiff <(ssh stg1 cat /etc/rc.d/init.d/httpd) <(ssh stg2 cat /etc/rc.d/init.d/httpd)
Much like a subselect in MySQL, the cat
commands are executed on the remote machine and then piped to vimdiff
allowing for single command, no-file-copying diffs.
Speeding up SSH Logins in Ubuntu
After getting access to some new machines, I noticed that SSHing too them was excruciatingly slow, taking 5-10 seconds to ask for a password and no faster using keys. I pulled open the global SSH config file, /etc/ssh/ssh_config
on my Ubuntu machine and found a couple of GSSAPI things that were enabled by default:
GSSAPIAuthentication yes GSSAPIDelegateCredentials yes
The machines I was SSHing to don’t do GSSAPI, so every time I tried to connect my client had to wait a short timeout before trying other authentication methods. Since I don’t care about GSSAPI (few people use it), I simply set those options to no
and now my SSH sessions start much more quickly.
No-Tech Hacking
While looking through the audio from the last hope, I stumbled across Johnny Long’s talk entitle No-Tech Hacking. I saw this talk a couple of years ago at ShmooCon and re-watched it via the above Google Video link and it’s just as good as the first time. Anyone interested in any sort of security should watch this talk because it’s very interesting and very funny.
Popular IM Networks
A blog post by one of EQO’s founders, Jeff LaPorte, claims to have insight into the market share of the instant messaging services throughout the world. The graphic (PDF) shows the strength of competing IM services in different markets throughout the world. I immediately questioned the data because it showed AOL Instant Messenger with a narrow lead over MSN and Yahoo!, who share a close second. Personally, I’ve never used either of those services, nor do I know anyone who regularly does; is that because I’m a curmudgeon or the EQO data is inaccurate? I must side with the latter.
The crux of the issue is that EQO is an instant messaging application for mobile phones running Windows CE, so the data they have is for that subset of the IM user market, not representative of the market as a whole. So what can we glean from this data? People who have Windows-based smartphones prefer MSN worldwide, save for AIM’s slight edge in the United States. What can’t we learn from the data? The state of the instant message market as a whole. EQO’s usage data ignores other smartphone users, most notably the iPhone and users who don’t have smartphones or aren’t interested in IMing from their phones.
DEFCON 16 EFF Panel
Much of the Electronic Frontier Foundation’s talk at DEFCON 16 concerned the temporary injunction that prevented MIT students from giving a talk on vulnerabilities of the MBTA farecard system. The injunction seems to say taht the only people prevented from disseminating the information about the system are the MIT students themselves and any cohorts in their research. One question that I head was which other systems may be vulnerable to the same RFID card attack and here’s the list from their slides:
- Boston
- London
- Netherlands
- Minneapolis
- South Korea
- Hong Kong
- Beijing
- Madrid
- Rio de Janeiro
- New Dehli
- Bangkok
More information is provided in their slides.
Installing Mechwarrior 2 in DOSBox Under Mac OS X
Put the Mechwarrior 2 CD into your Mac’s CD drive; it will show up as two mounted discs, one for the audio and one for the game data. The disc I have is for Mechwarrior 2 v1.1, so the game data is mounted as /Volumes/MECH2_V1_1
; if you have a different version, the mount point will be slightly different and subsequent commands should be adjusted to match. To access the disc in DOSBox, you must mount it. Start DOSBox and type:
mount d /Volumes/MECH2V11 -t cdrom -usecd 0You will also need a place to act as a fake
C
drive, where the game will be installed. I created a directory dosprog
in my home directory and mounted it in DOSBox like so:
mount c ~/dosprogTo install the game simply go to the mounted CD and run the setup:
d: INSTALL.EXEFollow the installation program, clicking happy things like “yes”, “continue” and “full install”. Choose the top-most audio devices in the list. Next, download the NOCD crack from here, unzip it in Mac OS and use the files from the crack to replace those in your
dosprog/mech2
folder. Now, back in DOSBox, go to the c:\MECH2 directory and play:
c: cd c:\MECH2 MECH2.EXESee also: Vogons
Apache Won't Start: No space left on device
I’m doing some development involving Apache handlers which involves lots of restarting it and occasionally Apache shutting down uncleanly. After numerous restarts, the webserver refused to start printing the following in the error log:
[Wed Jun 25 18:57:11 2008] [emerg] (28)No space left on device: Couldn't create accept lock
After being confused because there certainly is enough disk space, I Googled for other possibilities and it turns out I had hit another limit, that of active semaphores. When some of my processes were killed, they died uncleanly and didn’t clean up their open semaphores, filling the maximum number available to my user. It’s easy to tell that this is the root of the issue; running ipcs -s
showed a list of 95 open semaphores. Clearing them up is just as easy:
~$ for id in \`ipcs -s |awk '/USERNAME/ {print $2}'\`; do ipcrm -s $id; done
That prints the list of semaphores, grabs the ID ({print $2}) for lines containing USERNAME (your own or that which the webserver runs under) and then ipcrm
’s those semaphores.
Subversion diff with vimdiff
Side by side diffs are much more legible and useful than those in unified format or any other linear diff. By default, the svn diff
command presents output in the unified format, though it has an option, --diff-cmd
, which allows you to specify the program that will perform the diff. Passing vimdiff
as the diff command doesn’t work as the options passed by svn diff
are a bit complicated:
~/code/perllib/MG$ cat foo.sh \#!/bin/bash echo $* ~/code/perllib/MG$ svn diff --diff-cmd foo.sh Proxy.pm Index: Proxy.pm -u -L Proxy.pm (revision 21095) -L Proxy.pm (working copy) .svn/text-base/Proxy.pm.svn-base /tmp/svndiff.tmp
Subversion is telling diff to output context (-u
), show pretty names for the files (-L
) and then the two files to diff. To make this work with vim
, we simply need to cut out the extra options. To do so, I wrote a simple script:
\#!/bin/bash shift 5 vimdiff "$@"
I put that in ~/bin/svnvimdiff
and now I can do svn diff --diff-cmd ~/bin/svnvimdiff Proxy.pm
and view the diff in vimdiff
. Since this is a command I use often, I aliased it in my .bashrc
:
alias svndiffvim='svn diff --diff-cmd ~/bin/svnvimdiff'
Keeping Your Home Directory in Subversion
I’ve heard of doing this for a long time, but always figured it’d be a huge jump to put my home directory into a revision control system. For years I’ve scp’d files to a new machine when I moved in and when I made changes to my vimrc or ssh config, it was hell to propagate the changes to my other machines. No more is this an issue, since I’ve commited my home directory. The process is really quite trivial.
I first created a subversion repository on my Linux server. A special machine isn’t required, nor is root access; you just need somewhere that can be accessed with SSH from the intertubes.
~$ svnadmin create subversion
It’s as easy as that. To begin with, let’s create the standard subversion directory structure.
~$ svn co file://$home/subversion/ foo ~/foo$ cd foo ~/foo$ mkdir homedir ~/foo$ svn add homedir ~/foo$ svn commit ~/foo$ cd .. ~$ rm -rf foo
So now we have a repository with a homedir directory in the root; this is where all of the files from your home directory will be checked into the repository. To begin with, check out this new project into the root of your home directory.
~$ svn co file://$home/subversion/homedir .
Since there isn’t anything in there, nothing will actually be checked out, but subversion will setup source control on .
, your home directory. So let’s add something to it. I have a .vimrc
that ought to be identical across environments, so I’ll check that and my .vim
support directory into the repository
~$ svn add .vim* A .vimrc A .vim/colors/drew.vim A .vim/plugin/feraltogglecommentify.vim ~$ svn commit -m "adding stuff for the first time!"
Easy as that, all of my vim configuration files are in subversion. Now for the awesome part. Like I mentioned, I have a number of machines and, things like vim configuration files should be the same on all systems. So now, I hop onto another machine and checkout the homedir project. First I remove the existing .vim*
files since they will be replaced with the repository versions.
Caligula:~$ rm -rf .vim* Caligula:~$ svn co svn+ssh://dinomite.net/home/dinomite/subversion/homedir . A .vim A .vim/colors A .vim/colors/drew.vim A .vim/plugin A .vim/plugin/feraltogglecommentify.vim Updated to revision 1.
Bam. I’ve now got the exact same files on both machines. If I’m at the office and find some flash vim option that I want to use, I simply add it to my .vimrc
, check it in with svn ci .vimrc
and when I svn up
from the other machines, they’ll get the new changes. In reality, I keep a bunch of stuff in my homedir subversion repository: .bashrc
, .screenrc
, bin
directory and many others. Subversion helps me keep all of my config files in sync across a number of different machines that I use on a daily basis; if you use more than one system with any frequency, I highly suggest checking in your home directory.