All entries for June 2007

June 27, 2007

Music Server (2)

As far as I can tell, Lamby’s simplified script can be implemented in pretty much one line of perl:

use LWP::UserAgent;
$ua->post(“”,Content_Type=>”form-data”,Content=>[upload=>[$_]]) for @ARGV;

Of course, this is fine for enqueuing files from the command line, however, using it as a plugin for thunar/nautilus/konqueror requires one to be able to take a list of files and/or folders, which motivated my original suggestion. The previous script was hax however, with respect to the getting of inner files from a folder, which is primarily down to my terrible perl knowledge. Dear lazyweb…..

June 26, 2007

Music Server

Bucko has written a music server for compsoc LANs, which is quite useful. You add songs to it via a very simple http post method. At the last LAN I wrote a few bits and bobs to make it integrate better with Modern Desktops, rather than having to upload songs once at a time via a web page.

I have a script that takes a list of commandline arguments that are either files or directories and then just uploads them all. Please note that you should use this to spam your entire music directory at the server, just to allow uploading an album one go, rather than loads of seperate files. Note the ip address is hard coded to avoid lookup issues. You want to put this somewhere in your path.

There is also an addition to the Thunar send-to menu that script that allows one to simply right click and send to for a list of files/folders. Same caveat about spamming the music server applies here. You want to put this at ~/.local/share/Thunar/sendto .

Due to FDO standards the same send to plugin should work fine in nautilus or Konqueror, however, I have not tried this and you use at your own risk.


June 09, 2007

Pro C is Pro

There was a discussion of how to lock down the compsoc gaming account, such that programs such as firefox couldn’t simply execute arbitrary files which they have downloaded. A suggestion brought to the table by Bucko & Fred was to simply use LD_PRELOAD to stop the necessary syscall being made. So after failing at tower defense and hero defense until gone 4am, I felt like trying something which firstly seemed to suit my skillset better and also achieve something more productive. The whole thing worked within about 20 minutes, which I attribute to google and C being quite good for this kind of thing. Here’s some code:

#include <stdio.h>

int execve(const char *filename, char *const argv [],char *const envp[]) {
printf(“in your syscalls, stopping your execs\n”);
return -1;

If you want to compile this, try pasting into ‘noexec.c’ and then running …

gcc -fPIC -shared -o noexec.c

... now, compare the output between …

bash -c ‘exec ls -l’

... and …

LD_PRELOAD=./ bash -c ‘exec ls -l’

Realising how easy that was, brings many possibilities to the table, and I’m sure someone else has done them before, but its open my eyes somewhat.

a. dtrace implemented in userspace
b. implementing a security manager, similar to the one java has, but for arbitrary executables
c. hilarious comedy
d. FUSE in userspace (Bucko suggested this and he’s bloody right – does FUSE need to be a kernel module?)

June 2007

Mo Tu We Th Fr Sa Su
May |  Today  | Jul
            1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30   

Search this blog



Most recent comments

  • Apart from the plea "can I have your old one?" (the yearning never diminishes) I'd like to leave you… by Sue on this entry
  • Unfortunately I still haven't seen a film for which you have to read up on quantum mechanics as I mi… by Sue on this entry
  • I've never been to watch a film before when it's been recommended that you first read up on quantum … by Sue on this entry
  • Well this is very interesting, i really liked reading this blog, this was very informative and very … by Mio Navman Spirit S300 on this entry
  • I thought it was fascinating. Griffin isn't like any other, media–trained, polished politician, and … by Tim on this entry

Blog archive



Not signed in
Sign in

Powered by BlogBuilder