AuthImage Hack with WordPress 1.0.2

October 28th, 2004 18:16 by Martin

As I have been blogspammed alot lately, I installed a nice hack by Gudlyf to avoid this. It was a bit tricky, but I would like to report that I got WP AuthImage Hack (v1.3.3) working with WordPress 1.0.2 by modifying a few things (see the README.txt first…):
As the _e() and __() functions are not declared in WP 1.0.2, just use echo instead of _e , and write

die('Error: xyz.');

instead of

die( __('Error: xyz.') );

Also (very important if you’re using wp-style-switcher), in authimage.php require the file authimage-hacks.php directly like this:

<?php
define('ABSPATH', dirname(__FILE__).'/');
require_once(ABSPATH . 'authimage-hacks.php');
createCodeImage();
?>

instead of requiring it through my-hacks.php (because wp-style-switcher.php which is required in my-hacks.php uses functions.php and you’ll get a non-object error or something…)

Keyboard layouts in Fedora Core 2 and KDE 3.2

September 7th, 2004 17:01 by Martin

A post by a nice guy called “Leon” helped me out when I had problems with my keyboard layout in Fedora Core 2. There’s a bug, that prevents KDE Control Panel to find the keyboard layouts, but it can easily be fixed by doing a simple

ln -s /usr/X11R6/lib/X11/xkb/rules/xorg.lst \
/usr/X11R6/lib/X11/xkb/rules/xfree86.lst

and restart kcontrol. Thanks Leon, now I can use the “nodeadkeys” option :)

ObexNote: A linux bash script for sending notes to mobile phones with obexftp (IR, BlueTooth)

July 14th, 2004 14:01 by Martin

Thought I’d share a little script I’ve made for sending notes (.vnt files) to my Sony Ericsson T610 in Linux. I expect this to work with all phones that support notes (i.e. BEGIN:VNOTE … END:VNOTE), and that can be accessed throught obexftp (or with a simple hack any other linux command, for example ‘btctl’).

The script is totally free and can be downloaded here:
ObexNote version 0.31

Please report success, bugs, problems or suggestions by giving a comment. Enjoy!

A quick’n'dirty CVS how-to

June 18th, 2004 18:22 by Martin

This will get you going:
Add to .bashrc on on the server where the cvs repository should be located:

export CVSROOT=$HOME/cvsroot

Make changes active:

source .bashrc

Of course, also make this directory:

mkdir ~/cvsroot

Register the repository:

cvs -d ~/cvsroot init

Add some project to the repository. For example, if you write a paper in LaTeX, and have alot of files in som dir (~/paper) including .log, .ps … do the following:

cd ~/paper
mkdir tmp
cp *.tex tmp
#cp (all other files to be included in the project) tmp
cd tmp
cvs import papername papername start

(yes, it says papername two times, the last is for the “vendor tag” which is required)
Remove the temporary folder:

cd ~/paper
rm -rf tmp

Your original paper folder should now be moved to backup, and as a first-timer, you should maybe make a ~/cvswork folder to work in and checkout from cvs:

mkdir ~/cvswork
cd ~/cvswork
cvs checkout papername
#cvs co papername #< - short for checkout
cd papername
emacs papername.tex

(write som breathtaking fantastic stuff and save)
Commit the changes back to the cvs repository:

cvs commit

Just keep the files in place, and the next morning get up to date with:

cd ~/cvswork/papername
cvs update

(Another reason for making a ~/cvswork directory is that i you have alot of projects in that folder, you can update them all by simply writing ‘cd ~/cdwork’ and cvs update’. This will update all projects).

Now, lets say you also have a laptop. Set it up according to this (of course, first set it up with ssh-keys to avoid annoying questions about your password…):
Add to your ~/.bashrc:

export CVSROOT=’username@your.server.com:/full/path/to/cvsroot’
export CVS_RSH=ssh

Make changes active:

source .bashrc

Make a ~/cvswork

mkdir ~/cvswork

Check out your project:

cd ~/cvswork
cvs co papername
cd papername
emacs papername.tex

Commit changes back to the repository on the server (IMPORTANT):

cvs commit

Add a file to your project by “cvs add filename”. For example, create a file ‘.cvsignore’ with the following content:

*.log
*.ps
*.pdf

put it in ~/cvswork/papername add it to your project:

cd ~/cvswork/papername
cvs add .cvsignore
cvs commit

If set up correctly, you should be able to do most cvs related stuff from within emacs, for example to commit/update, just press ‘C-x v v’ (vc-next-action)
Remember, if you add a complete directory to cvs, you should always do a ‘cvs co projectname’ in the parent directory to make it a real cvs workplace for emacs to recognize.

Apt for Fedora

April 22nd, 2004 14:02 by Martin

Using Apt in Fedora Core 1 (i.e. apt-get) and configure it to use a norwegian server:

Install apt:

$ wget ftp://ftp.uninett.no/linux/Freshrpms/ayo/\
fedora/linux/1/i386/RPMS.freshrpms/apt-0.5.15cnc3-0.1.fr.i386.rpm
$ rpm -Uvh apt-0.5.15cnc3-0.1.fr.i386.rpm

Use uninett as mirror:

$ mv /etc/apt/sources.list /etc/apt/sources.list.orig
$ wget -q -O- ftp://ftp.uninett.no/linux/apt/\
sources.list-fedora-1 > /etc/apt/sources.list
$ wget -q -O- ftp://ftp.uninett.no/linux/apt/\
sources.list-fedora-1-freshrpms >> /etc/apt/sources.list

Get the list over available packages:

$ apt-get update

Update the system:

$ apt-get dist-upgrade

Install a package:

$ apt-get install packagename

Example:

$ apt-get install emacs

(thank you Terje R.)

Linux weblog

March 22nd, 2004 16:50 by Martin

This is the linux category. Only english posts and comments will be accepted here. Feel free to come with comments or requests.

(linux, Fedora Core 1, how-to, solution, problem, redhat 9.0…)