Archive for the ‘crunchbang’ Category

Running monkey httpd on AA1 under crunchbang

August 10, 2009

One of the things I liked about DSL was its inclusion of just about everything you’d ever need whether you wanted to use it as a desktop or a server. I figure from the posts in the forums that desktop use far outpaced server use but it’s quite capable as a server. DSL included everything from SSH and SSL to FTP server to a small HTTP daemon called monkey, which along with any of the other services could be started at boot from a cheatcode.

I think monkey was one of those things that kind of grew on me even though I’d often use thttpd (personal favorite). I’d use it at home for a variety of things including running a local bloxsom blog and hosting family calendars. I’d sometimes use it at work to test things and to set up a temporary server for our group. Despite its tiny size, monkey does CGI and can handle just about whatever you’d want a small HTTP daemon to do without any bloat and with easy configuration. It’s also been rock-solid in my experience, even with moderate traffic. I think you don’t need a full LAMP stack if your needs are fairly simple and you’re not setting up a production server with loads of traffic (and thttpd, which I think is more robust, should suffice if that’s the case).

I needed to look at something and needed to host it on my own network, so I looked to see if monkey is available in the Ubuntu repositories. It is, so I installed it.

The first thing I discovered is that its default conf file (/etc/monkey/monkey.conf) uses port 2001, which is kind of stupid (IMO). I edited it to a more suitable and easily remembered port (8080).

Once it’s set up the way you want, you can start the daemon:
sudo /etc/init.d/monkey start

Actually, you should first check to see if it’s started by default (see below) when you install it. Whether it is or isn’t, it’s safe to issue a stop before starting and/or reconfiguring it if you need to use a different configuration than its default. I think it’s fucked up to set things up to start automatically upon installation or even upon reboot unless/until the user decides to run it. Guess that’s why I still hate Ubuntu and the mindset of the user it attracts (I was going to add a post about this utter shitheadedness affecting the wider Ubuntu community the other day but I’m trying to be more diplomatic — really).

Once it’s started, you can point your browser to localhost:portnumber (e. g., http://localhost:8080) or even to your IP (if not proxied) to reach it from the Internet. Here’s the default monkey page:

screenshot-20090810102113

You can set up your own index.html and configure it as you see fit, including starting with a conf file in your home directory. Just copy the default in /etc/monkey to wherever you want to set it up (such as ~/.monkey). My own preference is to set things up in my home directory, so I have ~/www set up with a directory tree suited to my needs.

screenshot-20090810102056

Another thing (not surprising) I discovered about the Ubuntu package is that it’s set up to start at boot. I moved the S monkey file in my default runlevel (e.g., /etc/rc3.d/) to K. I don’t intend to run a full-time httpd so I’d just as soon start it manually as-needed. It’s not that big but it’s the thought that counts. Keep that in mind when using packages from the bloated distros. (Didn’t I write above that I’m trying to be more diplomatic? See? I didn’t repeat how totally fucked up I think it is to start these kinds of services without users taking full control of them first.)

Also, I noticed {Tiny,Micro}Core doesn’t have a package for monkey yet. I’ll probably add that to my compile list shortly.

MicroCore on AA1

August 3, 2009

I’ll have a much longer entry to post from within emacs when I’m good and ready, but I’ve installed MicroCore 2.2 on my AA1. I really should’ve done this a long time ago and never fucked around with all the bloatware I’ve tried on this because no matter how much I’ve wanted drama-free “everything just works” stuff, it’s been anything but that. I still have my now pseudo-crunchbang/un-buntu stuff on here, and I’m not sure if I’ll leave it or clear my / partition for a persistent /opt or whatever (too big for that). At least if/until I wipe everything and install Windows 7 towards the end of October. Same f’ing ath5k driver, so I’m sure I’ll have the same f’ing ath5k problems I always have. Please prove me wrong.

A few cool things:

  • Boot time was so friggin’ fast that I literally turned for a second to get something to drink after hitting enter in my GRUB menu and had a prompt waiting for me when I looked back at the AA1’s screen. Good job, curaga and anyone else who deserves credit.
  • Even after setting up wireless and running elinks, I don’t think I ever went over 100MB of RAM in use.
  • No X! That means you don’t get screenshots unless I find/compile something that does console grabs.

As I wrote above, I’ll have another entry shortly (hopefully) with more details, more detailed impressions, why I’m using MicroCore instead of TinyCore, and what I’m going to do with it.

20090731 – Pseudo-Update ion3 Wireless Blah Blah

July 31, 2009

It’s not much. Just ratmenu in ion3 with a few minor interface changes.

screenshot-20090731124353

I added some aliases to help control mocp from terminal. Those work better than ratmen(u) in ion3 even though I’m not opposed to using my ratmenus set up for single apps like this but it’s kind of awkward. I might try something different this weekend.

I’d noticed that my statusbar wasn’t diplaying any systray icons so I went ahead and set that setting to false. I also set up the statusbar to take up the whole area (fullsize). Like it makes a big difference.

Finally, I’ve resolved the “issue” of my AA1 first associating with a neighbor’s AP before eventually connecting with mine. By setting my wireless up with a single configuration via wpa_supplicant I no longer am scanning/polling for APs, which is one of the things NetworkManager, wicd, and wifiroamd do. Since I don’t like that — I think these things should go through a whitelist of APs first before ever associating with anything else — I’m going to remove NetworkManager and not install wifiroamd (which, the more I look into it, seems the most promiscuous of the bunch).

One thing that hasn’t been cured by a new kernel or by any other changes is the race condition my Atheros card periodically goes through. It did it again this morning, suddenly and without warning. This is really frustrating because it happens irregularly, capriciously, so that I can’t pin it on one thing like suspend or using a particular application. I don’t know if it’s an issue with the driver, with WPA, a combination of those two things, or something else. I really want this to work correctly, and I don’t consider sudden loss of wireless signal and loss of detecting the card at all “correct” operation.

Adios NetworkManager

July 29, 2009

Tonight I finally got pissed off enough about losing wifi when not in X to ditch NetworkManager. Maybe, in an odd way, I’m kind of like Cheech and Chong when they “borrowed” a neighbor’s car and found its automatic transmission too complicated, but I find NM way more hassle than it’s worth. Probably brought to you by the same people who are simplifying audio with PulseAudio. I don’t get it, but I never had a problem with the “old” and “complicated” way. Then again, I actually read the fucking manual.

I haven’t installed wifiroamd yet because I’m not doing much roaming until my ankle heals. It’s easier with one network to deal with (just one wpa_supplicant configuration to set up) but that’ll change and I’ll have a couple more networks to set up. I may just use a series of scripts like I did when I was using OpenBSD on my other laptop — select an option for where I am, connect to whichever AP however I need to as needed rather than automatically connecting and potentially waiting a while to connect to multiple APs. I don’t know if wifiroamd is a better solution for that or if it’ll act like a desperate hooker trying to pick up any signal it can get while it ignores my own (see next paragraph).

In addition to being able to stream audio while in console (I have such odd tastes, eh), I noticed I’m finally below 140MB actual RAM after startx. I also noticed that there was none of the bullshit I’ve written about with associating with other APs before even getting to mine, which is the only one it should associate with. I know a lot of people don’t think twice about piggybacking but no wireless manager application should allow it by default — I think that kind of thing should require a user to choose an “any AP” setting or otherwise interact to allow it after searching high and low for a trusted AP.

I still can’t get over how many distros tie wifi to X by default now even though Linux distros are oriented for boxes and dials to set things up. I’m not really inclined to say this kind of thing because I try to stay open-minded about other systems, but that’s so Windows. Bunch of wussies.

Productivity: Setting Up at in Crunchbang

July 27, 2009

I needed to set up something to start at a time certain last night in what used to be crunchbang (considering I replaced over half the stuff in the default base, it’s not so much crunchbang anymore). That means using the at command; cron is a great tool for things that need to repeat on a schedule, but at is the tool to use for “one shot” events.

I entered “at 22:00” and wasn’t too surprised it threw out an error when I hit return. I looked in /etc and saw there was only the at.deny file but no at.allow. So I quickly added my username to at.allow. Then running at again showed that a certain file didn’t exist. Again, no big surprise — I openly admit a bias against Ubuntu because it uses shitty graphical utilities rather than setting up standard tools. So my next step was to setting up (touch) the file .SEQ in /var/spool/cron/atjobs.

% sudo su
root@pluto:/etc# cd /var/spool/cron/atjobs/
root@pluto:/var/spool/cron/atjobs/# touch .SEQ
root@pluto:/var/spool/cron/atjobs# ls -al
total 8
drwxrwx--T 2 daemon daemon 4096 2009-07-26 21:27 .
drwxr-xr-x 5 root   root   4096 2009-06-30 05:53 ..
-rw-r--r-- 1 root   root      0 2009-07-26 21:27 .SEQ

Uh oh, that won’t friggin’ work — it’ll result in denial of permission (unless you run as root, which isn’t necessary):

% at 21:30
warning: commands will be executed using /bin/sh
Cannot open lockfile /var/spool/cron/atjobs/.SEQ: Permission denied

The file needs daemon-daemon ownership. This is very easy to fix. See how easy it is, boys and girls?

root@pluto:/var/spool/cron/atjobs# chown daemon.daemon .SEQ
root@pluto:/var/spool/cron/atjobs# ls -al
total 8
drwxrwx--T 2 daemon daemon 4096 2009-07-26 21:27 .
drwxr-xr-x 5 root   root   4096 2009-06-30 05:53 ..
-rw-r--r-- 1 daemon daemon    0 2009-07-26 21:27 .SEQ
root@pluto:/var/spool/cron/atjobs# exit

Once I had that set up, I could test it to play a file (I wrote this Sunday night).

% at 21:30
warning: commands will be executed using /bin/sh
at> ogg123 ~/audio/fuckinaye.ogg<EOT>
job 2 at Sun Jul 26 21:30:00 2009

The EOT at the end of fuckinaye.ogg is just ctrl-d (remember that from when mail was a true commandline program?). At 9:30pm, I heard the test ogg file.

Now with it properly set up, I can use it to launch individual tasks when I need them and I don’t have to run X to do it from some stupid box with dials and buttons.

Update 20090724-1811 – ion3 minor reconfiguration (part 1)

July 24, 2009

I’ve taken the easiest way to getting back normal use of the function keys by assigning ALTMETA to Mod4 (Windows key) so that the default bindings for the function keys are now Mod4+F{1..12}. This will work at least temporarily but I think I want to change out the standard META (Mod1) so I don’t have to use the escape key in emacs for various M-commands (e. g., C-u M-! will not work as is — C-u ESC ! works).

Other than that, I’ve spent most of the day off the computer (for a change). The only other thing I’ve done is edit a simple grey theme using the simpleblue one as a guide.

-- look_shadesofgrey.lua - featuring terminus font and shades of grey
-- Fri Jul 24 15:15:56 CDT 2009
-- lucky13

if not gr.select_engine("de") then return end

de.reset()

de.defstyle("*", {
    shadow_colour = "black",
    highlight_colour = "grey5",
    background_colour = "grey22",
    foreground_colour = "grey88",
    padding_pixels = 0,
    highlight_pixels = 0,
    shadow_pixels = 0,
    border_style = "elevated",
    font = "-xos4-terminus-medium-r-*-*-14-*-*-*-*-*-iso8859-*",
    text_align = "center",
})

de.defstyle("frame", {
    shadow_colour = "black",
    highlight_colour = "grey5",
    padding_colour = "black",
    background_colour = "grey22",
    foreground_colour = "grey88",
    padding_pixels = 0,
    highlight_pixels = 0,
    shadow_pixels = 0,
    de.substyle("active", {
        shadow_colour = "black",
        highlight_colour = "grey5",
        background_colour = "black",
        foreground_colour = "grey88",
    }),
})

de.defstyle("tab", {
    font = "-xos4-terminus-medium-r-*-*-14-*-*-*-*-*-iso8859-*",
    de.substyle("active-selected", {
        shadow_colour = "grey53",
        highlight_colour = "black",
        background_colour = "grey13",
        foreground_colour = "grey77",
    }),
    de.substyle("active-unselected", {
        shadow_colour = "black",
        highlight_colour = "black",
        background_colour = "grey22",
        foreground_colour = "grey55",
    }),
    de.substyle("inactive-selected", {
        shadow_colour = "black",
        highlight_colour = "black",
        background_colour = "grey44",
        foreground_colour = "grey22",
    }),
    de.substyle("inactive-unselected", {
        shadow_colour = "black",
        highlight_colour = "black",
        background_colour = "grey22",
        foreground_colour = "grey44",
    }),
    text_align = "center",
})

de.defstyle("input", {
    shadow_colour = "black",
    highlight_colour = "black",
    background_colour = "grey44",
    foreground_colour = "white",
    padding_pixels = 0,
    highlight_pixels = 0,
    shadow_pixels = 0,
    border_style = "elevated",
    de.substyle("*-cursor", {
        background_colour = "white",
        foreground_colour = "grey44",
    }),
    de.substyle("*-selection", {
        background_colour = "black",
        foreground_colour = "white",
    }),
})

de.defstyle("input-menu", {
    padding_pixels=0,
})

dopath("lookcommon_clean")

gr.refresh()

It’s not fancy, but there’s not much you can do with something that doesn’t have “eye candy” as a criterion for development or consider aesthetics a feature (“wobbling windows” is not a feature — it’s a fucking bug which uses too many system resources and offers zero benefits). I only put something together a little bit darker than I found available among the defaults. I didn’t tweak the input style but it looks a bit lighter than intended on my AA1.

So far ion3 fits two criteria I had in mind. First, it has to be light on resources. The “if it’s not used it’s wasted” argument doesn’t work for me because greater resource demands come at the expense of power consumption; that’s an issue on anything that runs on batteries, but especially something with the limitations of a netbook battery.

screenshot-20090724180705

Second, it has to be configurable and stay out of my way as much as possible. I’m pretty sure it’ll be configurable enough for what I want (see previous entry). It certainly stays out of the way by automatically assigning window size to the size of the current frame. Since I quickly got the basic issue of the function keys out of the way quickly, I can look to add more of my own tweaks and preferences.

More soon.

Playing With ion3 on AA1

July 24, 2009

I decided to see how much work it’ll take to force ion3 to work the way I want it to on my AA1. I’ve used ion before and I love the general concept. What I haven’t liked — hated in fact — is the author’s default set of bindings. Many of these rely on the function keys, which are also used by various applications, as well as other bindings connected to the META/alt1 key. The settings for ion can be customized to suit any user’s needs by editing series of files used for configuration, starting with ~/.ion3/config_ion.lua which overrides the system defaults.

I downloaded the latest zero-install binary tarball and, as recommended for those of us not using zero-install, just unarchived it in /opt. Since /opt/ion3-[version number string]/bin isn’t in, and never will be, added to my $PATH, I’m using the full path string to launch ion3 from my .xinitrc.

Why not use the Ubuntu package? For starters, it would’ve resulted in adding — along with the ion3 package — over 18MB of stuff, quite a bit of it I recognized as stuff I removed already. Second, the package is outdated and possibly in violation of the terms of the author’s license (modified LGPL); Valkonen requires packages be updated within 28 days of his stable releases or be marked as “obsoleted and unsupported,” and that such packages be renamed.

While some have taken exception to the author’s terms, which also includes the renaming of any package which includes patches he doesn’t support (which is fair — why should he answer for or address downstream bugs for things he doesn’t even include?), I find them fair. As I’ve written before, this is no different than issues related to “IceWeasel” due to copyright issues with Mozilla Firefox. But it is markedly different from issues like what happened with MurgaLua and DSL last year: Murga had released his bindings under GPL and complained when the runtime was recompiled so that separate parts could be used independently — which is one of the basic ideals of the GPL’s freedoms: allowing the user to control how something works on his or her system; in the process, he wrongly accused DSL of removing copyright attributions when, in fact, he’d left out anything in his own bindings about his copyright. The tarball DSL made available was his own tarball, unchanged in any form or fashion — complete with the copyright notice he’d included as well as the GPLv2 text in the COPYING file. It’s that file which mentions that anyone is free to use, change, and redistribute the code, including those bindings, so long as the source is made available along with changes. DSL complied in every term of the GPL and the files included with the bloated runtime Murga provided, but still offered to add further lines to provide the author of the bindings a copyright notice everytime they were invoked. If you don’t specify your terms up front, you have nobody else to blame. So boo hoo, you fucktard. Murga chose a license antithetical to his desires and chose to add strings to the GPL in such a way that the user really wouldn’t be free to use the code as he or she sees fit but only as Murga sees fit (which gives him a bloody fucking copyright notice even for things he didn’t write). If you’re upfront and clear about your terms, like Valkonen is, others know what is or isn’t allowed.

Once I untarred and copied the full path into my .xinitrc, I was able to startx into ion3. The first thing I did was unsplit the two empty windows by killing one because 512 pixels (minus borders/padding) isn’t going to work for my browser. That was the first thing I wanted to get up and running.

I remembered from the last time I ran ion3 that F3 (run command) works similarly to dwm — type the first letter or two or more of the application you want to open and a list matching those letters pops up; tab-completion through the list will take care of the rest. I like this approach and the only reason I prefer ratmen(u) is because ratmen(u) allows me to fine tune things a bit more, e. g., customizing how apps open or close or changing them as they run (such as the mocp menu I showed as an example once before). The command menu in ion3 does allow the user to add flags/options so it’s still very flexible.

Finally, one of the things I hope to get out of using it is better handling of applications like GIMP and Skype which use too many windows. As much as I love using ratpoison, it’s clumsy and awkward when it comes to such things. I don’t consider that ratpoison’s flaw, I consider it a shortcoming of those applications which open too many windows rather than operate within one frame or doesn’t give users an option setting to manage things in one box rather than two or three or more.

I’ve just installed ion3 so I still have some editing/reconfiguring to do. I’ll probably give this a shot for a while and decide if it better suits my needs than ratpoison. I should have plenty of time this weekend to mess with it because I can’t put any weight on my ankle yet.

/etc/pam.d/login diff

July 22, 2009

I wrote late last night that I removed gdm. One of the consequences was that pam-gnome-keyring is tied to the configuration in /etc/pam.d/gdm; the standard config for console login doesn’t start it (this may be an issue if changing from gdm to other X logins like slim or xdm; I don’t know because I don’t care) so anything using pam-gnome-keyring, such as networkmanager or pgp, will prompt for passwords without using gnome-keyring (e. g., I had to manually enter my WPA passphrase to connect to my router).

As I wrote last night, I edited /etc/pam.d/login with a few lines from the gdm file in that same directory. Here’s the diff between the original file and new file.

40c40
 # @include common-auth
83,84c83,84
< @include common-session
 # @include common-session
> # @include common-password
90a91,98
> 
> @include common-auth
> auth    optional        pam_gnome_keyring.so
> @include common-account
> session required        pam_limits.so
> @include common-session
> session optional        pam_gnome_keyring.so auto_start
> @include common-password

Or, in a nutshell, I just commented out lines in /etc/pam.d/login which were duplicated with the seven lines I added. If you copy over the gdm settings and don’t comment those out, be prepared to enter your password twice at login (like I did the first time before fixing that).

Site News and Updated Packages

July 22, 2009

I set up a page (linked within My Aspire One Page) to track changes in packages I’m using or building. I’m off my feet for a few days nursing an injury so I should have more time this weekend to rebuild a few more things that have been aggravating me and to work on a few more things (like wifiroamd which I built this morning but don’t have time to set up). Depends how much I have to catch up at work since I’m taking off at least today.

I think I’m done with the aesthetics of the site for a while. I’m not so crazy about it but I wanted something a little more interesting than black text on white background but still clear and legible. I wanted a grey and blue or even black and blue theme but didn’t find one that appealed to me. Doesn’t look any different to me in elinks. I’m going to try to add more multimedia content (like video tutorials) but no time frame or immediate plans. Don’t worry, I won’t clutter the world with yet another Linux-related podcast. There are enough already and I don’t think I have any more (or less?) to add than what’s already available.

Finally, I also may merge my other two blogs into this one. I need to see if/how I can do that or if it’s not as easy as merely exporting them to files and importing them in here.

Adios gdm and WTF…

July 21, 2009

Scored another 20MB of disk space by removing gdm and various theme packages. Nothing against the crunchbang login screen and it’s not like I’m running out of space on my hard drive. I was more interested in this:

             total       used       free     shared    buffers     cached
Mem:           998         76        922          0          4         45
-/+ buffers/cache:         26        972
Swap:         2094          0       2094
Total:        3092         76       3016

I had about 20MB more RAM available without gdm, etc., even though I wasn’t yet running wireless (this is with my “bigger” 2.6.30.1 kernel). I’ll add a screenshot here:

screenshot-20090721215236

My .xinitrc is only “exec ratpoison” because my .ratpoisonrc has all my startup commands in it already. Thought everything was okay until I noticed the nm-applet icon seemed stuck on searching for the network. For the first time while using #! I was prompted to enter my WPA passphrase. Huh, what’s up with that? Hadn’t done that before at work or at home or library or anywhere else.

If something is set up between NetworkManager and gdm, that’s really fucked up. Why are all these distros spawning and thereby tying networking to X? Argh. I’m going to look for alternatives. I know there’s wicd, and I looked briefly at trying wifiroamd (but didn’t try it) while using Fedora.

About to quit ratpoison and find out if I have to enter my WPA pass again.

UPDATE: Fixed it by copying relevant lines from /etc/pam.d/gdm to the login file in the same directory, e. g., so that pam_gnome_keyring autostarts. That is a really fucking stupid way to set up something like that, IMO, but that’s how I’ve usually thought about Ubuntu (and Gnome as well) anyway.