non linux post - re: independent music

Sunday 28 February notKlaatu

What is Indepedent Music?

"independent" art is less easy to define than "free software". At least, it has been historically, and since the whole "creative commons" thing is only just now really starting to kind of catch on, there isn't that much (that I'm aware of) creative commons music out there. Music that was made by real people for real reasons though, that proliferates in the "independent music" scene, and it's what I tend to favour.

However, what is "independent"? It's hard to define, but it's a little easier to spot in a crowd. Here are some of the things that, IMHO, are typical of independent music:

  • The music is not owned by a company
  • If the music is currently being licensed by a company, then that company is a "small" (whatever that means) company
  • Its artists email you back when you contact them, or they will take an interview with anyone, or they actually talk to you after their concerts, etc.
  • The artists cleans up after their own concert and carries some of their own gear
  • The band books its own tours

..and so on. Again, a little hard to define for sure, because of music's history and the fact that it is only just now becoming something that everyone is able to do really well in the comfort of their own basement or bedroom or whatever. Hopefully as creative commons becomes a bigger deal, it will be a little more obvious who the independents really are.

Independent Music is Cooler

Here's why independent music is cool:

  • It's made by real people. People who will hang out with you and talk to you. Unless they're elitist scum, in which case you just stop listening to their elitist music. But mostly they don't want that, cuz they're real.
  • No DRM
  • Fair Use is usually not a problem...and frankly neither is re-distribution. It seems that real artists actually want as many people as possible to experience their art
  • Endlessly fascinating universe of sound. I find my jaw dropping so much more often with independent art than with the pre-packaged stuff
  • No Formula. Big-time record producers are trained, sometimes in spite of themselves, to make every song sound like an archetype of a "hit song". There are a few different archetypes to choose from, but the structure is always the same, the subject matter is usually pretty much the same, the length is always radio-friendly, and so on. Some independent musicians are just emulating this and so you do get much of the same traits, but it's not a given. And that's cool.
  • No alternate agenda. My problem with big record label product is that, even with the "daring" stuff, you get the sense that there's this alternate agenda of "make more money on this artist's content" and so the music is called "exciting" and "daring" and "unique" in all the big music magazines, and all the interviews are done, and the whole package is just so neat and tidy and predictably pre-planned. It's very effective...it's just not real. It's all a show being put on by some willing participants and some people who've probably had the wool pulled over their eyes, and the gullible public.

My Music Collection

So, anyway, I did an ls on my rockbox and redirected it here. Most of these or all of them I define as independent, so if you want to try out one or two of them, let me know and I'll re-distribute their music in your direction. The syntax is Artist - Album #comment -or- just Artist #comment. The comment, I try to explain what kind of music it is but...let's face it, there's no explaining without listening, so don't take the descriptions too much to heart.

Alain_Eskinasi_&_Jim_Wafer #ambient-ish music with an australian flavour
Derring_&_Sakaide_-_East_2_West #ambient music
If_Bwana-Clara_Nostra #rough ambient
Mentallo_and_the_Fixer - Continuum #industrial, i’ve talked to the guy in the band, and he’s a really nice guy and supports the independent art scene, such as it is
Merlin’s Magic - Reiki #ambient
Namanax - Multi-Phase Electrodynamics #noise
The_Remix-Collective_Of_Norway-TIBProd_MIX_01 #noise
aaron_z #electronic
adrianMarsh #electronic
aidanBaker #electronic
amirBaghiri #electronic
ashRaTempel #electronic kraut everything
bPAM #noisy electronic experimental
bopMonroe #bar new surf rock
cadmiumDunkel #electronic
christianDiVito #electronic
clayHawkins #rock and ambient albums
rhinoceros #rock project by a friend
colin #trance and hip hop by a friend of mine named…well, colin
coolerRecords #sampler from small label
dasPst #industrial
deadGuy #punk
deadHeartBloom #rock i found via Russ at Linux in the Ham Shack
decahedron #death-ish metal
dempefka #noisy electronic
dosNegroesDanjeros #experimental hip hop by a friend of a friend
dreamsOfDyingStars #ambient
escapade #electronic space music by some friends
escapeTank #minimalist ambient
everythingMustGo #electronic space music by some friends
fmLandscape #ambient
forceMajeure #electronic space music by a friend of a friend
frank_fischer #peaceful cool instrumental rock sorta stuff
futureMusicDemo #reader contributed music from Future Music Magazine
goodRiddance #punk
haraldGrosskopf #electronic kraut trance
holgerCzukay #experimental eastern europe electronic
hollAndBorthwick #experimental
iHateMyself #punk
johnDowland #old music by some dead guy
judge #punk
khalilChahine #happy instrumental world stuff
klausSchulze #electronic masterpieces even if this guy’s non-manager is a real jerk
knittingNewEssentials #sampler from small label
labAssistant #ambient
lifetime #punk
lunarLanding #electronic
magicalPowerMako_tranceResonance #experimental
ministryOfInsideThings #electronic spacey stuff by a friend
oggCASTS #er, all the linux shows that i listen to
patrickKosmos #ambient
peacefulPlanet #ambient
peterSeiler #electronic spacey 80s sounding stuff
pigDestroyer #vegan death metal
planesMistakenForStars #punkish metal
quoit_quietLounge #electronic
resin #noise
sequenox #electronic spacey stuff, really nice guy
yume bitsu #shoegaze
SIANspheric #shoegaze
Eau Claire #shoegaze
Grimble Grumble #shoegaze
Airiel #shoegaze
six parts seven #shoegaze
stellar luna #shoegaze
Tom Heasley #tuba ambient (no, really)
Flying Saucer Attack #noisy shoegaze
Psyclones #noisy shoegaze
signum #sampler from small label
silenceFollowsRain #ambient-ish worldy stuff
Happy Trance Mellow #trancy anime electronic stuff from japan
skeletonWitch #punk
snapcase #punk
sonogram #ambient
sound_00 #noise
spaghettiWestern #dreamy trippy rock
stJoseph #old music by some academic organist somewhere
strikeAnywhere #punk, by a friend of a friend of a friend or something like that
sugoMusic #ambient
tedQuinn #rock by my friend
terror #punk
terryBlankenship #ambient
theAccused #punk
theBlackWidows #punk
theKlang_comingHome #jazz from a small label
theLocust #punk
theMakai #death metal
La Monica #baroque from academic band
Philadelphia Orchestra #they release concerts for free on their site; music by dead people played by real people
theMisfits #punk…they’re pretty famous, are they independent?
theNerveAgents #punk
torche #vegan death metal
ucAllstars_aVeryPublicPerformance #sampler from small label
vladislavDelay #minimalist
volkerKriegel #jazz from a small label, artist deceased
wprb_unknown #spacey music by a friend of a friend or something…live performance on college radio
zeroCompilation_ambient #collection of ambient works from independent artists on the web circa 2004
zeroCompilation_seriousBeats #collection of dancey works from independent artists on the web circa 2004
zerosPostRockCompilation #collection of “post rock” works from independent artists on the web circa 2004
Death In June #neo folk
Blood Axis #experimental
Zero One #trippy ambient

Legendary Pink Dots #famous, not on a big label, are they independent?
Current 93 #famous? not on a big label. they seem independent but…?
Throbbing Gristle #famous, not on a big label….are they really independent, being so ubiquitous?
skinnyPuppy #industrial…i know the band members a little, they’re down to earth and don’t answer to labels..then again, they are traditionalists so far in the way they release music…….are they independent?
projectPitchfork #industrial..on a label…are they independent?

…….and that’s all my 20gb harddrive holds right now. And believe me, that’s not ALL the independent and indepedent-ish music I have. Nor does teh 20gb harddrive contain all the albums by those that are listed. So in short, does one really need non-independent music at all? Hard to say, since music is such an emotional response, but it’s something to think about.


remap Control to Caps_Lock Key

Thursday 25 February notKlaatu

Did you know that you could use your caps lock (which you probably don't use at all now) as a control key instead? It's a common trick but I had to hunt around for the solution, so here's the solution:

If you don't already have a ~/.Xmodmap file, create one. Notice that the "X" in .Xmodmap is capitalized.

Edit ~/.Xmodmap and enter these lines:

  • remove Lock = Caps_Lock remove Control = Control_L keycode 66 = Control_L keycode 37 = Control_L keycode 105 = Control_R add Control = Control_L

..where keycode 66 is the caps lock key, keycode 37 is the left control key, and keycode 105 is the control key on the right. Your Keyboard may not share these keycodes! To find out what the appropriate keycodes for your keyboard are, you need to use a little application called xev. Start xev:

  • xev | grep -i keycode

Any key you press now will relay to your command line what keycode corresponds to that key. Jot down the number for each key (Control_L Control_R and Caps_Lock) and then close xev by closing the small window that opened when you launched xev.

You will need to restart X (log out, log back in) for this to work. And now you have three Control keys and not a single bothersome useless Caps Lock, which is the way I like it. I think I read somewhere that you could make a random control key become a caps lock key, but I don't do that since I don't use caps lock, but that may be something to look into if you can't quite part with the idea of a caps_lock.


remap control-a to control-j in GNU Screen

Thursday 25 February notKlaatu

I use screen a lot. It's like ratpoison except without X. The problem is that if you love ^a as the "goto beginning of line" in BASH and GNU Emacs, then you lose the convenience of that whenever you use screen. There is a workaround that; a key combination you can type to get control-a sent past screen into BASH or Emacs, but it's just not as natural and you have to re-train your finger's muscle memory. It's much easier, imho, to change ^a to something else.

K5Tux from Linux In the Ham Shack mentioned on a recent episode that some of his screen friends have changed the ^a key binding to something else. In IRC he helped me configure it:

First, as root edit /etc/screenrc (assuming you want to make this change for all users; if not, you'll want to create a ~/.screenrc file) and place this line into it:

  • escape ^Jj

If screen is currently running, you'll need to relaunch it to have the new key binding take effect.

This sets control-j as the magical screen key rather than control-a, and ensures that if you actually want to bypass screen and send a control-j character to the app you're running inside of screen, you can always just type control-shift-j and screen will ignore it.

I used control-j because I don't use any console-based app that uses control-j prominently enough that I know about it, but feel free to make it any key you prefer. Have fun.


openCSW+openSolaris+Fluxbox

Saturday 20 February notKlaatu

At work, they're testing a software package that runs on Solaris, and I happened to wander in wearing the openSolaris t-shirt I got last year at South East Linux Fest. No sooner had I walked in the door was I appointed the QA tester for the sotware, using both the one lonely Solaris 10 box in the corner of the server room and the freshly installed openSolaris workstation.

I ssh into the Solaris server but the workstation comes pre-installed with Gnome. I tend to more a Fluxbox guy than a Gnome guy, so I decided to put Fluxbox on it. Not the easiest thing for a solaris noob, but luckily I'd been playing around with openSolaris on and off again, so I had some ideas.

I'd already heard of Blastwave, and was going to go set that up, but on my way to Blastwave I was intercepted by Wikipedia which pointed me to openCSW. openCSW is an extra community repository for Solaris; the "CSW" refers to "Community SoftWare" and is opposed to SUN packages; in the repositories, you'll see SUNfoo for the SUN version of an installable application foo, and CSWfoo for the community version of the application foo. openCSW features free software, so all of your favourite GNU (and similar) packages are going to be there. openCSW doesn't officially support openSolaris but I decided to try it anyway. openCSW advises against using their repository alongside of Blastwave, so do not attempt to use both.

Installing openCSW

First, install the utility package that openCSW uses. Note the convention of using pfexec rather than su or sudo. pfexec can be thought of much as sudo or su -c in GNU Linux.

  • pfexec pkgadd -d http://mirror.opencsw.org/opencsw/official/pkgutil-`uname -p`.pkg

All this openCSW (and Blastwave before it) stuff gets installed into /opt/csw so all the apps you install will be found there, and all of their related files as well. For instance, when you install pkgutil, it installs pkgutil in /opt/csw/bin and pkgutil.conf in /opt/csw/etc

You may want to look at /opt/csw/etc/pkgutil.conf and see what mirror you're going to be using. I changed mine to ftp://mirrors.ibiblio.org/pub/mirrors/opencsw/current where "current" refers to the unstable branch of the repository. If this were a real live production machine, I'm sure I'd have opted for the stable branch.

  • pfexec vim /opt/csw/etc/pkgutil.conf

And now get the repository catalogue:

  • pfexec pkgutil -U

Securing It with GnuPG

Before we go any further, we'll take care of basic security with gnuPG. First, install gnuPG:

  • pfexec /opt/csw/bin/pkgutil -i gnupg

(w)get the openCSW gpg key and import it...

  • wget --output-document=/tmp/gpg.key http://www.opencsw.org/mirrors#key
  • /opt/csw/bin/gpg --import /tmp/gpg.key

Lastly, you should go into both /opt/csw/etc/pkgutil.conf and /opt/csw/etc/pkg-get.conf and uncomment the "use gpg=true" and "use md5=true" lines so that these apps do in fact use gpg and md5.

pkg-get

Now that you have (more secure) access to the openCSW repository, you can install the pkg-get application, which like apt-get will install dependencies along with an application you mark for isntallation. To install this, run:

  • pfexec /opt/csw/bin/pkgutil install pkg_get

Again, you may -- if you want to -- edit /opt/csw/etc/pkg-get.conf to define a mirror and branch. I made it match the pkgutil.conf mirror, just to be safe.

So that you don't have to keep typing in /opt/csw/bin/foobar to execute an app that you've installed via openCSW, you should add /opt/csw/bin to your path. openCSW advises that you add it to the front of $PATH. I do this in .bashrc with this command:

  • echo "PATH=/opt/csw/bin:$PATH" >> .bashrc

Just to test things out, I go ahead and refresh the catalogue -- this time with pkg-get and without the full path.

  • pfexec pkg-get -U

Assuming all goes well and your catalogue is updated and secure, openCSW is ready to use. Personally, the first thing I used it for was Fluxbox.

Fluxbox and GDM Hackery

Install Fluxbox and imagemagick. The latter because fbsetbg uses imagemagick's display to set the background of Fluxbox. I also install xscreensaver because it's useful and there's a neat xscreensaver trick I'm going to do in a little while.

  • pfexec pkg-get -i fluxbox imagemagick xscreensaver

If you ever want to look and see what's available in the repositories, the pkg-get -a command lists all available packages. So if you pfexec pkg-get -a | grep -i flux or something like that, you'd get a good idea of what the fluxbox-related installable apps are. In this case there's probably just Fluxbox itself, but keep the -a in mind for later. I have also run pfexec pkg-get -a > pkglist.txt just to have the list handy.

Once Fluxbox and all the other apps are installed, you get to figure out how to get GDM to sign you into Fluxbox. I don't use GDM much, so I had no idea how to configure it to see that Fluxbox was an available session to log into. So I just did a ghetto-style hack to prevent GDM from being turned on at all, set .xinitrc to fluxbox, and startx manually from a console login screen:

  • pfexec mv /usr/sbin/gdm /usr/sbin/gdm-stop
  • echo "exec /opt/csw/bin/fluxbox" >> ~/.xinitrc
  • Reboot, and once you reach the textual login screen, log in as usual. Then type startx and Fluxbox will start up.

    From here you can customize Fluxbox to be efficient for you, which I cover in a separate post somewhere. One fun thing I did on this box was set the background to be animated, rather than just a static image...although if you want to use the openSolaris backgrounds for Fluxbox, they are located here:

    • /usr/share/pixmaps/background/opensolaris/

    For a cool animated background, however, we can start xscreensaver but force it to run in the "root" window -- meaning, the desktop. The command for this is:

    • /opt/csw/libexec/xscreensaver/foobar -root &

    ..where foobar is the name of an xscreensaver animation. If you run the command but tab at the end of xscreensaver/ then it should list all of the 205 or so animations available to you. Try a few out. You can of course put that line into you .fluxbox/startup file so that it will do this automatically when Fluxbox starts. It looks pretty cool, all in all, and most of all it's refreshing to have Fluxbox as an openSolaris desktop, and to have access to all the comfortable, always-excellent GNU apps from openCSW.


screen capture with ffmpeg

Friday 5 February notKlaatu

People keep asking me, so, here's how to capture your screen as video with ffmpeg:

  • ffmpeg -f x11grab -s hd720 -r 15 -i :0.0 screencast.avi

-f x11grab is the format; self-explanatory I think.
-s indicates the size. In this case I chose the hd720 pre-set which is practically 1:1 to my 1280x800 Intel Mobile 4 driven monitor...but if you don't need actual size, you could cut that in half by choosing something like vga or svga. man ffmpeg for all the size pre-sets (do a search for -s option).
-r is the frame rate, which I set to 15 fps because we don't need to see every little quiver of the cursor in total clarity.
-i is the input file. In the case of capturing X11, this is your display. If you echo $DISPLAY your terminal should tell you that you are currently on :0 and since you are on the first instance of :0 (as opposed to, say, a second monitor you might have hooked up) then the display you want to capture :0.0 -- when you have one monitor and one graphic card in your machine, the display is as simple as that; the only variation you're going to see in your display is if you've got multiple graphic cards and multiple monitors on those cards. But probably you don't have that, so it's :0.0
screencast.ogg is the output file; it is being dumped into the current directory, and it is being named screencast.ogg. There are lots of options here; you can choose whatever codec you have compiled ffmpeg to support, whether it's ogg (theora), xvid, or any of those other more proprietary-ish ones like x264, mpeg, and so on.

And that's all there is to it. No need for any fancy screen capture program, just good old ffmpeg.

If this isn't working for you, then it's probably because your version of ffmpeg was not compiled with x11grab. Why anyone ever compiles ffmpeg without that support, I do not know; could be an oversight or it could be for some other reason beyond my understanding, but the way to check if your installed version of ffmpeg supports x11grab is to run:

  • bash$ ffmpeg -formats | grep -i x11grab

If that command returns nothing, then your ffmpeg doesn't know what x11grab is and you probably will want to either find another, more robust repository to install it from or just compile it from source code with everything turned on. For instructions on how to do the latter, see slackermedia.info


HOWTO set up git with gitorious and..your terminal

Thursday 4 February notKlaatu

This post is basically just a reiteration of a really fantastic article written by one William Von Hagen on the excellent IBM Developerworks site, about how to start using git. But I'm posting this info in an even simpler form and also geared toward Gitorious, a free git hosting service. Gitrorious is nice because by using it, you avoid having to set up your own git server. Why use Gitorious and not github or some other such source code hosting site? Well, because gitorious is an entirely free and open source stack, and seems good enough that Qt uses them, and that's a high enough recommendation for me.

So, I did an HPR episode on some of the basics of git, but it only covered using git and not setting up git. This is how to start from nothing and end up with a working git repository in the gitorious cloud and also on one or more of your comuters. So this assumes that you have a project that needs hosting. While I don't actually have a code project, I do have a documentation project called slackermedia, and I'm going to soon be creating docbook sources and adding to its existing documentation, and for that I decided I could perhaps use a git repository. So, to start out with git for your own project:

  • Set up an account at gitorious.org for yourself, and then create a project listing there.
  • Set up your ssh keys so you can access your git repository:
    • bash$ ssh-keygen # if you already have ssh keys on your machine, you can skip this command and go straight to the next one #
    • bash$ less /home/klaatu/.ssh/id_rsa.pub
  • As directed by gitorious, paste the contents of id_rsa.pub into your gitorious dashboard; it should accept the key and you are now bound by the power of ssh to your future git cloud city.
  • Again, as directed on gitorious, establish your local git identity:
    • bash$ git config --global user.name "Klaatu de la Negatario"
    • bash$ git config --global user.email "klaatu@fakeaddressforthispost.org"

OK, now you're set up on the gitorious side. Probably you could have figured all that out on your own; it's pretty well spelled out on gitorious.org after you sign up with them. But now there's an overview here as well. Now for the hard stuff, which, again, I have basically just ripped off from Mr. Von Hagen's IBM article.

  • First you must establish a local (that is, your own computer) directory for all your project files. It will be your local copy of everything in your future git repository. You can do this anyway you like; I just do it all on the command line because it's easiest that way. They're straight-forward commands, and the concept is simple; make a directory, put your project files into it. To avoid a whole host of "foobar" and "localhostdirectory" style names, I'll use the actual files that I was dealing with whilst setting up git for myself:
    • bash$ mkdir slackermedia
    • bash$ cp ../slackermedia_website/index.html .

Now we have set up a very simple local repository and working directory with, in this case, one file in it. Let's get that file up to the big git repository in the sky.

First we need to initialize our local git home:

  • bash$ pwd
    /home/klaatu/slackermedia
  • git init
    Initialized empty Git repository in /home/sxe/slackermedia.git/.git/

Now our simple slackermedia directory is an official git repository, on the local machine. Since ann git repositories begin life completely empty, we need to officially add the index.html that we want to have as our initial commit. It is the file upon which all future work on slackermedia will be based, so I want it to be in the git repository as the main source file. To add it:

  • bash$ git add index.html

Now I've established that slackermedia is my git repository on the local level, and I've established that index.html is the file I want to add to my repository. The rest of it, from here, is basically just standard git stuff:

  • bash$ git commit

Git will now prompt you to add a commit note, using your default text editor. Type in a brief note to explain why you are making the commit (such as "initial commit") and save the file.

Now we will add our new file to gitorious using the git push address that gitorious provides your project:

  • bash$ git remote add origin git@gitorious.org:slackermedia/slackermedia.git
  • bash$ git push origin master
    Counting objects: 3, done.
    Delta compression using up to 2 threads.
    Compressing objects: 100% (2/2), done.
    Writing objects: 100% (3/3), 20.53 KiB, done.
    Total 3 (delta 0), reused 0 (delta 0)
    Syncing Gitorious... [OK]
    To git@gitorious.org:slackermedia/slackermedia.git
    * [new branch] master -> master

And that's it for getting the repository started and doing your initial push. All pushes thereafter will be the typical sequence of

  • git status
  • git fetch && git rebase origin/master # careful with this step; do it only if you know what you're doing
  • git commit foobar.xml
  • git push git@the.push.address.Gitorious.gives.you/yourproject.git

And now you can create new branches, new files, you can git add, push, clone, checkout, fetch, rebase, and so on.

And of course more information on all that sort of stuff will appear here as soon as I have something informative to say on teh subject.

EOF...for now.


HOWTO get alternate characters from a Linux keyboard

Thursday 4 February notKlaatu

Back when I used to be a Mac 0S user, I knew that pressing option-foobar would give me some "special character" like an e or an a with accent marks over them, or one of those funky German "s" letters that look like a capital B, or a Euro symbol or a British Pound symbol, and so on.

Here is how to set your Linux machine so that it does the same thing:

How to Implement It

  1. First, determine which key you want to be the modifier key; as I said, on Macs it was the option (or "alt" key) but on Linux, because there's actually choice involved, you can choose any key you want to be the magical modifier. Since I have traded most of my old Macs for superiour Lenovos, I have noticed that on most PC keyboards there is a little key with a menu on it on the right hand side, usually next to the alt key or next to a left wind0ws key if there is one. Since I have no idea that key is for and have never used it, I chose it.
  2. Now you must find out what keycode the key is sending to your computer when it is pressed. To do this, open a terminal and type:
    • xev | grep keycode
    ...and press the key of your choice. Look for the resulting keycode. (For my little menu key, the keycode was 135 on three different computers of two different brands and three different distros, so that might be something fairly consistent.)
  3. Now type in:
    • xmodmap -e "keycode 135 = Multi_key"
    ...where Multi_key is the magical key name to make this whole "special character" key combination possible.
  4. Now you can hit all kinds of key combinations to get new and exciting characters from your Linux keyboard. To find out what combinations are available, issue this command:

    • grep Multi_key /usr/share/X11/locale/en_US.UTF-8/Compose | less

    How to Use It

    Most of the key combinations consist of MULTI_KEY and SOMETHING being pressed together -- and then SOME OTHER KEY to actually produce the new character. For instance, let's say you want to produce that funky German ß symbol. Looking at the list of combinations in /usr/share/X11/locale/en_US.UTF-8/Compose we see that the proper combination is multi_key s s -- so we first press our fancy new Multi_key and the "s" key together, which places us in the magical "dead letter" zone, and then we press "s" again, and suddenly we see on our screen in all of its foreign exotic glory, the ß letter.

    Getting it To Persist

    OK, so that works but now how do you get it to work every time you start your computer? It's easy. You just create a .Xmodmap file in your home directory. The simplest way to do this is to echo the keycode to the file:

    • bash$ echo "keycode 135 = Multi_key" >> .Xmodmap

    Note that the initial X in the file name is capitalized. Now if you reboot, you will find that that little menu key is still the Multi_key and still enables you to use your newfound character set.

    EOF


find . ! -type d -ls

Wednesday 3 February notKlaatu

I've been dealing a lot with docbook lately, and a typical way of organizing docbook stuff is in separate files, such that you have "chapter 1" as chapter1.xml and "chapter 2" as another file, and so on. And then you process the xml through docbook and it all ends up in one big document in the right order with all the pretty formatting you need.

However, with so many files spread all throughout the directory tree, sometimes it's difficult to know where certain files are. And today I needed to find all the files in the sources that pertained to a very specific section, notably, video production.

Previously, my method of doing this was the noobish ls -r | grep -i video which just burrows down into the tree and lists every file with the word video in it. The obvious problem is that this doesn't actually show the full path of where the file exists. So I started doing an ls -R > list.txt && less list.txt and then searching in less for the word video. This worked but was...really a noob command. Bad unix karma for doing something this way.

Solution:

I ripped this straight off of ducea.com:

  • find . ! -type d -ls | grep -i video

..which gives you the full paths of the files that contain the word video in their titles. Quite nice.


dd to create an image of a drive

Wednesday 3 February notKlaatu

Evil Azimuth (artv61) had procured a drive full of Micr0s0ft trade secrets (no, not really, but it makes this post sound more exciting) the other day, and needed to create an image of that drive that could be mounted, looked at, have data pulled from, and so on. We decided that dd was the tool to use, and then proceeded to figure out how to do it. So, the procedure for using dd to clone an entire drive hook up to your usb port, and copy it as an image file onto another drive hooked up to another usb port, is this:

Verify where the two drives are mounted:

  • bash$ mount
    /dev/root on / type ext4 (rw,barrier=1,data=ordered)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    usbfs on /proc/bus/usb type usbfs (rw)
    tmpfs on /dev/shm type tmpfs (rw)
    /dev/sdb1 on /media/source type vfat (rw,nosuid)
    /dev/sdc on /media/destination type vfat (rw,nosuid,nodev,shortname=mixed,flush)

The two important drives here are /dev/sdb1 mounted on /media/source and /dev/sdc mounted at /media/destination. Um, these are extremely convenient names that I'm using just for this tutorial; your drives will not be named that.

Next, initiate the disk copy:

  • su -c 'dd if=/dev/sdb1 of=/media/destination/image.img'

You probably notice that the source is given as a device and the destination is named by its mount point. This is because we do not just want to copy one file off of the source drive, and we can't tell dd to copy a folder (because dd won't do that), so we need and want to grab everything. To grab the entire disk itself, we must define the source as a device. On the other hand, we're not cloning the device to some other device; we're cloning it into an image that can be mounted and that we can sort through and grab the important data and then discard.

Again: this is not cloning a drive, bit for bit, to another drive. This is creating an image, bit for bit, of that drive into an image file on another harddrive. If you're looking to really clone drives from end to end, including all partition information and GUIDs and all that, I think Clonezilla is probably the way to go.

As the copying commences, you will see, if you do an ls -lh on /media/destination, the file image.img be created, and then it will grow in size as the bits are copied over into the file. It could take a while.

Once the image is finished, you can mount it by first creating some place for it to be mounted, and then mounting it using the loop option:

  • su -c 'mkdir /tmp/image'
  • su -c 'mount -o loop /media/destination/image.img /tmp/image'

and then you can cd over to /tmp/image and you'll see all the data that was the source.

EOF


folder template tutorial

Sunday 31 January notKlaatu

A guy who helped me on the Great GNU Linux Multimedia Sprint on January 26th asked me for some help with a GIMP task he was trying, and I said I would. He emailed me today to take me up on the offer, so I took a look at what he was trying to do and wrote up this quick tutorial. It is quite specific to what he was asking about, but then again it's broad in that it requires lots of little GIMP tricks, including highlighting one of the major differences between GIMP and Photoshop. So, here's the tutorial. And Christos, thanks again for the help on the sprint.

So, the task was to create some custom folder icons using a Photoshop template that some guy on deviantart developed. It's a simple template but the instructions are specific to Photoshop and require tweaking in GIMP.

First, download the template: http://www.deviantart.com/download/97387505/Folder_Icon_Template_by_CodeNameBender.zip"

Open the template in GIMP.

load template into GIMP

The goal is to get the white front (existing on the layer named FRONT) to be your own graphic, thereby creating a personalized folder icon. So, we first must open the graphic we want to be in that white area. It will be most convenient in this case if our graphic is opened on top of everything, so first click on the So that the graphic opens directly into our current GIMP project and not as a separate window, we can use file > "open as layer" option. Or you could just be cool and hit control-alt-O

This opens the image at the top layer of your GIMP project. Depending on the size of the image, you may have to re-size it. I opened a large image, so hitting shift-t (or selecting the scale tool from the tool bar) and adjusting the size of the image worked well for me.

scale image until it fits over the white FRONT layer

Now we will cut the graphic in the exact shape of the white area. But first, we must address something that GIMP does quite differently than Photoshop. In the latter, you can think of a "layer" as a sort of sheet of acetate laid over the entire canvas, upon which a graphic is painted. In GIMP, a "layer" more of a cut-out placed on top of the canvas. They look the same, but they function differently. The template we are using now want us to select everything outside of the white area with our rectangular selection tool. That will work on Photoshop because you can select the (clear and invisible-to-the-eye) area around the white area. But in GIMP, there is vacuous empty space around the white area and that cannot be selected.

Therefore, the proper next step is to go to the Layer menu > Layer to Image Size. This fills in the empty space around the visible portion of the layer and now you are ready for the next step.

scale image until it fits over the white FRONT layer

Invoke GIMP's magic wand tool (keyboard shortcut "U"), make sure you are on the FRONT layer, and click anywhere outside of the white folder front face. This creates a selection of everything on that layer (which in this case is nothing) other than the white area.

selecting everything but the white space

Now, with the empty space still selected, switch over to your imported graphic layer. Do this by clicking on the graphic's layer in the layer toolbar. Although you won't really see anything different, you've basically just kept your selection but swapped out what layer is actually selected. It's a classic digital image manipulation trick; make a selection based on one layer, then move that selection over to another layer and do something to that layer. In this case, you want to cut off the edges of your graphic so that it fits exactly over the white space. Hit the delete key (not backspace, but delete) on your computer keyboard and everything within the selection will be deleted.

To make the title on the folder's tab go away, simply click the eyeball to the left of the "Template" and it will be invisible.

trimming off the edges of our graphic

That is, essentially the end of the tutorial as given on deviantart. The folder now looks like a folder with our image over the front. However, I couldn't leave this post with an imperfect result, so I will modify a setting or two to tweak our design.

In this case, the back of the folder (the tab) is quite dark against the graphic I chose, so we should modify the gradient. To do this, select the "Top Layer" layer in the layer toolbar. While you're at it, go to the top of the toolbar and click the checkbox next to the little checkerboard icon; this is the "Lock" function, and it preserves the transparency of a layer. This means that whatever you do on a layer will only occur within pixels that are already active, and not in transparent pixels.

ditching the text layer and locking the transparency on the Top Layer layer

Now I'll select the gradient tool and drag a gradient vertically along the "Top Layer" layer until I find a gradient that provides some separation between the front graphic that I've inserted and the back folder that is pleasing to the eye. And now it's pretty much finished.

making the gradient pretty

Now go to file > "save as" and save the image as a .png file. PNG format will save the transparency (important for images that are destined to become icons) but get rid of the layers information.

How do you use this image as a folder icon? Beats me, but I do know that if you're using KDE you can swap out the folder you've created with any other icon by reading my Icons and File Types in KDE Properties Dialog Box post.


Install Unsupported Firefox Add-ons

Saturday 30 January notKlaatu

This is probably a really well-known hack but I didn't know it, so I figured I'd post it here for anyone else who happened not to know yet.

Lately I've run into two instances when I've needed a very particular Firefox add-on only to find that either my Firefox version was too far ahead (ie, I'd compiled it from mercurial) or the add-on itself was lagging behind (ie, when you click "install add-on", Firefox tells you that the add-on cannot be installed onto that version of Firefox yet). In the former case, I figure that really all that is going on is that Firefox's built-in "add-on installer" is doing a quick and fairly unintelligent check of the version number, seeing something that doesn't match exactly with its known set of supported versions, and refusing to continue. More than likely, the add-on will work on a newer version of Firefox even if it doesn't know it will. In the latter case, it's a little more uncertain; could be that the add-on was written before, for instance, framework Foo was replaced with framework Bar in the Firefox source code, and so it just won't work on a newer version of Firefox. On the other hand, it might.

The answer is to circumvent Firefox's in-browser add-on installer -- that is, do NOT install the add-ons from the webpage https://addons.mozilla.org or from the little pop-up "Add-Ons" browser that appears when you go to the Tools Menu and select Add-Ons. At least, not at first.

So first, you simply look for the add-on you want to install as usual via https://addons.mozilla.org but when you find the add-on, instead of just clicking on green "install now" button, right-click on that button and "Save Link As..."

This downloads a .xpi file to your harddrive. That's the add-on.

Now you need to get it installed into Firefox. To do that, all you have to do is de-compile Firefox, patch the source code, re-build it ---- just kidding. To do that, all you really have to do is quit Firefox, find the .xpi file on your harddrive, right-click on it, and select "Open With..." and open it with Firefox. It will automagically open in the little external add-on installer for firefox, and then you can install it and restart Firefox.

Should work like a charm, barring any weirdness due to real code conflicts. I have done this with a whole host of add-ons (Firebug, Xpather, Live Http Headers, User Agent Switcher) on a nightly build of 3.6.x at work, and with a Telnet shell emulator and FireFTP on 3.6 at another job (even though the Telnet shell emulator hadn't been updated yet for 3.6). Your mileage may vary, but give it a try.


setting up fluxbox so it is as good as everyone says it is

Wednesday 20 January notKlaatu

Fluxbox has for some time been a favourite window manager of mine, with its minimalism and simplicity appealing to my occasional need for a low-overhead operating environment. The great thing about Fluxbox is that its modularity almost encourages you to use it as a basis for a very customized amalgation of all your favourite parts of other desktop environments by mixing in GTK apps, K apps, X apps, and whatever else you want to have access to.

In my view, it helps to think of Fluxbox in different parts. I think of Flux as a few different modules:

  • Fluxbox startup. A startup script defining all the stuff you want to have persistently running within your Fluxbox desktop.
  • Fluxbox keys. Bindings for keyboard shortcuts within Flux.
  • Apps. The applications you want to have available to you for everyday work.
  • Look and Feel. The methods you can customize the look and feel and sense of design unification within Flux.

Startup

The startup file for Fluxbox is ~/.fluxbox/startup and is simply a plain text document, quite well commented, containing commands you wish to have issued when starting Fluxbox. It's easy to modify and really make your own; all you have to do is open startup in a text editor and add the applications that you want to be running alongside of fluxbox. Keep in mind that the final command in this file must be "exec fluxbox" and that generally the applications above that should end in an ampersand in order to ensure taht they run in the background and do not dominate the xterm session from which Fluxbox is being spawned.

In my Fluxbox startup file, for instance, I have listed:

  • # Applications you want to run with fluxbox klipper&
    kmix&
    xscreensaver&
    conky &
    fbsetbg ~/Pictures/images/1680x1050.png
    # And last but not least we start fluxbox
    exec fluxbox

Note that the fbsetbg line does not end with an ampersand, because it's actually not an app that needs to continue to run. It is run (to set the background image of the desktop) and then it ends, continuing onto the next command in the list -- in this case, launching fluxbox.

klipper, of course, is my clipboard tool borrowed from KDE, and kmix is the volume control also borrowed from KDE. Both work seamlessly with fluxbox and are nicely docked in the Fluxbox toolbar by default (because the ability to dock these apps is defined in .fluxbox/init). Xscreensaver is the screensaver I like to use, and it requires to be launched and sent to the background, and it will kick in whenever I walk away from my computer or issue the "xscreensaver-command -activate" command.

thelastknowngod, formerly of the linux reality forums, emailed me to let me know about the app for which fbsetbg is a wrapper, called feh. feh is a really cool application that is actually quite robust -- a really nice aspect of it is that it will set your background to whatever image you last set your background to. So, if I suddenly decide I want a free Linux Format wallpaper as my background, then I can set that as my background and that selection is logged in .fehbg, and next time I log in my background will STILL be that wallpaper. The way to implement feh is to first set your background as something that you like, ie:

  • bash$ feh --bg-center /home/klaatu/lxf118.jpg

and then, in my .fluxbox/startup file, comment out the fbsetbg line and replace it with:

  • eval `cat ~/.fehbg` &

Now restart fluxbox and, sure enough, your background is lxf118.jpg. But if you then switch it to, say, lxf122.jpg, then next time you log in, the background will be lxf122.jpg. Quite nice.

Fluxbox Keys

Key bindings in Fluxbox provide fast, almost mouseless interaction with your desktop. Since so many applications already have key bindings for the control and alt keys, I like to use the meta key (labeled "Super_L" in xev and more commonly known as either an apple or a wind0ws key on the keyboard) as a primary shortcut key.

Assigning new keyboard shortcuts is as simple as mimicking the existing syntax in the key file. My custom shortcuts are:

  • # open apps
    Mod4 t :Exec konsole
    Mod4 k :Exec konqueror
    Mod4 z :Exec fbrun # this is the fluxbox 'run command' interface
    Mod4 l :Exec krunner # this is the KDE 'run command' interface
    Mod4 m :Exec thunderbird3 # the command here is thunderbird3 because it is a custom compiled tbird running from /usr/local/bin
    Mod4 f :Exec firefox
    Mod4 x :Exec audacious
    Mod4 d :Exec dolphin
    Mod4 a :Exec arora
    Mod4 e :Exec emacs -fg Black -bg Wheat # yes, no quotes necessary around the command
    Mod4 q :Exec xscreensaver-command -activate # again, no quotes are required

But feel free, obviously, to create your own for the apps that you use.

Apps

With a default install of, say, Ubuntu or Fedora, you will probably have all the Gnome apps you need. Most all of these apps can run within the Fluxbox environment pretty seamlessly. That is, if I want to launch a fancy terminal, I could launch gnome-terminal, and it willl open and give me its nice tabbed interface with all the nice benefits that come along with using a GUI terminal emulator. Keep in mind, too, that a lot of the little bits and pieces in the typical Gnome configuration can be run, even though you're not running Gnome proper. If you launch nautilus, you can even get the icons in your Desktop directory to show up on your Fluxbox desktop.

Being more of a KDE guy myself, I chose to install all the KDE components (not Kubuntu, just the KDE components), so I can launch Dolphin as my file manager, Konsole as my terminal, konqueror as web browser, and so on. I can even launch krunner -- the 'run command' interface of KDE that does so much more than just run a command. I can also load Klipper and Kmix and any other KDE applet that I want to use.

Depending on what desktop environment you're pillaging, you have lots of options available to you. You can add an XFCE panel, or a dock, or a gnome panel -- pretty much anything that has an executable and is independent of other major components of a desktop environment can be run as part of your Fluxbox environment. Some of them bring a lot of baggage with them; like Nautilus bringing along the entire desktop, or plasma-desktop bringing along, well, the plasma-desktop. Whether this baggage is a bad or a good thing is your own personal opinion.

Look and Feel

Changing the theme of Fluxbox is fairly easy. By default it comes with about 15 themes to choose from, but adding to these themes is easy. You can find themes on sites like box-look.org or you can just boot up a cool liveCD that uses Fluxbox and steal their custom themes for your own use. I like Wolvix's themes blind_grey and blind_blue, so I just took the themes from Wolvix's /usr/share/fluxbox/themes (or thereabouts) directory, saved them to a USB thumbdrive, and copied them over to my work Ubuntu system. Placing those folders into /usr/share/fluxbox/themes and restarting fluxbox reveals the themes as options in the fluxbox menu, and as quick and simple as that, Fluxbox is themed.

The background image is set with a little application called fbsetbg, which can be invoked in your .fluxbox/startup file. It sets the background of your desktop to whatever image you tell it to use, and you don't really have to think much about it. I used Ivan Cukic's "Dance of the Spirits" desktop but feel free to use any image you like.

KDE's set of Qt widgets and styles can be configured by launching KDE's system settings. I find this is easiest to do from krunner; just type in "system" or "system settings" and the correct choice will appear.

GTK seems to be a bit trickier for some reason. Dave Yates of Lotta Linux Links oggcast was saying on an old episode that Firefox, a GTK application, looked really ugly when launched within certain Qt-predominant environments. I emailed him and told him that I'd had the same problem but that it could be avoided by using gtk-qt-engine ,,, a package that I know from Slackbuilds but in truth have no idea really where it comes from. It's just one of those magical apps that one finds in one's repository, installs, uses, and doesn't think about.

At work, however, I use Ubuntu and, since Gnome isn't my first desktop of choice, I configured my fluxbox environment with KDE flair. Firefox, however, is an app that I use for its add-ons, and sure enough, it's blocky and gray and ugly. I'm not clear on why it doesn't inherit Gnome's appearance settings, especially since the installation of Ubuntu that I run is the Gnome version and I intentionally did not install the Kubuntu meta-package.

Whatever the reason, the answer is a little application called gtk-chtheme (also available via ubuntu repositories), but possibly gtk-qt-engine would have worked as well (but I know gtk-qt-engine from Slackware and didn't see it immediately in the Ubuntu repository). The point is, if you are running a desktop that is not particularly GTK-based, then you can launch gtk-chtheme or similar, choose what widget style and theme you want your GTK apps to use, and from then on all GTK apps will be themed appropriately. Unlike using gtk-qt-engine from within KDE's System Settings, gtk_chtheme runs independently of any desktop environment. It will launch its own window and offer you any number of GTK themes. It looks on your system to see what GTK themes you have installed already, but you can add more by doing an aptitude search gtk | grep theme and browsing through the themes in the repository.

And with those settings applied, you ought to have developed for yourself a nicely customized, fast, easy-to-use, and integrated desktop environment. Enjoy your flux.


using wpa_supplicant for WEP

Tuesday 12 January notKlaatu

I went to a company today for some xml training that I have to take for a new job, and their routers were all WEP encrypted. I hadn't used WEP in a while, but I figured it would be no big deal, so I opened up my Slack13 laptop and fired up wicd and tried to connect to one of their access points. Long story short - no luck.

The problem was found by Skywise in ##slackware and is something that I certainly should have tried long before logging into ##slackware but didn't, but anyway, it was found by looking at dmesg:

  • bash$ dmesg | tail

The error was this: privacy configuration mismatch and mixed-cell disabled

I don't know why this is an issue, and I don't know why my Fedora eeePC was able to navigate this transparent to the user and succesfully sign onto the network, but apparently a standard iwconfig and dhcpcd command series, or wicd for that matter, would not work in this case. The answer was wpa_supplicant.

So if you encounter this issue, become root and make a backup copy of the standard default /etc/wpa_supplicant.conf and then edit /etc/wpa_supplicant.conf to something like this:

  • bash# vim /etc/wpa_supplicant.conf
    network={
    ssid="someNetworkName"
    scan_ssid=1
    priority=5
    key_mgmt=NONE
    wep_key0=4f3a1576a2
    wep_tx_keyidx=0
    }

Also, delete the WPA parameters in the section above your WEP parameters.

Now, still as root, you will issue the wpa_supplicant command and run it in the Background:

  • bash$ wpa_supplicant -iwlan0 -c /etc/wpa_supplicant.conf -B

Dissected, that command means to run wpa_supplicant using interface wlan0 and configuration file /etc/wpa_supplicant.conf in the background.

Now issue the command

  • dhcpcd wlan0

Ping some known website and you should be online.


Foreign GUI

Tuesday 5 January notKlaatu

Yesterday I was called in to a corporate meeting type thing and they had marketing slides and stuff like that, and of course the Windows people were using XP or 98 or something, and the Mac people were on some version of Leopard. I hadn't seen 0S X in about a year, and I was surprised at my reaction to 0S X when I saw it. There's a feeling when you see an older GUI that is somewhere between mild shock and amusement, sort of a "I used to use that? and I thought it was cool??" feeling. And that is what I experienced seeing 0S X. It caught me off guard a little, looking at 0S X's bright blue glowing buttons and its muted gray browser, its oddly transparent menu bar among no other transparent elements, the sadly underpowered Finder, and the multi-levels of abstraction between simple tasks like connecting to an SMB share folder.

This is a unique experience, I think, because for many geeks, 0S X is the forbidden fruit; it's a OS they haven't used often but is based on Unix and it looks and feels different and exciting. To me, 0S X (and 9 and 8.6 and 8.5 and probably 7.6) was the status quo for a long time, so there is enough familiarity to get a little bit surprised when I see the 0S with such a popular look and fail to be impressed.

I think there is a tendency for people, myself included, judging from my reaction to seeing 0S X again in a year, to have a pre-conceived notion that 0S X is cutting-edge and beautiful. I must have expected it to just be better than KDE4......why? because it was a proprietary system and had millions of dollars spent on it (Leopard) and then another millions of dollars to fix it (Snow Leopard)? Why do we think the GUI is so slick? to me it looked like a bad combination of muted flat tones with bright and bubbly widgets. Gradients appeared in one place but not another, transparency seemed like an after-thought, and consistency was in general absent from the design.

There were some good elements, sort of... the dock is something that lately I'd been missing, and so I installed Daisy, a dock for KDE. The thing about Daisy is that it doesn't get in the way; it is a docked set of one's most frequently used apps plus the currently running apps. Windows can cover it and it doesn't pop up or get in your way at inconvenient times. This was surely inspired by 0S X's dock, yet the 0S X dock, as I was unpleasantly reminded, cannot be covered by windows -- it can be hidden but then it will pop up into view again if your mouse gets too close to it. It can be moved to either side of the screen but, again, can't be covered and will jump out at you if you are not careful. And of course it can never be removed entirely (except through dangerous hacks that mess with the rest of your desktop).

In short, I just found it interesting and comforting that I guess I've become a linux-desktop power user. That is to say, if you sit me down in front of the common Linux desktops, like the KDE Plasma Desktop, or e16 or e17, or fluxbox, or even Gnome, that I'll actually probably be able to accomplish tasks faster than I would be able to on proprietary ones. Obviously it didn't used to be that way, but my muscle memory and my eyes and my mind have all apparently adapted to the Linux GUIs and all of its peculiarities, and finally I'm seeing 0S X as something foreign. A nice place to be, for a former Mac person.


You mean the GUI works too?

Saturday 2 January notKlaatu

It's funny how one gets used to working in the command line and actually forgets about options available to them in the GUI. One of the first things I struggled to learn back in my early days of using *nix was the syntax and sequence of switches for tar, so I got really used to archiving files in the command line, and later I learned the subtleties of zip in the command line, and gzip and bzip2, and so on. I got so used to archiving files in the command line that I literally never archived a file any other way.

Today I was jockeying some files around and I had a billion dolphin and konqueror windows open (and by a billion, I mean three or four) and since I was so entrenched in the GUI already, I figured that when it came time to zip a file I may as well just go ahead and try the right-click > Compress > As Zip Archive method.

And whaddya know, it worked. Amazing, these fancy graphical environments.


Not choosing the wrong compression format for your files

Wednesday 30 December notKlaatu

At some point in one's computer life, one will need to compress a file. Linux users frequently use gzip and bzip2 compression, both of which have been around for a long time and are free software, so that even if the formats were suddenly dropped then we could all still get the source code, compile it for whatever machine we are running, and open a formerly gzipped or bzipped file. In ten years, the same would hold true; we would still be able to get the source code, compile it for the Computers Of The Future, and open gzipped and bzipped files.

The very common zip file format was at some point placed in the Public Domain, and therefore compression and decompression software can be obtained, compiled, and used. It is the format used for WinZip on Wind0ws and, as of 0S X the Mac Archive tool.

When choosing how to compress files for archiving or for sending via email or posting online, it is smart for compatibility purposes as well as to future-proof the compressed file.

The antithesis to this are options like StuffIt, sfArk, sfpack, and probably quite a few others.

StuffIt was the de facto compressor for Mac before 0S X, and has been owned by a number of different companies over the past decade, which has, luckily for long-time Mac users, kept the format alive. Should StuffIt be dropped from its current owner, decades of StuffIt compressed files will be threatened by obsolescence. The code is not free, so even if a Mac user knew how to obtain the source and compile it, it would not be possible. In the worst case, this could mean that a user's data would be forever compressed, unable to be uncompressed and accessed.

In terms of compatibility, StuffIt offers a Wind0ws version of their uncompressor but no Linux version. When I receive files from Mac-using friends in the .sit format, I consistently ask them to re-compress the file as a zip and to re-send.

Worse still, as in my own case, should a user seek to escape Apple's proprietary world, the user can't take StuffIt files along. I had to spend hours upon hours in front of 0S X, which I luckily had access to via work even after I'd converted all my home computers to Linux, uncompressing old .sit archives only to recompress them into the more open .zip format, so that should I ever want to access them again from Linux, I would be able to do so.

I became painfully aware of the dangers of choosing the wrong compression format when I was hunting for soundfonts this week. Soundfonts are synthesizer patch files that generate sound from very small samples and is a popular format in both hardware synths, Wind0ws soft synths, and Linux softsynths. There are a lot of soundfonts out there and I downloaded over 350 during a three day hunt for really good free soundfonts. Some of them are very old but are still very desirable to have. Apparently, however, it was common for some time for soundfonts to be compressed with two compressors by two different companies, one called sfArk and the other sfpack.

SfArk is the healthier format; although many direct links to its download page have expired, a good search engine finds sfArk easily enough. The proprietor of sfArk offers an uncompressor for Linux, but only as a pre-compiled 32bit binary, and it only works on sfArk version 2; any file compressed with version 1 cannot be decompressed by the app provided. The companies solution? They urge people who have used version 1 sfArk to convert all their sfArk files to version 2 so that people can decompress them with the newer decompression tools. This means that if I had a collection of soundfonts that I'd been gathering over the years, in order to ensure continued compatibility, I would have to and uncompress ALL of my soundfonts, and then recompress them with the newer tool.

Obviously that's just not going to happen, and sure enough within the 350 soundfonts I'd downloaded there were a few in sfArk version 1 that I could not uncompress. It was bad enough that I had to install a 32bit version of Linux in an emulator just to get sfArk to work at all. When some of those sfArk files would not uncompress, I spent an hour or so trying to figure out what I was doing wrong and re-downloading the soundfont and so on, until I checked the website again and saw the fine-print caveat about version 1 sfArk files. To make matters worse, sfArk version 1 and version 2 both use the same file extension; .sfArk, so there is no immediate way to tell one from the other.

Worst still was the sfpack compression format, now utterly abandoned by its creator - in fact, the company has disappeared and has taken the sfpack code with it. Luckily there is a copy of the sfpack decompression program available from someone's personal site, which in terms of legality falls, presumably, within the "abandonware" jurisdiction. Unfortunately, the application is Windows-only.

I could have tried installing the sfpack app in WINE on Linux, but so far I have never actually used WINE and certainly have never installed it on 64bit Linux. Luckily, I was able to call up my one friend who uses Wind0ws and convince her (and myself, a complete Wind0ws idiot) that it was entirely OK to download a mysterious executable file from a mysterious site, that it would not(?) give her w!n7 box a virus. Once that was done and the sfpack-compressed files had been emailed to her, I guided her through the process of uncompressing files via a GUI I myself had never even seen. In the end, the files got uncompressed and I will ensure that at least my copies are compressed only in Free Software compression formats.

So, dear reader, consider this moral tale when you look at what compression format to use on files that are either important to you, or are important enough to upload onto the internet for posterity. If you compress it in a proprietary format that might have a strong following that year and lots of pretty graphics on their webpage and great support for "both" operating systems...you are basically signing access to that file over to the company that makes the decompression software. They could be here today but gone tomorrow, and they have no obligation to ensure you have future access to your archives. If they're not giving you the source code to that technology, you could be locking up your data forever.

Bottom line:

  • WinZip and Mac Archive = good
  • zip = better
  • tar, gzip, bzip2 = also better
  • sfArk, sfpack, StuffIt, others I don't know about yet = bad

It's not a matter of "my open source app is better than your closed source app no matter what", it's a matter of ensuring you always have access to your data. You've been warned.


howto Qemu

Saturday 26 December notKlaatu

This is a repost, verbatim, of a post I did to my old binrev blog. I'm posting it again here because the binrev site is difficult to navigate and has in the past ruined the formatting of some of my blogposts. I figured I should migrate posts to this site, so here's HOWTO Qemu again, for the very first time:

Qemu is a free emulator for Linux, and it is powerful enough for everyday use with new features popping up with each new release.I'm not virtualizing to serve thin clients or anything fancy like that; I'm just doing the everyday hobbyist kind of emulation that one wants to do when one wants to try out the beta of an upcoming release, or when one wants to first with a distro that is not their own, or when one is doing a tutorial and needs a fresh install for pure screenshots, or whatever.Qemu at its best, IMHO, is a Command Line application.

There is a GUI front-end called Qemu-Launcher. I find it unnecessary, partially because the command line options are powerful and quick enough to get your emulated host going, and partially because Qemu-Launcher doesn't seem to actually launch a host for me on my system. Not sure why -- but I'm not going to bother troubleshooting something that is redundant anyway. I find the command line interface quite enough to launch an emulated client.

First thing's first: you need to install Qemu. This should be a simple su -c 'yum install' or a sudo apt-get away.

  • bash$ su -c 'yum install qemu'

Once that's finished, you can do a "man qemu" to see all the options that come along with qemu...or check out the qemu site for complete documentation.

One of the first things I do is create a little fake harddrive for Qemu to use as its emulated harddrive. That is, if you want to actually install a distro (as opposed to just running it off of the cd) then you'll need a container file that Qemu can take over, pretend like it's a real harddrive, "format" and install onto. Since this is just a sandbox, I figure a 4gb image is quite enough:

  • bash$ qemu-img create -f qcow2 qEmu.qcow2 4G

Here's what we just did:

  • qemu-img create # invokes qemu-create and tells it to create a new file
  • -f qcow2 # the image format; qcow2 is qemu's native format; there are other choices if you're going to export this image to some other virtualizer
  • qEmu.qcow2 # this is the name I've given my disk image...you can call yours anything you like; fedora11.qcow2 or debianSqueeze.qcow2 or whatever
  • 4G # the size of the container...give it more or less space as desired

Now, I typically use Qemu with an actual cdrom in my disc drive, because the distros I am test-driving are almost always the ones that come on the bundled disc in Linux Format or Linux Pro or Linux Identity magazines. Here's the one-liner for such an endeavour:

  • bash$ qemu -M pc -cpu qemu32 -cdrom /dev/cdrom -boot d -drive file=~/qEmu.qcow2

Switch by switch:

  • qemu # invokes qemu
  • -M pc # defines what kind of Machine you want to emulate; type -M ? to see a list of choices
  • -cpu qemu32 # what kind of cpu to emulate; type -cpu ? for more choices. qemu32 is the one you'll probably want if you're trying out a modern OS
  • -cdrom /dev/cdrom # this defines the location of your cdrom drive. Can be an .iso image saved on your harddrive, too!
  • -boot d # where to boot from; the "d" option tells qemu to boot on CDROM rather than Network or Harddrive
  • -drive file=~/qEmu.qcow2 # our qcow2 image, remember?

After you issue the above command, you should see a window pop open, revealing your emulated host. First it will load its emulated BIOS and then it will boot from the actual cdrom. You can install the distro onto the harddrive image, which the emulated machine will believe is an actual harddrive (you'll know it's not your real harddrive by the size of the drive, if nothing else), or you can just run the distro as a Live distro if available.

What if you didn't get a dvd with a magazine, but had just bit torrented the latest iso of a hot new release? That's quite similar; first, of course, have the iso on your harddrive. Have a qcow2 image established. And then run qemu thusly:

  • qemu -M pc -cpu qemu32 -no-acpi -cdrom ~/Download/F11-Preview-i686-Live/F11-Preview-i686-Live.iso -boot d -drive file=~/qEmu.qcow2

You might notice that I've added a -no-acpi flag here, simply because I've found that Fedora 11 won't boot without it. In an emulated machine, I'm not sure whether you ever really need acpi anyway, so it's probably a safe thing to turn off. Aside from that, the procedure is the same except that instead of point -cdrom to my /dev/cdrom I'm pointing it to the iso file.

Some other important options you might want to define:

  • -m 512 # allot 512mb of RAM to the emulated pc
  • -usb # enable usb functionality in your emulated pc
  • Check the man page or just type "qemu" without any options for a full list of functions. There are a few video and sound and network settings that you might want to play around with. That's pretty much it. Emulation that is free and easy!


the business of scam

Tuesday 15 December notKlaatu

One of my forms of income as a freelancer is writing articles for magazines, which I try to do as often as I can because I enjoy it and sometimes it does even pay. I don't usually get magazines like Writer's Digest or any of those "You can be a writer!" magazines, for the same reason that I stopped subscribing to a lot of the usual "You can be a filmmaker!" magazines like Filmmaker Magazine and Film Threat and stuff like that.

The thing about these magazines is that they are just plain out of touch. The article "Dominating Downtime" in the most recent Writers Digest relates supposed tips on how to maximize the time a writer is waiting to hear back from a magazine on whether or not that magazine wants to purchase their article. Writers Digest talks about scenarios like an editor of a magazine calling up to discuss an article, sales pitches a writer might be able to make, advertising opportunities for the freelance writer, and all kinds of bizarre situations that may have happened at one point back in the 60s or 70s, or maybe that never happened but do happen only in movies. The fact about being a freelancer or independent or whatever term you want to use, is that you bang your head against the wall of the writing or artistic industries and usually get no repsonse at all, or maybe you are lucky enough to get a form letter. But this myth of editors and producers calling you up to discuss your idea is maybe a one-in-a-million occurrence, and if you're on of the million people to justify such a personal debate then you probably have a parent in the industry pulling some strings for you and you're probably not the sucker paying 6 bucks for the Writers Digest every month.

To make matters worse, as examples of magazines the young writer might be dealing with, Writers Digest uses Vanity Fair and other top-selling magazines that are pretty much impervious to freelance writers anyway. A lot of the big magazines out there have a staff of writers and don't even bother with freelance article submissions, so the liklihood of the writer having sold an article to Vanity Fair during the "downtime" of waiting for GQ to get back to them is very very low.

So my question is, why are magazines that claim to exist to help people get into an industry lying to their readers? It's not so much a lie, I guess, as so much as it is an illusory, misleading fantasy. Between mags like Writers Digest, Filmmaker, Film Threat, Writers Market, Ink, and all these other "helpful" publications, there is this fluffy and fake world out there in which even I, the average geek from Anytown, USA can break into The Biz. All I have to do is write, and produce, and keep buying all the guides on how exactly I am supposed to be breaking into The Biz. Yes, you see, all we need is perserverence and all the how-to guides we can possibly afford (and then some).

And that of course is the answer; the book and magazine market is booming with guides on how to be successful. Like other finely tuned scams, there is not really an end game or a goal, there is only the perpetual journey toward Success.

And, to bring this all back to the purity and honesty of GNU Linux, I have to point out that there is no such deception in a true meritocracy. There are no guides on how to be a rockstar Linux person. You have only to learn what you want to learn, and implement what you want to implement.

And, to broaden the analogy even further, this also holds true to the anarchist ideal of valuing direct action. Rather than proposing ideas and drawing up plans on how to possibly somewhat influence something, one instead does what one wants done.

And with that perhaps bizarre stream of logic, I am satisfied that I have fairly warned people to stay away from magazines and periodicals perpetuating The Scam that is The Biz, and to support truly independent art.


Online Desktop Integration with KDE4

Monday 14 December notKlaatu

Traditionally, if you want to post a webpage on your site, you'd do the following things, in this order:

  1. Open a text editor
  2. Save as an HTML file
  3. Type in your webpage code
  4. Open an FTP client
  5. Upload your webpage

Nothing's wrong with that workflow, but if you use KDE4 on a GNU Linux system, you've got a lot of flexibility in how you choose to work. Here's a smoother workflow, using KDE4 and its apps.

First, open the file manager, "Dolphin" and type into the location field your server. So, to post this HOWTO on the site straightedgelinux.com, one would type in:

  • ftp://straightedgelinux.com

log into your server with Dolphin

Enter your username and password when prompted, and then navigate to the directory in which you want to add a page.

creating a new file

Now right-click in Dolphin and select Create New > HTML File. This will bring up a dialogue box asking you to name the new file; name it something logical, such as howto_workOnline.html, and hit return.

name the new file

Now right-click on the new file and select Open &#gt; Kwrite (or choose Kate or whatever editor you prefer) and the file will open. You'll notice that not only does the file open like a local file in your text editor, but it even opens with the basic HTML tags already typed in for you.

editing html in kwrite

Now type in the contents of your webpage, hit save, and your page is published and live, all done interactively with your server and KDE's fine desktop environment.

That's it.


get your system info on Linux + KDE4

Wednesday 18 November notKlaatu

In Mac0S X, I used to go to Apple Menu < About this Mac to get basic system information, like processor type and speed, and how much RAM is in the box. Clicking on "More Info" gets all kinds of info, like L2 Cache, GPU info, RAM info, harddrive info, etc.

In Linux, I learnt that the equivalent to this was cat /proc/info/whatever which does work quite nicely and gives a lot of great info, and I use it frequently. But try explaining it to someone who barely ever ventures onto the command line.

Whether you've been using Linux for years or just a few hours, sometimes getting all the highlights of one's system all in one window is pretty nice. And, of course, it looks like my favourite fully-featured desktop, KDE4, features a way to get a summary of your system info in Konqueror. Two ways to see it:

  1. Open Konqueror and type in the URL bar:
    • sysinfo:
  2. Go to the K-Menu < Computer < System Information.

Either way you do it, this is pretty much what you'll see:

gui view of sysinfo

gui view of sysinfo further down the same window

Attractive, appealing, and informative!