Archive for ‘CLI’ Category
Posted on 13:24, October 19th, 2010 by Many Ayromlou
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:
Posted on 14:17, August 25th, 2010 by Many Ayromlou
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 export the settings from a specific service and then move the file to the new server and import it there. All using the CLI.
Posted on 15:32, August 19th, 2010 by Many Ayromlou
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:
The output of this command is something like this:
2) Now you’re ready to selectively cut and paste the appropriate users and associated grant into a new mysql session (which you have to open) on the new server.
Posted on 22:33, November 10th, 2009 by Many Ayromlou
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! ,8P' R X.:x' R' , F F' M R.d' d P @ E` , P ' P N.d' '' ' ss X x . 9 .f ! . $b 4; $k / dH $f 'X ;$$ z . MR :$ R M$$, : d9b M' tM M: #'$L ;' M `8 X MR `$;t' $F # X ,oR t Q; $$@ R$ H :RP' $b X @' 9$E @Bd' $' ?X ; W `M' `$M d$ `E ;.o* :R .. ` ' "' ' @' '$o*"'
Posted on 13:58, October 31st, 2009 by Many Ayromlou
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:
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 :-)
If you don’t know how to telnet, click here to see it in your browser.
Posted on 12:19, September 28th, 2009 by Many Ayromlou
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:
Posted on 12:10, September 28th, 2009 by Many Ayromlou
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):
That’s it…..Have fun.
Posted on 12:39, June 11th, 2009 by Many Ayromlou
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 that would “chmod” all the entries in a folder to be open to a specific POSIX group….something like the script below:
Well those were the old days and now with the help of ACL’s we can do this a lot nicer/cleaner. The procedure below is for OSX 10.5+ (it should also work on 10.4, although I haven’t tried it).
You now have a true public folder where all members of the group public can read, write and delete files, as well as read, write to and create new sub folders. The ACL rule takes precedence over standard UNIX file permissions and is automatically inherited. It’s this automatic inheritance that is really important.
IMPORTANT: You must copy (hold down Option in Finder prior to dragging), and not merely move, items. This is particularly important with bundles, such as the Aperture library bundle for example. Moving items doesn’t inherit/change the permissions/ACL’s. Copying ensures that the files are actually created in the shared folder, thereby forcing the ACL rules to be inherited. If you have moved files into this directory and the permissions are a bit messed up you can quickly fix that by issuing the following recursive command which will set the ACL’s and POSIX permissions to the “right” ones so that everyone can do anything in that directory:
Posted on 16:44, May 20th, 2009 by Many Ayromlou
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.