Archive for the 'FRONT_PAGE' Category


Managing Linux Disk Space

In the process of installing programs, downloading/ripping movies, and doing whatever else we do with our Linux systems, managing disk space becomes crucial. Here’s some helpful hints on how to measure/manage disk space under Linux.

df

This command meaning ‘disk free’ will tell you how much of each partition you still have available to you. It handles all mounted filesystems including mounted samba shares. Due to it’s design as a tool to measure available disk space, it won’t tell you anything about your disk drives.

# dfthis outputs a display of the total partition usage
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda5 13100844 9906872 2528484 80% /
/dev/hda6 5463156 3245016 1940620 63% /mnt/v_drive
/dev/hda7 451564 68 451496 1% /tmp
/dev/hda8 6103648 3706120 2087476 64% /mnt/z_drive
/dev/hda9 24527248 16671184 7856064 68% /mnt/x_drive
/dev/hda1 8361512 5603640 2757872 68% /mnt/winxp
none 451564 0 451564 0% /dev/shm
//192.168.0.7/x 72595456 72282112 313344 100% /mnt/kingdom/x
//192.168.0.7/m 75335680 74567680 768000 99% /mnt/kingdom/m
//192.168.0.7/temp 75335680 74567680 768000 99% /mnt/kingdom/temp

# df -hthis outputs the same thing in a human-readable format
/dev/hda5 13G 9.5G 2.5G 80% /
/dev/hda6 5.3G 3.1G 1.9G 63% /mnt/v_drive
/dev/hda7 441M 68K 441M 1% /tmp
/dev/hda8 5.9G 3.6G 2.0G 64% /mnt/z_drive
/dev/hda9 24G 16G 7.5G 68% /mnt/x_drive
/dev/hda1 8.0G 5.4G 2.7G 68% /mnt/winxp

# df -kif you want to see things in Kilobytes
/dev/hda5 13100844 9906884 2528472 80% /
/dev/hda6 5463156 3247992 1937644 63% /mnt/v_drive
/dev/hda7 451564 68 451496 1% /tmp
/dev/hda8 6103648 3706120 2087476 64% /mnt/z_drive
/dev/hda9 24527248 16671184 7856064 68% /mnt/x_drive
/dev/hda1 8361512 5603640 2757872 68% /mnt/winxp

du

‘disk usage’ measures individual sections of the filesystem rather than whole partitions. You can pass it a directory name or nothing at all to let it calculate the current directory.

# duthis lists, recursively, the size of all directories beneath the current directory.
68 ./.kde3.4/share/config/session
8 ./.kde3.4/share/config/kresources/contact
4 ./.kde3.4/share/config/kresources/calendar
4 ./.kde3.4/share/config/kresources/konnector
4 ./.kde3.4/share/config/kresources/notes
24 ./.kde3.4/share/config/kresources
12 ./.kde3.4/share/config/colors
648 ./.kde3.4/share/config
32 ./.kde3.4/share/apps/kconf_update
4 ./.kde3.4/share/apps/kopete
4 ./.kde3.4/share/apps/remoteview
8 ./.kde3.4/share/apps/nsplugins
... etc ...

# du /home/danger -hthe same thing as the above but for a certain directory and with better units for filesizes (KB, MB, GB).
68K /home/danger/.kde3.4/share/config/session
8.0K /home/danger/.kde3.4/share/config/kresources/contact
4.0K /home/danger/.kde3.4/share/config/kresources/calendar
4.0K /home/danger/.kde3.4/share/config/kresources/konnector
4.0K /home/danger/.kde3.4/share/config/kresources/notes
24K /home/danger/.kde3.4/share/config/kresources
12K /home/danger/.kde3.4/share/config/colors
648K /home/danger/.kde3.4/share/config
32K /home/danger/.kde3.4/share/apps/kconf_update
4.0K /home/danger/.kde3.4/share/apps/kopete
..... etc ......

# du -shcalculates the size of the current directory’s total contents (and prints it in ‘h’ format).
204M

Tricky 1337 stuff

As I learn more about terminals and bash commands I’m finding some excellent shortcuts for common operations. They’re nothing secret, they’re just new to me.

# df -h | grep /dev/hda5 show just one partition/device in the list. You can replace the ‘/dev/hda5′ with any other text that you’re looking for.
/dev/hda5 13G 9.5G 2.5G 80% /

# df -h | grep /dev/hda5 | cut -c 41-43 same as above, but it further narrows down the output to include only the 41st through the 43rd characters of the list - which is the part that shows percentages.
80%

# du –exclude=logthis will ‘du’ all the files except ones that match the pattern in the exclude clause. In this case, any file that contains the three-letter combo ‘log’ will not be counted in the results. Can be really handy also for ignoring movies, music, etc.



If any of you have something to add, please chime in - I’d be happy to add your comments as an update to this post (as well as try out the new comment display I’ve got - they show up opposite the post on the right side of the page).

Ultimate Linux Keylogger - Uberkey

A while ago I wrote a post about a Linux keylogger called lkl. It’s a decent program but it’s rather hard to manage at times and had some configuration bugs. Even once I got it running I’d find that many of the characters were off from what they should have been.

Luckily a reader used the comment form on that post to point out a much better program called uberkey.

Uberkey is awesome because of it’s simplicity. When you download it from the link above (or this link) you’ll be amazed at just how simple the install package is. There are three files:

makefile
uberkey.8
uberkey.c

Installing Uberkey
To install the uberkey keylogger on Linux simply compile the uberkey binary by typing # make. Really, it’s that simple. You’ll now have a fourth file in the current directory named uberkey. Copy this to some executable directory like so:

# cp uberkey /usr/bin/

Uberkey is now installed.

Running Uberkey

Uberkey does not handle log files on it’s own, what it does is when it’s running it will print out the names or values of the keys being hit to the standard output. This is not very useful if you just type it in a terminal straight, but with two very simple changes to the way the program is called it becomes an excellent system keylogger. First, we’ll use the greater-than symbol to direct the standard output to a text file:
# uberkey > /home/myname/.keylogfile

Second, we’ll use the ampersand symbol at the end of the program call to allow this to run in the background and give us our terminal prompt back:
# uberkey > /home/myname/.keylogfile &

If you want this to start at boot, all you need to do is add the last line of code above to one of your init scripts. If this doesn’t seem easy to do, I’ve included a script that you can make into a file and drop into /etc/init.d. Make sure it is executable (# chmod +x filename)

Sample Init Script for Uberkey
(Note: you should have runscript installed to do this)


###############
#!/sbin/runscript

start() {
        ebegin "Starting Uberkey keylogger"

        uberkey > /home/myname/.keylogfile

        eend $?
}
###############

Update: Wicher has told me that sometimes uberkey can mess up X. If anybody knows something about this, I’d love to hear it. So far it’s been working fine for me. Also, has anybody tried uberkey on a non en-us keyboard layout?

Kazehakase - Fast Linux Browser

I consider it a given that Firefox is the best browser, but that’s because I haven’t put much time into investigating real alternatives. Kazehakase is a gecko-based browser that uses GTK and runs fast on Linux. Really fast.

It doesn’t have all the features of Firefox and it redefines a couple of shortcuts that make it a little difficult to get used to, but in the short time I’ve spent with it I’ve really come to appreciate it as a browser.

Gecko
The Kazehakase web browser previewing the new design of Distro JockeyGecko is the layout/rendering engine that powers every Mozilla web product - Firefox included. The main problem with switching browsers is that a smaller group of programmers or a brand new product couldn’t possibly have a robust web rendering engine as some of the big players. This becomes a moot point when a new project decides to use Gecko to run the layout. It immediately competes with Firefox and only has to think about what kind of user interface to build.

GTK
Kazehakase uses GTK and is kinda ugly for a guy like me who’s become overly comfortable with KDE and QT. This was initially a little bothersome but Firefox isn’t much better in the widget department.

Speed
Kazehakase is really, really fast. It takes a few seconds for me to type the whole name with correct spelling into a terminal but as soon as I hit enter the browser is up and waiting for me. If only I could get this kind of love from FF. The page load times are drastically reduced despite a full implementation of JavaScript and the DOM.

Password Manager
I was amazed to find such a speedy little web tool that had the ability to save my passwords. This is an absolute requirement for me because of all the places I have to log into.

Tabbed Browsing
Middle-click on the mouse makes a new tab, as well as CTRL-ENTR (see ‘quirks’).

Bookmarks
This is the first browser that I’ve seen which lets you import bookmarks from Mozilla, Netscape, Galeon, Firefox, Konqueror, and w3m. I imported my FF bookmarks first thing and it actually worked. It’s so impressive that a piece of software could find the right location for my bookmarks on my customized Linux machine. The one major hangup with using Kazehakase is that it doesn’t support FireFox’s extensions like the Bookmarks Synchronizer on which I rely heavily.

Quirks
There’s no Google search bar. This is sad. However, this is replaced by a redefinition of the CTRL-ENTR shortcut key. While CTRL-ENTER normally prepends a www. and appends a .com in Kazehakase this will create a new tab with a google search of what you typed into the address bar. This is actually a pretty good idea considering it lets you save screen space with only one location bar - but I wish they’d used a different shortcut combination.

This is a good browser. I recommend it for use in older computers and low-ram environments but also in situations when you’re FF installation has become corrupted because of your incessant tweaking.

The Ups and Downs of Gentoo

For over a month now I’ve been using Gentoo as my primary operating system. It’s been a real treat to get to install it (twice, actually) and learn the ropes by getting my hands dirty. Overall I think it’s my favorite OS because of the transparent way it does packages and the super-ease of upgrading everything. Despite that, I plan to switch to Suse 9.3 soon. Let me explain why.

First, the stuff about Gentoo that excells:

  • Gentoo lets you compile everything.
    From the kernel to every single program you run you get to compile it on your own machine. While this doesn’t necessarily offer extra speed, it can dramatically increase system performance if you understand how to use your USE=”" variable in /etc/make.conf. You can set flags that offer your program Gnome supportbut not KDE (USE=”gtk2 -kde -qt”), or the otherway around (USE=”-gtk2 kde qt”). This’ll keep your programs optimized.
    And because compiling everything can be a hassle if you don’t want to wait forever, Portage (the Gentoo package system) also lets you use pre-compiled packages when available through the –usepkg flag. Some things probably aren’t worth the wait to compile them yourself.
  • Gentoo lets you upgrade in place
    I remember reading a few years ago that a certain user hated that RedHat didn’t let you upgrade without losing everything. Even Windows gives you the option to not reformat if you want. Lucky for us Gentoo has improved the Linux experience so much that it takes only a second and a single file copy to fully upgrade your system.
    Gentoo uses profiles as release numbers. They are very simply named: 2004.2, 2004.3, and the most current one is 2005.0. To update all the programs on your machine you simply type # emerge --update world and when there is a new profile that you can switch to Portage will tell you to edit your profile to reflect the newly downloaded version of Gentoo that’s available as a folder in /usr/portage/profiles/. To upgrade to the new profile just point the symlink /etc/make.profile to the new folder.
  • Huge package warehouse
    The Gentoo package system is full of goodies. There’s everything from the basics of apacha, kde, gnome, php, etc., to obscure stuff like the games ‘Wakkabox’ (?) and even commercial software like VMWare and Heroes of Might and Magic 3 for Linux. For commercial stuff your original CD or serial key are required, but Portage will install the program for you. I’ve only twice found a program that I wanted to install which was not already in the Portage tree. For these situations, rpm and make work as well as they do on any other system.

That’s the really good stuff about Gentoo. It has some problems though. Not big ones, but problems that are real enough for me to be switching to Suse 9.3.

  • You have to configure everything
    This is usually a plus, but at times it’s really a horrible idea. I’ve been struggling with my Intel ProWireless 2200BG for the entire time I’ve used Gentoo. I’ve followed every tutorial and manual online and I can’t get the thing working. It’s supposed to be hard but possible, this is just frustrating. There are other things I’d like to try that may not be possible for me until I get a distro that supports it a little better (Like the Xen Hypervisor). The ipw2200 (my wireless card) package worked with some bugs on Suse 9.2 - I figure by 9.3 they’ll have an updated version that runs smoothly.
  • Speed
    Sometimes it’s just nice to have a system that you know you can install in an afternoon. If something goes wrong you can just make sure you have a backup of key files, wipe the drive clean, and start over in time for dinner. With Gentoo, there’s been at least two nights where I gave it a long list of files to install and I went to sleep - only to find it still at work by breakfast time.

It should be noted that this is not a real criticism of Gentoo. If your hardware (especially networking) is supported natively by the Linux kernel you may never find any need to switch out of Gentoo. In fact, as soon as ipw2200 support becomes reliable enough that I can compile it as a module in my kernel I’ll be switching back to write more. Until then, y’all might be hearing lots about Suse.

Devnet Distro Roundup

I’ve been reading Yet Another Linux Blog for some time now as the writer (’Devnet’) has been submitting various distributions of Linux to a test. He’s used his wife (who has no Linux experience) as a judge to find out which distribution is the best distribution for a brand-new user to work with.

Devnet had his wife try out the following distributions (from having to install them to having to remove them - the whole experience):

I won’t mention how each of them performed individually except to say that there were two very big surprises. When Devnet tested Ubuntu it was found to be rather difficult for a newcomer to start off with. This generated a lot of (undeserved) negative feedback toward the project and the people involved from a rather excited Ubuntu community.

And the huge surprise was the success of the little-known PCLinuxOS. I’d never used it until it appeared in this project and was found to be the most new-user- friendly Linux distro. Granted, PCLinuxOS will not meet the needs of every Linux user - but that wasn’t the point of the experiment. According to Mrs. Devnet: “I need to do simple AND it’s easy on the eyes. It serves my purpose, bottom line.”

A big thanks from Distro Jockey to Yet Another Linux Blog for running this test. Linux is steadily approaching desktop-readiness for the real world - this will help the Linux community to know exactly what needs to be worked on to get us all the way.

Battle for Wesnoth

This is my first post about a Linux game, but I figured it was worth the time to write about because this game proves that Linux can do anything. If you’ve not heard about Battle for Wesnoth, it’s an excellent turn-based role playing game that’s developed natively for Linux and released open source. It’s a cross between WarCraft and Civilization in the gameplay. It doesn’t have the graphics of either (the open source community is rather poor so far at communicating with graphic artists) but it has excellent playability.

wesnothThe main character of the game is a young prince who’s just inherited a kingdom but is being hunted by his kingdoms enemies. The first few levels are spent escaping/fighting with enemy armies and learning the basics of economic upkeep and fighting with various classes of characters. Gameplay is from an overhead perspective on a hexagonal-sectioned map. You have to keep track of various different stats for different characters (as any rpg) and there is a focus on fewer, well-managed characters over large armies.

It’s still in pre-beta but it’s very playable. I recommend getting it through one of the following means:
# emerge wesnoth (on a Gentoo system)
# apt-get install wesnoth (on a Debian/Ubuntu/DSL system)
# firefox http://www.wesnoth.org

Popular Posts:


    Fatal error: Call to undefined function rjb_mostwanted() in /home/.shizzle/studioda/distrojockey.com/wp-content/themes/tertiary/archive.php on line 87