My Wild Bloggie Blog .::Linux Edition::. - errrr I think...

About

An eerie look into my deeply reclusive mind.

Categories

General
Linux
Books

Free SubDomain Names
Free DNS

My Amazon Store
Arch Technologies
My CV Site
Pamela's Website
Pamela's Diary

Calendar

« January 2009
S M T W T F S
        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 31

Archives

01 Apr - 30 Apr 2006
01 Jun - 30 Jun 2006
01 Jul - 31 Jul 2006
01 Aug - 31 Aug 2006
01 Feb - 28 Feb 2007
01 Jul - 31 Jul 2008

Statistics

Total visits: 4636
Unique visitors: 3329
This month: 65
This week: 65
Today: 4

Override GTK Theme - 17 July 08 - 00:07

If it can be done in windows (WindowBlinds) in surely can be done in Linux.  Of course you can, only after a 10 min Google search did I come across exactly what I was looking for, here.

Override what ever theme your running for another on an application basis.

  • Create a file called, 'cleartheme'
  • chmod +x cleartheme

   1: #!/bin/bash
   2: # lauch a gtk application with a different theme
   3: # set GTKRCFILE variable to your favourite theme
   4: GTKRCFILE=Clearlooks
   5: GTK2_RC_FILES=/usr/share/themes/"$GTKRCFILE"/gtk-2.0/gtkrc "$@"

In this case I was overriding NotXP GTK theme because of some sort of colour bug with OpenOffice.  Personally I wouldn't be seen dead with Luna running on my desktop, Windows I can live with, Luna hell no!  But for my sister who needs that familiar feeling, making Ubuntu look like XP becomes a sort of necessary evil.  Even though I wouldn't have it running on my desktop I have to say I'm fairly impressed at the result, completely automated thanks to a nifty bash script as well.

If you have that friend or family member who needs a helping hand to move away from the dark side, you can get the stuff here, or the direct package here.  If you do, you'll need the script above as well to fix OpenOffice.  Just extract and run InstallXpGnome.sh how easy is that...

Birkoff - Linux - No comments / No trackback - §


Disable Suspend & Hibernation in Ubuntu - 16 July 08 - 19:20

For longest time now I've been wanting to know how to disable this but never actually got round to finding out... Installing Ubuntu on my sisters laptop has forced my hand... Quite frankly I don't like them, if it's using power it's not saving power.

SWITCHED OFF is the best power saving you can get!

Anyway, found it here.

  • Press Alt+F2 (Run Box)
  • Type gconf-editor and Press enter
  • Browse to gnome-power-manager > general
  • uncheck can_hibernate & uncheck can_suspend

Birkoff - Linux - No comments / No trackback - §


How to disable creation of some_file~ files - 03 February 07 - 22:40

Something that's been bugging me for a wee while...

Applications -> System Tools -> Configuration Editor

/ -> apps -> gedit-2 -> preferences -> editor -> save -> create_backup_copy (Unchecked)

Birkoff - Linux - No comments / No trackback - §


Installing Trac on Dreamhost - 11 August 06 - 01:49

Assumptions

This guide was made primarily to help DreamHost customers setup Trac. However, the setup is generic enough, that with only little modification, this guide can be applied to any shared-hosting setup running the Apache webserver. To work, you will need access to shell, and have basic understanding of text editing in shell. Dreamhost provides python2.3, and easy subversion setup - so these are assumed to already be in place.

Also, because I do not like the login hack described on the DreamHost Trac Wiki, I have assumed that you will install one of the login plugins. However, if you have access to the Apache setup file and do not wish to use a login manager, you can use the account setup method outlined in the Trac wiki.

Python

I found installing a local copy of python to be unnecessary, as the extra modules can be installed in the trac's lib path. To assure access to these libs, the PYTHONPATH environment variable must reference the aforementioned path.

Environmental Variables

  • Add this to ~/.bash_profile:

    export PYTHONPATH="$HOME/packages/lib/python2.3/site-packages" export LD_LIBRARY_PATH="$HOME/packages/lib" export PATH="$HOME/packages/bin:$PATH"
  • source ~/.bash_profile

Installation

Setup

I recommend making a special directory for the install files and packages; this makes it easier to manage, and you can delete the entire directory of install files at the end. I used ~/packages and ~/install_files personally, and will be using them throughout these instructions - so if you want to use another directory, just replace all references.

  • cd
  • mkdir install_files
  • mkdir packages
  • mkdir trac_sites

Install Trac (0.9.6)

  • cd ~/install_files
  • wget http://ftp.edgewall.com/pub/trac/trac-0.9.6.tar.gz
  • tar zxf trac-0.9.6.tar.gz
  • cd trac-0.9.6
  • python setup.py install --prefix=$HOME/packages

Install Clearsilver (0.10.3)

  • cd ~/install_files
  • wget http://www.clearsilver.net/downloads/clearsilver-0.10.3.tar.gz
  • tar zxf clearsilver-0.10.3.tar.gz
  • cd clearsilver-0.10.3
  • sed -i "s@/usr/local/bin/python@/usr/bin/env python@g" scripts/document.py PYTHON_SITE=`/home/{username}/packages/bin/python -c "import sys; print [path for path in sys.path if path.find('site-packages') != -1][0]"` ./configure --with-python=/home/{username}/packages/bin/python --prefix=$HOME/packages --disable-ruby --disable-java --disable-apache --disable-csharp --disable-perl
  • make
  • make install

Install SQLite (3.3.6)

  • cd ~/install_files
  • wget http://www.sqlite.org/sqlite-3.3.6.tar.gz
  • tar zxf sqlite-3.3.6.tar.gz
  • cd sqlite-3.3.6
  • ./configure --prefix=$HOME/packages
  • make
  • make install
  • ln -s $HOME/packages/bin/sqlite3 $HOME/packages/bin/sqlite

Install PySQLite (2.3.2)

  • cd ~/install_files
  • wget http://initd.org/pub/software/pysqlite/releases/2.3/2.3.2/pysqlite-2.3.2.tar.gz
  • tar zxf pysqlite-2.3.2.tar.gz
  • cd pysqlite-2.3.2
  • In setup.py, change
    include_dirs = [] to include_dirs = ['$HOME/packages/include']
    and
    library_dirs = [] to library_dirs = ['$HOME/packages/lib']
  • python setup.py build
  • python setup.py install --prefix=$HOME/packages

Install SWIG (1.3.29)

Install Subversion (1.3.2)

  • cd ~/install_files
  • wget http://subversion.tigris.org/downloads/subversion-1.3.2.tar.gz
  • tar zxf subversion-1.3.2.tar.gz
  • cd subversion-1.3.2
  • ./configure PYTHON=/usr/bin/python --prefix=$HOME/packages --with-swig=$HOME/packages/bin/swig --without-berkeley-db --with-ssl --with-zlib
  • make
  • make install
  • make swig-py
  • make install-swig-py
  • cd ~/packages/lib/python2.3/site-packages
  • echo $HOME/packages/lib/svn-python > subversion.pth
  • ln -s ~/packages/lib/svn-python/libsvn
  • ln -s ~/packages/lib/svn-python/svn
  • Test it with python -c "from svn import client" (No errors should result.)

Setup Trac Environment

  • trac-admin $HOME/trac_sites/{your trac project id} initenv

    ("{your trac project id}" can be anything you like. Putting all your Trac environments in your trac_sites directory allows for simpler backup!)

    You will be asked for

    • Project Name: {Whatever you want}
    • Database connection string: {Accept the default (just hit return)}
    • Path to repository: /home/{yourusername}/svn/{your svn project id}
    • Templates directory: {Accept the default (just hit return)}
  • trac-admin $HOME/trac_sites/{your trac project id} will put you into interactive mode. You can issue a simple help at the prompt to see what you can do. There are lots of administrative actions in interactive mode that can make your life a little easier than it would be if you always had to go through the WebAdmin interface.

    You should add at least one user with admin powers. To do this, in interactive mode:

    • permission add admins TRAC_ADMIN
    • permission add {username} admins
    • exit (to quit interactive mode)

    During interactive mode, permissions list should show the new users on the list.

Make Trac Web Accessible

  • cd ~/{my.domain.name}
  • Make index.cgi (make sure to set the permissions so the webserver can read it - 775):

    #!/bin/bash export HOME="/home/{username}" export TRAC_ENV="$HOME/trac_sites/{your trac project id}" export PYTHONPATH="$HOME/packages/lib/python2.3/site-packages" export PATH="$HOME/packages/bin:$PATH" export LD_LIBRARY_PATH="$HOME/packages/lib" exec $HOME/packages/share/trac/cgi-bin/trac.cgi
  • and index.fcgi (make sure to set the permissions so the webserver can read it - 775):

    #!/bin/bash export HOME="/home/{username}" export TRAC_ENV="$HOME/trac_sites/{your trac project id}" export PYTHONPATH="$HOME/packages/lib/python2.3/site-packages" export PATH="$HOME/packages/bin:$PATH" export LD_LIBRARY_PATH="$HOME/packages/lib" exec $HOME/packages/share/trac/cgi-bin/trac.fcgi
  • Then set the default by editing .htaccess:

    DirectoryIndex index.cgi You can change this to index.fcgi once you have everything setup. (Fcgi is faster, but you won't notice changes until a day later.)

Prettiness

Pretty URLs

Setup static mapping

This allows the common static files (images, CSS, javascript, etc) to be accessed directly, rather than mapping through the cgi script. (This makes Trac faster, while providing compatibility with the prettiness.)

  • cd ~/{domain name}
  • mkdir chrome
  • ln -s $HOME/packages/share/trac/htdocs ./chrome/common
Setup Rewrite Rule

Edit .htaccess located in the {domain name} directory DirectoryIndex index.cgi Options ExecCGI FollowSymLinks <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.cgi/$1 [L] </IfModule> This will prefix any failed request with index.cgi (to run it through Trac).

Hack the Trac base_url

This sets any links Trac generates to start from the base, rather than the file that processed the generation. (/whatever, instead of index.cgi/whatever)

  • cd $HOME/packages/lib/python2.3/site-packages/trac/web
  • Backup the original cgi_frontend.py in case you want to revert. cp cgi_frontend.py cgi_frontend.py.backup
  • Edit cgi_frontend.py, change
    self.cgi_location = self.__environ.get('SCRIPT_NAME')
    to
    self.cgi_location = os.path.dirname(self.__environ.get('SCRIPT_NAME'))

Plugins

Setup Tools

We'll be using this to install the other plugins; so it is necessary to install this to follow my steps.

  • cd ~/install_files
  • wget http://peak.telecommunity.com/dist/ez_setup.py
  • python ez_setup.py --prefix=$HOME/packages

WebAdmin Plugin

  • cd ~/install_files
  • wget http://trac.edgewall.org/attachment/wiki/WebAdmin/TracWebAdmin-0.1.1dev_r2765-py2.3.egg.zip?format=raw
  • easy_install --prefix=$HOME/packages TracWebAdmin*
  • Now tell trac to load the plugin by editing $HOME/trac_sites/{your trac project id}/conf/trac.ini and adding to the components section: [components] webadmin.* = enabled

AccountManager Plugin

NOT COMPATIBLE WITH DbAuth

This will make the htpasswd login method much more pleasing. New users can register on their own using the site, and they can change their passwords if necessary. This also allows login via form, rather than the HTTP authentication.

  • cd ~/install_files
  • svn co http://trac-hacks.org/svn/accountmanagerplugin/0.9
  • mv 0.9 accountmanagerplugin
  • cd accountmanagerplugin
  • python setup.py bdist_egg
  • cd dist
  • easy_install --prefix=$HOME/packages *.egg
  • You must add an initial user, to create the initial trac.htpasswd file:
    htpasswd -c ~/trac_sites/trac.htpasswd {username}
    You'll then enter the password twice.
  • Now tell trac to load the plugin by editing $HOME/trac_sites/{your trac project id}/conf/trac.ini and adding to the components section: [components] trac.web.auth.LoginModule = disabled acct_mgr.* = enabled [account-manager] password_format = htpasswd password_file = /home/{your username}/trac_sites/trac.htpasswd

DbAuth Plugin

NOT COMPATIBLE WITH AccountManager

Makes more sense than the normal login method. However it does not support new user registration like AccountManager, rather, you are required to enter all users in manually using sqlite. Because of this, I use AccountManager instead.

  • cd ~/install_files
  • svn co http://www.trac-hacks.org/browser/dbauthplugin
  • cd ./dbauthplugin/0.9
  • python setup.py bdist_egg
  • cd dist
  • easy_install --prefix=$HOME/packages *.egg
  • cd ../install
  • cp dbauth.db ~/trac_sites
  • chmod 775 ~/trac_sites/dbauth.db
  • Now you need to add some users; you'll have to do this manually. You'll probably want to add the same username(s) as you setup earlier.
    • sqlite ~/trac_sites/dbauth.db
    • INSERT INTO trac_users VALUES ('all', 'username', 'passwd', 'email@email.com'); INSERT INTO trac_permissions VALUES ('all', 'username', 'admins');
    • .quit
  • Now tell trac to load the plugin by editing $HOME/trac_sites/{your trac project id}/conf/trac.ini and adding to the components section: [components] trac.web.auth.* = disabled dbauth.* = enabled #trac.userdir.* = enabled # only if you want to use this [central] database = /home/{your username}/trac_sites/dbauth.db envroot = /home/{your username}/trac_sites/{your trac project id}

Cleanup

Now that you have everything setup the way you want, you can go ahead and delete all those setup files, and switch to fast_cgi

Delete setup files

Since you won't be using those setup files after you're done, if you don't want all those setup files to take up hard drive space, you can delete them.

  • cd
  • rm -rf install_files

Switch to fcgi

If you are using 'Pretty URLs'

Change .htaccess to direct to index.fcgi, rather than index.cgi: DirectoryIndex index.fcgi Options ExecCGI FollowSymLinks <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.fcgi/$1 [L] </IfModule>

Otherwise

Just change the .htaccess DirectoryIndex to index.fcgi DirectoryIndex index.fcgi

References

Birkoff - Linux - No comments / No trackback - §


HOWTO Convert carriage returns between UNIX and DOS on Debian - 31 July 06 - 11:18

The convert carriage returns between UNIX- and DOS-kind of CR, use the tools dos2unix and unix2dos from the sysutils package.

Usage is really simple:
$ dos2unix filename
or
$ unix2dos filename

where filename is the name of the file to convert.

To convert a hierarchy of files starting from current directory:
$ find . -type f -exec dos2unix {} ;

Got this from http://glasnost.beeznest.org/articles/203.

Birkoff - Linux - No comments / No trackback - §


Drop-Down Menus - 06 June 06 - 10:52

I've came across a very graceful css / javascript to implement Vertical & Horizontal Drop-Down Menus by Nick Rigby. (Had it for ages, just don't want to loose it!!!)

Drop-Down Menus, Horizontal Style: Pt 3

Compatibility

This menu has been fully Tested using the following browsers:

* Please note, as per previous versions of the menu, the small amount of JavaScript is required for the menu to function in Internet Explorer

Vertical Drop-Down Menu Example
Horizontal Drop-Down Menu Example

Birkoff - Linux - No comments / No trackback - §


Refresh Font Cache - 05 June 06 - 01:10

Refresh Ubuntu's font cache
sudo fc-cache -f -v

Birkoff - Linux - No comments / No trackback - §


HOWTO: Change login splash - 27 April 06 - 02:21

Example :



sudo apt-get install gnome-splashscreen-manager


Source

Birkoff - Linux - No comments / No trackback - §


HOWTO: Install cursor themes on ubuntu/gnome - 27 April 06 - 02:18

Example :



sudo apt-get install gcursor


Source

Birkoff - Linux - No comments / No trackback - §


HOWTO: Change GTK Themes and icons for root applications - 27 April 06 - 02:02

Example :



sudo ln -s /home/<insert your username here>/.themes /root/.themes
sudo ln -s /home/<insert your username here>/.icons /root/.icons
sudo ln -s /home/<insert your username here>/.fonts /root/.fonts


Source

Birkoff - Linux - No comments / No trackback - §