Archiv

Archiv für die Kategorie ‘HowTos’

HowTo: Add Google Analytics tracking to your Wordpress blog

23. Oktober 2007 Keine Kommentare

Hi folks !

Maybe some of you guys are running a little Wordpress blog, like this one, too.
And maybe you also wondered, if it ist possible to integrate the sweeeet website-traffic analyzing and reporting service by google, called “Google Analytics” into your blog.

Easy !

Just download the “Ultimate Google Analytics” plugin-package from спални комплектиthe Wordpress plugins page and unzip it to th plugins directory in your wordpress installation. Let’s try it…

cd /tmp
wget http://downloads.wordpress.org/plugin/ultimate-google-analytics.zip
cd /var/www/blog.chaoz.org/wordpress/wp-content/plugins/
unzip /tmp/ultimate-google-analytics.zip

Now you just have to activate the plugin in your wordpress plugins section and you will get a new menu-item in your optins menu name “Ultimate GA”. There you have to add your google-analytics ID which looks somewhat like “UA-1234567-8″. Look it up in the javascript snippet which is shown in your google analytics account for the domain-profile in question.
I just sticked to the default options which where already set quite reasonably, I guess.

Done !

That’s right. You’re finished. Pretty easy, eh?
Now, you’ll just have to be patient and wait for the first reports to show up in your google-analytics account after some hours and visits.

cheers

~ Gerrit

KategorienHowTos Tags:

Use aliases to ease your (linux) life…

9. Juli 2007 2 Kommentare

Using aliases on linux can really save you some time and hassle.

If you have to type some more complex commands quite frequently, you should consider building some aliases for them.
I always load a set of basic aliases via an include in my ~/.bashrc :

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

On Ubuntu distros ~/.bash_profile will include ~/.bashrc where the real action takes place. Might be different on other distros though.

Now, here are some of the aliases I use day by day and which really save me some time. (Of course I obfuscated users and Ips a bit… )

alias ll='ls -hals --color=auto'

-> coloured dir-listings with all the details

alias l='ls -hls --color=auto'

-> same, but without hidden files

alias upgrade='sudo aptitude update && sudo aptitude dist-upgrade'

-> completely upgrade whole system to latest version; should work on ubuntu and debian based distros

alias ports='netstat -tulpen'

-> lists open/used ports without too much details

alias sp='ps faux|grep -v grep|grep -i'

-> if you provide a string as an argument to the command, it´ll grep for it in the output of ‘ps faux’

E.g.:

[12:36:37][gerrit@neuromancer:~]$ ps faux|grep -v grep|grep -i ssh
gerrit    5879  0.0  0.0   4424   544 ?        Ss   09:51   0:00          _ /usr/bin/ssh-agent /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/startkde
gerrit    5880  0.0  0.0   4424   944 ?        Ss   09:51   0:00          _ /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/startkde
root      5127  0.0  0.0   5268   984 ?        Ss   09:51   0:00 /usr/sbin/sshd

versus

[12:34:28][gerrit@neuromancer:~]$ sp ssh
gerrit    5879  0.0  0.0   4424   544 ?        Ss   09:51   0:00          _ /usr/bin/ssh-agent /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/startkde
gerrit    5880  0.0  0.0   4424   944 ?        Ss   09:51   0:00          _ /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/startkde
root      5127  0.0  0.0   5268   984 ?        Ss   09:51   0:00 /usr/sbin/sshd

Also nice for quick ssh-logins:

alias server1='ssh user@192.168.0.1'

-> if you´ve also implemented public-key authentication, this is going to be a one command login :-)

alias ovpn='sudo openvpn --config /etc/openvpn/configfile.conf'

-> start openvpn-client with certain config-file

alias mntfs='sshfs user@192.168.0.1:/ /mnt/fs'

-> mount your fileserver´s home-dir to your local filesystem via sshfs

This one is nice, too:

alias bru='ssh -X user@obelix 'bru-server''

It performs a ssh login to my company´s backup-server with activated Xserver redirection and spawns the backup-program´s admin-console on the remote server. The gui output is then redirected to my local Xserver.

I hope you got the hang of it. Possibilities are endless :-)

KategorienHowTos Tags:

HowTo: Use Envy to install the latest ATI fglrx driver on Ubuntu Gutsy (testing)

2. Juli 2007 Keine Kommentare

Since I´m a pretty lazy bastard, I use Alberto Milone´s very helpful little tool “Envy” to install the latest ATI fglrx driver on my two laptops which are already running Ubuntu Gutsy. (Of course I´m wiser now and next I time I´ll go for Nvidia if the choice is up to me)
It´s a pretty simple and dirty little hack, but it does the trick until Alberto adds “real” support for Gutsy. :-)

After having installed the latest version you just have to edit line 89 in /usr/share/envy/instun/classes.py and change

elif self.details['osname'] == 'feisty':#SUPPORT FOR FEISTY

to

elif self.details['osname'] == 'gutsy':#SUPPORT FOR FEISTY

Now you can start Envy and it should work like a charm.

cheers

~ Gerrit

KategorienHowTos Tags:

HowTo: Set up the openfire (ex wildfire) jabber-server on debian

27. Juni 2007 2 Kommentare

In case anyone of you nerds out there ever wanted to run an own jabber server: This is a quick guide on how to set up the openfire (formerly known as wildfire) jabber-server on debian etch with mysql as the datastore-backend.

I assume that you have a working installation of the Java-VM somewhere on your machine. The openfire startup-script searches for a JVM in some common places on your system like /usr , etc. If you have a custom installation like I have, you should put the JAVA_HOME variable in your shell-environment.

  1. Download the most current package from the Ignite Realtime site.
    The version I refer to in this guide is openfire 3.3.2
  2. Unzip the package to a folder where you want the installation to live in. In my case this is /opt

    cd /opt
    tar xzvf openfire_3_3_2.tar.gz

    This will create the subfolder “openfire”.

  3. Now you should create a non priviledged user and group the service will use to run as and assign him the base-dir of the openfire installation as homedir:
    groupadd jabber
    useradd -d /opt/openfire -g jabber jabber
  4. The home-dir should also be owned by the newly created user and group:
    chown -R jabber:jabber /opt/openfire
  5. Create a mysql-database for openfire:
    mysql -u root -p yourmysqlrootpw
    create database jabber;
    grant all on jabber.* to jabber@localhost IDENTIFIED BY "pwfornewuser";
  6. Change to the new user and start the server:
    su - jabber
    cd /opt/openfire/bin
    ./openfire start
  7. Now, if you run
    netstat -tulpen

    you should see a java-process listening on ports 9090 and 9091 after a few moments.
    Server up and running.

  8. To set up the basic configuration, you have to open the admin-interface in your browser:
    http://<iporhstnameofyourjabberserver>:9090
  9. The basic setup is pretty staight forward. You have to choose a language setting, provide the connection-string (e.g.: jdbc:mysql://127.0.0.1:3306/jabber) and user+password for your mysql-db, a password for the admin-account of openfire and that´s it.
  10. Of course you also have to make sure that the ports 5222 and 5223 (for ssl client-connections) are not firewalled since then you won´t be able to connect your client to the new server :-) For server to server connections and file transfers you also need to open port 5269 and 7777. Server to server connections are necessary if you want to be able to communicate with people who are not logged on to your jabber-server.

If I find time, I might add some screens in the next couple of days.
If you have any questions or like to comment, feel free to do so :-)

cheers

~ Gerrit

KategorienHowTos Tags: