Terminal Tip: Finding information about a mp3 audio file…

Apple, CLI, Macintosh, OSX
Here is a quick tip for you OSX command line fans. If you want to find metadata information about a mp3 file use the "afinfo" command. Very quick and scripting friendly. Here is a example: $ afinfo 08_\ Lily\ Allen\ -\ Fk\ You.mp3 File: 08_ Lily Allen - Fk You.mp3 File type ID: MPG3 Data format: 2 ch, 44100 Hz, '.mp3' (0x00000000) 0 bits/channel, 0 bytes/packet, 1152 frames/packet, 0 bytes/frame no channel layout. estimated duration: 215.249 sec audio bytes: 5167920 audio packets: 8240 audio 9490176 valid frames + 576 priming + 1728 remainder = 9492480 bit rate: 192000 bits per second packet size upper bound: 1052 maximum packet size: 731 audio data file offset: 32353 optimized ----
Read More

Duplicating service settings under OSX Server…

Apple, CLI, Macintosh, osx Server
This mainly applies to how you deal with a backup DHCP server and it's configuration, but might also be useful for backing up other service settings. One of the things that kinda bugs me about how some services are configured in OSX Server is the fact that the configurations are stored in the directory. For example, if you have a DHCP server servicing a subnet with a ton of reservations hardcoded in it, there is no way of editing and/or moving the information from the command line (ie: there is no single config file that contains the current configuration) to another server. That's where the "serveradmin" commandline program comes to rescue. If you have two identical servers (ie: both running the same OSX server version), you can use serveradmin to…
Read More

MySQL: Transfering users and priviledges to a new server….

CLI, mysql, Sysadmin, Tip
So this was a great big mystery this morning. How the heck do you transfer the users and their privileges out of a old mysql server and "import" them into a new server. We recently upgraded from OSX 10.4.11 to a couple of spanking new Snow Leopard servers and during the mysql export/import cycle this issue came up. Well the simple answer is.....DON'T USE mysqldump on your mysql DB (you know the default DB that stores all your users and privileges. It's a bad idea and will probably do more harm than good. Instead use the following procedure: 1) On your old server (the one that has your data/users/tables on it) issue the following command (replace YOUR dbadmin/root username and  password in the 2 appropriate places: mysql -B -N --user=admin…
Read More

ASCII Art for all your N.E.R.D.ly needs :-)…..

ascii, CLI, History
Yep, a whole archive of ASCII Art, brought to you by Christopher A. Johnson......Ahhh, just like heaven.... ..uu. ?$""`?i z' `M .@" x" 'Z :#" . . f 8M '&H?` :$f U8 < MP x#' d#` XM $5. $ M' xM" .!"> @ 'f`$L:M R.@!` +` > R X "NXF R"*L k 'f M "$$ :E 5. % `~ " ` 'K 'M .uH 'E `h .x*` X ` .uf` * .@8 . 'E9F uf" , , 9h+" $M eH. 8b. .8 ..... .8` $' M 'E `R;' d?"""`"# ` E @ b d 9R ?* @ > K.zM `%M' 9' Xf .f ; R' 9 M .=` t M Mx~ @ lR z" @ ` ;" ` .u!"` .x*"` ..+"NP .z"" ? M#` 9 , , 9 M d!…
Read More

Fix Ctrl-Alt-Backspace problem with Ubuntu 9.10+

CLI, Linux, Ubuntu, Unix
Downloaded and installed 9.10 yesterday and what do you know, someone decided to take away Ctrl-Alt-Backspace -- or what I call "Three Finger Salute for Linux". Whhhaaattt!!!!How the heck are you supposed to kill and restart X without that.....A coworker suggested Alt-PrintScreen-K, but that just restarts GDM, not really useful when X decides to go south. Damit!!The reason given on Ubuntu wiki is that "This is due to the fact that DontZap is no longer an option in the X server and has become an option in XKB instead."Well, fear not, whoever disabled it also created a easy way to reenable it again. Here is what you do:In Gnome (Ubuntu):* Get to the System->Preferences->Keyboard menu.* Select the "Layouts" tab and click on the "Layout Options" button.* Then select "Key sequence…
Read More

ASCII Art at it’s finest…..

ascii, CLI, Unix
Not sure if this has already been mentioned somewhere.....It's pretty old, but I happen to come across it today. It's a great rendition of everyone's favorite space opera done by Simon Jansen in ASCII. Telenetification (is that even a word?) by Snore, with improvements by Mike Edwards. Anyways, use the following command, sit back and enjoy.....Star Wars in all its ASCII glory :-)telnet towel.blinkenlights.nlIf you don't know how to telnet, click here to see it in your browser.
Read More

gksudo: Or how this old dog learned new tricks :-)

CLI, Linux, Ubuntu
Okay if you know about gksudo, fine. I just found out about it a little while back when I was trying to run ethereal. You see under Ubuntu (and a lot of other Linux distros) the concept of root user has been removed. There is no root (well there is, but you can't access it), unless you specifically modify your system to activate it. That's fine (most of the time), since you can use sudo to accomplish almost anything as the administrator. One thing that doesn't work properly are the graphical applications that need root access. So here is where gksudo comes to rescue. In the case of ethereal I would issue the following command to get it to prompt me for sudo and run as root user:gksudo etherealSo next…
Read More

How to change the default command line text editor in Ubuntu….

CLI, Linux, Ubuntu
I love Ubuntu, but there is one thing that really bugs the hell out of me. The default configured editor in Ubuntu is nano, a Pico clone. I hate Pico, therefor I hate nano :-). So how would you go about fixing this and changing the default editor to vi (or vim):Issue the following command: sudo update-alternatives --config editorEnter the superuser password when prompted.At the following screen choose the number beside the editor you want as default or alternatively just press Enter to keep the default the same. There are 3 alternatives which provide `editor'. Selection Alternative----------------------------------------------- 1 /usr/bin/vim.tiny 2 /bin/ed*+ 3 /bin/nanoPress enter to keep the default[*], or type selection number: 1Using '/usr/bin/vim.tiny' to provide 'editor'.That's it.....Have fun.
Read More

OSX 10.5: How to create a public share folder…..

Apple, CLI, Leopard, Macintosh, OSX, osx Server
This problem has been around (I think) ever since the introduction of POSIX permissions. In pre-10.5 versions you could sorta do something like this by changing the default umask on the system, but that was system wide and applied to all folders/files a user created on the entire filesystem.....not nice. The real question is how do you create a directory that is totally public without mucking around with system/user wide settings. A folder that anyone on the system in question can read/write/modify/delete anything anyone else has put in there. A true shared directory with share permission inheritence. We call it "pub" directory at my place of work.The old trick in OSX (in case someone is interested) was to write a small script that you ran via cron every 5-10 minutes…
Read More

Single command Ubuntu LAMP stack installation on Desktop Edition…..

CLI, Linux, Opensource, Ubuntu
This used to be a pain in the butt. Lots of manual apt-get lines and config edits to get it to work. Weŕe talking about installing the LAMP stack onto a preexisting Ubuntu Desktop Edition installation. I used to do this backwards in the old days by installing the Server edition first (with LAMP) and then getting the graphical desktop goodies installed on top of that. That method still works, but I found out that LAMP stack install on a Desktop edition is a simple one command affair. As of the 7.04 release, the Ubuntu base system includes Tasksel. You can install LAMP using tasksel.sudo tasksel install lamp-server
Read More