oscartheduckin' around

It's hosted on fuckin' google!     

Photoshop 

Scripts 

 Wiki

 

11.2.07 - In a moinmoin update, it looks like the instructions below are specific to 6.10. I assume that as edgy eft was just meant to be a "break anything we need to" release, then it is somewhat fucked up. Getting it to work on Dapper is much, much simpler, a lot closer to apt-get and edit a few scripts.


I just managed to install VMWare tools on mandriva. That fucker was tough as hell, mainly because the version I installed with metisse as an environment was slow as all hell, taking fifteen or twenty seconds to display a menu and two or three seconds to delete a character. I also had never used mandriva before, and it's different to other distros in package managment in ways I didn't like.

Now, installing the vmware tools didn't help any with the slow down, but I want to document how to do it just in case I ever need to again.


To do the initial install you can just use the rpm, but vmware tools don't take until vmware-tools-config or whatever it's called is run. And that needs gcc etc anyway, so you may as well start from the beginning.


To install the build tools, you first have to enable some extra repositories. I ran the following commands:


urpmi.addmedia main ftp://mirror.cricyt.edu.ar/MandrivaLinux/official/2007.0/i586/media/main/release with media_info/hdlist.cz && urpmi.addmedia --update main_updates ftp://mirror.cricyt.edu.ar/MandrivaLinux/official/2007.0/i586/media/main/updates with media_info/hdlist.cz
urpmi.addmedia contrib ftp://mirror.cricyt.edu.ar/MandrivaLinux/official/2007.0/i586/media/contrib/release with media_info/hdlist.cz
urpmi.addmedia --update contrib_updates ftp://mirror.cricyt.edu.ar/MandrivaLinux/official/2007.0/i586/media/contrib/updates with media_info/hdlist.cz


Next it's best to do a urpmi update.  You have to specify which branch you're updating in this program, so the three commands are:


urpmi.update main

urpmi.update contrib

urpmi.update main_updates

urpmi.update contrib_updates


After this run the following:

urpmi make

urpmi gcc


And you get the build tools. Now you need kernel headers for vmware tools to work.


uname -a tells you what kernel you're running and urpmi -y kernel-sources to find the name of the kernel sources for your version.


Now urpmi kernel-source-whateverversion and you're all set to run the vmware tools install scripts.


28.1.07 - Happy new year.  I recently had cause to set up moinmoin on ubuntu 6.10, and figured I'd give you the blow by blow. Because it's not as simple as I'd like it to be, in spite of the excellent documentation on moinmoin's website.


First, get the base packages. You're looking at a simple "sudo apt-get install moinmoin-common". No problems there, then.

Now, moinmoin is python based, which is good because if it wasn't then there's no way on this fucking planet that I would've managed the install properly. See, there're a few things along the way that get mangled between apt-getting and attempting to follow the moinmoin documentation.


So, now grab the moinmoin official packages. I know, I know, you just apt-getted the binaries, but this actually seems like a necessary step.  See, moinmoin wants to have a bunch of special MoinMoin scripts installed as python packages, and this is the easiest way to get there.


Once you've grabbed the official packages, gunzip and untar 'em to your desktop. 

Locate setup.py and run it as described here. It adds all the packages to your python setup (python 2.4 is included as default on Ubuntu, I think). Remember to sudo the install command.

 Now, test whether or not that worked properly. At the command line type "python". THe prompt will change. Now type "import MoinMoin". It should just work with no weird errors at all, you just get the >>> prompt again. Hit ctrl-D to leave python.


So great, you've got the install done. Next is to alter permissions and tweak some files to get YOUR wiki instance running rather than the default. You'll appreciate the use of python as the base language here.


First, altering permissions. This is important as it changes how public your wiki is. I wanted one that only one group on my linux box could alter, everyone else was to be locked out. So, first thing I did was create a new user account to be the wiki admin. You can do this through gnome's gui tool very easily, just use that for now. 

I called my new user moinmoin and added a new group for that user called moinmoin, and my following examples assume that you do the same thing.


Now that you have the group and user IDs set up, cd into the moinmoin directory that you have; it's /usr/share/moin. Now there are a few ways to change the group recursively.  Easiest way is probably chgrp -R. So run this command:

sudo chgrp -R moinmoin ./

Now if you do an ls -l you should see that your moinmoin group (whatever it is) owns all the files and folders and whatnot.

Now do this:

sudo chmod -R 770 ./


This makes it so the owner, root, can edit everything, and anyone in the moinmoin group can edit everything, but the rest of the world can't. It's good security, unless you want to go the traditional wiki route of allowing ANYONE to edit ANYTHING in which case 777 is a good way to go.

Now, creating the wiki instance. The moinmoin documentation here is very good, so click here and follow it. If you make your wiki instance as the moinmoin user, it'll have the correct group owner automagically.

If you make a mistake here, it's most likely duplicating some directory names. My wiki is called SeventhSon, and when I checked their instructions I had a /usr/share/moin/SeventhSon/SeventhSon/[all the data], so I copied the data into the higher Seventh Son and deleted the other one.


 Almost everything is done.

 This is linux, based on unix. As such, when you want to offer a service it runs as  a constant process; think about ssh. If you want ssh to run, you set up the sshd script to run. There's a moinmoin script that needs to run in order to offer this service. Weirdly enough, I didn't notice this being mentioned anywhere on moinmoin's documentation, I found it mentioned here.

You may as well copy it into your wiki's directory, for convenience. It'll be in /usr/share/moin/server/, and it's called moin.py You can run it from wherever you see it, though.


 Almost there. If you run moin.py by entering from the wiki directory ./moin.py. You get instructions about how to access your wiki - open a browser and enter localhost:8000 as the URL to visit.


You should get an error, telling you something like:

"/org/mywiki/data doesn't exist."

 

 I managed to luck upon the way to fix this.

sudo vi /etc/moin/mywiki.py and change the data directory listed in the last line to /usr/share/moin/[yourwikiname].

Done!


24.11.06: Fucking perl. I had an error "install seems impossible" when attempting to do anything with cpan on OS X.

Okay. So here's what happened: You need to install make to do anything with perl. You install that from the Mac OS X website, you have to register as a developer which is free.

Now, I had tried to use cpan before installing make. Which meanas that it autoconfigured such that it didn't know where make was, because make wasn't installed. Once make was installed (it's the one gig Xcode file you need to install to get make) because we use text files not a dynamic registry to hold settings, cpan still didn't know make was installed.

The command in cpan to see if it knows where make is is "o conf". If there's a blank line next to make, not a thing knows where it is.

The command to change this is: o conf make "path/to/make", which on OS X looks like - o conf make "/usr/bin/male". The quotes are needed.


The error message produced here was the distinctly uninformative "NOT OKAY' and "install seems impossible". I feel better knowing these instructions are now online somewhere.

 6.11.06: I'm writing from a brand new macbook that my job purchased. My justification is that if we have two new macbooks, as we do for teachers to sign out, then I need to be able to support them in casual use. And this is the best way to learn how to support casual use.

 So far I don't know whether I like F9 better or Bonjour. Bonjour is pretty fucking awesome, but the network geek in me says that broadcasting is bad enough for a network as it is, extra chatter to do something like configure a printer when you can do it so easily either way is ridiculous. But it's still nice to just have a printer configure itself automatically.

I'm trying to ctrl-shift-backspace through my tabs and it isn't working. I have to remember to create new tabs through the use of the magic apple key. And the chiclet keyboard is a little wide spaced, though ultimately very comfortable.  

Huh, ctrl-shit-tab works fine, though getting used to apple-c for copy is odd. Anyway, I'm looking to go in for the CCIE in about six months time. Weird, after making the hyperlink all text became selected automagically.

Anyway, I taught my phishing class today. It went well; scared the shit out of 'em when I discussed phishing 2.0. Try looking it up: its a basic man-in-the-middle attack with a twist.

 

20.10.06: I'm rewriting permalias from scratch to do things properly. I don't like the setup script; something this simple shouldn't need a setup script.

It occured to me today that we might think of computer administrators as Windows Enablers. I help people run windows, much as I grump about it behind their backs; if I were to suddenly stop supporting it and tell people they needed to fix it on their own, I'm sure that they might start to realise that the opinion that it's a piece of shit OS that's harder to fix than it needs to be is born of bitter experience.

 Beyond that insight, not too much. I've been having fun drawing a comic about a glass of water which is a pyschologist. It has a Calvin and Hobbes-esque dance scene which was neato to draw. 

 

08.10.06: I just got back from twenty four hour comics day. Check out some of the Ninja blog action that was occuring:

 

http://www.24hourcomics.com/blog/?p=460

http://www.24hourcomics.com/blog/?p=457

Hopefully some of the many many other photographs that were taken will eventually make their way online. If not, there was discussion of a CD with the photographs being distributed; that'd be fun.

 

I wrote about poetry, programming and dreaming. I vaguely remember starting with pages about python, relating some stuff about a dream I had in which a spoken word guy spoke butterflies as poems, and going forwards from there. I eventually visited some of the recurring dreams I've had, some of the recurring issues-with-understanding-programming and some fun poetry goofin'.

 

I believe I succumbed to the full-page-spread three or four times in order to stay caught up. At least two of these were extraordinarily cheap and unsatisfying, especially as it turned out that I finished all twenty four pages (drawing and writing) in about 19 hours, and that after that I couldn't ink it. I mean, I tried to ink it, but I started falling asleep and imagining that instead of letters I had small flower pots and aliens to ink and screwing up the lettering.


I had that cool thing again where you're not productive at all and then suddenly from 9pm until about 1am you're rolling and jamming and having a great time just being productive and then suddenly WHAM! brick fucking wall.  Overall, fun times.


 

05.10.06: Writing permaliassetup.py so that it's all nice and automated. I suspect it'll require cleaning the code up a fair bit, putting stuff into functions. No real problem.

What's nice and frustrating simultaneously is that this isn't the right way to do this. I should just write a two or three line shell script or a one or two line perl script to do the same job, but it's good to kick the dust out of my python. Hopefully I'll eventually get the python code down to somewhere in the region of five to ten lines; right now it's way too big.

Added a wiki. No password needed, just click the "edit this page" link. It also has a discussion feature if you like posting to chat boards instead of wikifying your life.


01.10.06: Added permalias script with a disclaimer.

01.10.06: I had a good weekend. It was spent writing python scripts, which I'll put up here soonish. Chillaxin', as some might claim.


It turns out that the problem of writing a permanent aliaser script is actually a little more puzzling than it could be, but only if you're a confused bee. My original script for it was a simple shell script that worked pretty well. It accepted input as:

permalias foo="'bar'"

  And then appended:

alias foo='bar'

to the .bashrc file, which works nicely. The only issue is that you have to reload bash to access the new alias; simple as typing bash on the command line, but more of a pain than I wanted. I should probably have just added a line to the script to do it automatically, but I only just thought of that.


Either way, the new python script does things very differently. I wanted a directory called scripts which would house the actual permalias files, and a directory called .permalias which would house shortcuts to the files. This way, if I want to change the code that's run, I don't need to rename things or anything. I added .permalias to the $PATH by putting:


export PATH=$PATH:/home/james/.permalias

 

in my .bashrc.

The script accepts input in a nice interactive way. You call the script by typing permalias at the command line. It asks you what you want to call your command; for example, I like to have bye as a permanent alias for sudo shutdown -h now, so here I type in bye. Then it asks for the command, so I put in sudo shutdown -h now.

 

The script creates a file in scripts called bye. It creates a symlink called bye in .permalias. Inside of bye, it puts the line sudo shutdown -h now.  It changes the permissions on the bye file in scripts to 755, so that everything will run, and that's that, all finished. 


My problems writing it all stemmed from the fact that I was used to the bash script. So I was writing in the bye file in scripts alias bye='shutdown -h now'.  So when bye was run, bash was being told to create an alias for something that already existed in $PATH, so it would create the temporary alias but nothing else. If you ran the command, it seems to have visited the .permalias folder before running bye from wherever it stores temporary aliases, so it would recreate the alias, which it had already done. It had the net effect of doing nothing.


Anyway, I'll post permalias to scripts soon; if I had my laptop turned on at home I'd log into it and post it now, but no biggie. The only real concern with posting it publicly is that it was written for my computer using absolute paths; I'll have to see what python's relative path support is like.