Magical Commands

July 20, 2008 on 8:58 pm | In command-line, linux | No Comments

I’ve recently discovered a few interesting commands for the command line.  One being di, assuming that its meaning is disk information.  It’s similar to df but it has some formatting features.

Examples:

14:34, britestar, ~% di -f SMT -x fuse.sshfs -x tmpfs  # exclude sshfs, and tmpfs
Filesystem            Mount                         fs Type
/dev/sda1             /                             reiserfs
//10.218.0.2/spyroboy /media/spyroboy/novastar      cifs
//10.218.0.2/ipod     /media/spyroboy/novastar-ipod cifs
/dev/sdb1             /media/storage0               reiserfs
/dev/hdb1             /media/windows0               fuseblk

14:39, britestar, ~% di -h -f SMbuva -I reiserfs  # only reiserfs filesystems
Filesystem Mount               Size     Used    Avail %Free
/dev/sda1  /                 465.7G   308.0G   157.7G  34%
/dev/sdb1  /media/storage0   295.9G   252.5G    43.5G  15%

I’ve also been looking at awk lately.  It gets fairly useful when you want to do combinations of grep, cut or sed operations in a single command; such as:

14:52, britestar, ~% cat /etc/apache2/apache2.conf | \
grep \^Include | cut -d” ” -f2 | sed -re ’s/apache2/apache/’
/etc/apache/mods-enabled/*.load
/etc/apache/mods-enabled/*.conf
/etc/apache/httpd.conf
/etc/apache/ports.conf
/etc/apache/conf.d/
/etc/apache/sites-enabled/

14:52, britestar, ~% cat /etc/apache2/apache2.conf | \
awk  ‘$0 ~ /^Include/ {gsub(”apache2″,”apache”,$2); print $2;}’
/etc/apache/mods-enabled/*.load
/etc/apache/mods-enabled/*.conf
/etc/apache/httpd.conf
/etc/apache/ports.conf
/etc/apache/conf.d/
/etc/apache/sites-enabled/

Sorry, I couldn’t come up with a better example.

In any case, those were my findings as of late.  Maybe there are more that I’m forgetting.  I’ll be sure to post more as I find more.

Victoria Day’s Blast Off!

May 19, 2008 on 4:42 am | In Slice of Life | 2 Comments

Ah, wow.  I really don’t know what to say.  Life’s decent; I’m happy.  It’s the Victoria Day long weekend and I’m sitting in my room listening to rock and roll and blogging.

I haven’t done much this weekend other than a little coding (Vector Calculator, Quake 3 engine), quite a bit of gaming (Guitar Hero III in Wine, and my hacked up Quake 3 engine), lots of system hacking and setting up on my new install of Arch Linux on my laptop.  I partied for a bit on Friday with some friends.  The SingStar session was great.  I made a fool of myself, but, man, it was totally worth it.  :)

As I’ve mentioned, I’ve been coding on a vector calculator, and just screwing around in the Quake 3 engine sources.  This vector calculator takes an input of forces and draws them to the screen and draws the final calcuated vector.  It’s just a small project I decided to take up for the hell of learning C and SDL.  I’m probably not going to finish it all for the end of this semester, but I plan on keeping it an on-going project.  As far as the Quake 3 engine goes, it’s just screwing around.  A friend and I were coding on a while back in attempt at some RPG game.  I worked on a bit of the camera and he added some cool health and ammo bar widgets, and then it died.  Now I’m just screwing around in the code and learning the structure of it for the hell of learning it.  It’s fun, if you ask me.

And yes, Guitar Hero III … there aren’t many words that can explain how much fun I have breaking my fingers over this keyboard trying to thrash those songs.  I will have to make a blog posting on my experienced of Guitar Hero III in Wine.

As far as the rest of the weekend may go, I might put a sweater on and sit in my backyard on my laptop; maybe watch some anime.  I know I’m going to try to study some chemistry and physics, some math; going to do some coding tomorrow too.  Busy day!

Entries and comments feeds. Valid XHTML and CSS. ^Top^
19 queries. 0.141 seconds.
Powered by WordPress with jd-nebula theme design by John Doe.