Archive for category Web

Taking a break…

Isn’t it funny how much we rely on the interet. I have my email, twitter and facebook setup on my phone and all the pc’s I use, just in case I miss something. It has started taking up a lot of time, I have hardly had any time for myself.

So, I’ve decided that for the next couple of weeks I’m going to disconnect myself from that world, unfortunatly I can’t disconnect completely from the internet due to my work. But I can close down chat clients, and the like.

Here’s to the next couple of weeks, hopefully something good comes from it, catch y’all on the other side. And I will try and blog more, havn’t really had a chance to learn anything new recently, hence this decision :)

Love you all, C

PS. If you need to get hold of me, pop me a mail or sms, or leave a comment below (they are moderated so if you don’t want it to show up just say so :)

UPDATE – 2 Mar So it took a week and I’m back, but I’ve removed a few people from follow lists, unfortunately these things need to be done :(

Remote syncing files using git

I’ve been wanting to write a post about this for a while, and a friend of mine asked about it a couple of weeks ago, and here it is…

First you need to create a remote Git repository, either on your own server or Codaset, GitHub

You will need to create a local repository:

mkdir directory_to_sync
cd directory_to_sync
git init
touch .gitignore
git add .gitignore
git commit

To create a remote Git repository do the following on your server:

mkdir repository.git
cd repository.git
git init --bare

Once you have created the remote repository you will need to link it to your local copy:

git remote add origin ssh://server_address/path_to_repository
git push origin master
git pull origin master

To make life easier I always edit the Git config file and add the following:

vi .git/config
[push]
        default = current
[branch "master"]
        remote = origin
        merge = master

The only problem with this approach is that you need to store the files in a seperate directory, but we ca get around this “limitation” by using symlinks for example to store the .bash* files in Git:

ln -s directory_to_sync/.bashrc ./

Well I hope this helps someone out there :)

The post is brought to you by lekhonee v0.7

Tweetdeck and 64Bit Linux

So I’ve been trying to get TweetDeck running on my work PC for a while, and none of the howto’s I followed were able to help :(

Then this morning I stumbled apon this gem and lo and behold it worked (kinda) I just had to set the permisisons on the /opt/Adobe Air/ directory.

AWESOME!!! :D

Anyways, this is mainly so if I ever reinstall (which I tend to do anyways every couple of weeks lolz… selftorture++)

Canon IP1800 – update

In my last post I mentioned how to get this printer working in Debian, and since then have found a better (no ignoring dependancies) method.

Taken from: http://nomo17k.wordpress.com/2009/03/22/canon-pixma-ip1800-for-debian-lenny/

Sunday, March 22, 2009

Canon PIXMA iP1800 for Debian Lenny

Filed under: Debian, Lenny, Linux — nomo17k @ 12:51

This is a cheap inkjet printer that I got for my temporary printing needs. The cartridges are very expensive (> $16 !!), so for heavy use this isn’t really worth my money. Anyways…

Install CUPS and printing-related packages:

# apt-get install cupsys cupsys-client libcupsys2
# apt-get install cupsys-driver-gimpprint cupsys-bsd
# apt-get install foomatic-db-engine foomatic-db-gimp-print foomatic-filters
# apt-get install hp-ppd linuxprinting.org-ppds printfilters-ppd
# apt-get install foomatic-filters-ppds
# apt-get install gs-gpl libpng3 ijsgutenprint

(Note that I downloaded a few packages that are not necessary for this particular printer. This is a generic collection of packages that I find useful to use printers in other places like my office.)

Download deb packages of the printer driver:

cnijfilter-common_2.70-3_i386.deb
cnijfilter-ip1800series_2.70-3_i386.deb

and install them:

# dpkg -i cnijfilter-common_2.70-3_i386.deb cnijfilter-ip1800series_2.70-3_i386.deb

If CUPS has been installed properly, visit the CUPS admin page (http://localhost:631/admin) with your browser. You will be able to configure the printer in the standard CUPS way.

Taken from: http://nomo17k.wordpress.com/2009/03/22/canon-pixma-ip1800-for-debian-lenny/

I copied and pasted so I have a copy incase that site disapears.

Debian Mirror and GPG issues

So I had a mirror up and running beautifully, and then after running the update scripts I lost the GPG authentication.

I was getting the following errors:
WARNING: The following packages cannot be authenticated!
foo bar baz
Install these packages without verification [y/N]?

I struggled for a while to get this to work, and then gave up, but I finally got this sorted out :)

Firstly as the user running the mirror script:
gpg --no-default-keyring --keyring ~/.gnupg/trustedkeys.gpg --keyserver hkp://subkeys.pgp.net --recv-keys

I needed to add the following keys:
16BA136C – Backports.org Archive Key
55BE302B – Debian Archive Automatic Signing Key (5.0/lenny)
F42584E6 – Lenny Stable Release Key
55BE302B – Debian Archive Automatic Signing Key (5.0/lenny)
0C5A2783 – Medibuntu Packaging Team
1F41B907 – Christian Marillat
437D05B5 – Ubuntu Archive Automatic Signing Key
6DFBCBAE – Sun Microsystems, Inc. (xVM VirtualBox archive signing key)
BBE55AB3 – Debian-Volatile Archive Automatic Signing Key (4.0/etch)

The Medibuntu key was a little strange to get as noted on this post: How To: Make Your Own Ubuntu Repository DVDs

Also removed the “–ignore-release-gpg” option from the scripts, this will at least warn me the next time something like this happens… ;)

And then run the mirror scripts again and voila

Tech Support Cheat Sheet

Tech Support Cheat Sheet
Taken from xkcd

Apache mod_rewrite tips and tricks

So I was trying to solve a weird redirect issue: Request exceeded the limit of 10 internal redirects due to probable configuration error.

I found this site, which had quite alot of info.

One tip I really liked was:

Cache-Friendly File Names

This is probably my favorite, and I use it on every site I work on. It allows me to update my javascript and css files in my visitors cache’s simply by naming them differently in the html, on the server they stay the same name. This rewrites all files for /zap/j/anything-anynumber.js to /zap/j/anything.js and /zap/c/anything-anynumber.css to /zap/c/anything.css

RewriteRule ^zap/(j|c)/([a-z]+)-([0-9]+)\.(js|css)$ /zap/$1/$2.$4 [L]

Local development – multiple vhosts

As with alot of devs out there, I have a couple of virtual hosts setup. It is rather annoying to keep updating the /etc/hosts file. I came across “42foo: all the virtual hosts you need for your web development” which has helped alot. But this was not enough, the virtual hosts are still static, then I found “Dynamically Configured Mass Virtual Hosting“.

So now I have the following setup:

/etc/dnsmasq.conf

no-resolv
server=<DNSSERVER>
address=/.local/<DEVSERVERIP>
no-hosts

/etc/apache2/conf.d/multi_vhost (on the devserver)

# get the server name from the Host: header
UseCanonicalName Off

# this log format can be split per-virtual-host based on the first field
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog /var/log/apache2/vhost_access_log vcommon

# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot /var/www/%0/

<Directory /var/www/>
 AllowOverride All
 Order allow,deny
 Allow from all
</Directory>

Apache requires the mod_vhost_alias module to be loaded.

And this is it, all that is needed now is to have a symlink/directory in /var/www/ with the name of the virtualhost pointing to the document root of the dev site.

EG: /var/www/test.local -> /home/<user>/Development/test/webroot/

So now no more editing multiple files, all I need is to create a symlink and sorted :)

P.S. I did find that the Avahi daemon was causing issues see Bug #80900

To disable the Avahi daemon:

sudo invoke-rc.d avahi-daemon stop
sudo update-rc.d -f avahi-daemon remove

UPDATE: I needed to add the directory clause to multi_vhost as I needed to use .htaccess files ;)
UPDATE 2: There was also an issue with mod_rewrite (Request exceeded the limit of 10 internal redirects due to probable configuration error.) This was only happening to sites with a .htaccess. The solution was to add:

RewriteBase /

RE: Hating Microsoft

For those of you Microsoft Zealots out there read the following: Russell Coker: Hating Microsoft it might explain a few things ;)

Now STFU :p

Microsoft Tax– Howto get a refund

Was going through my rss feeds and found the following on Planet Ubuntu: http://simos.info/blog/archives/1000

I now can’t wait till I get a new PC :)

Hopefully this helps others out there who don’t need/want windows, there are other alternatives: http://distrowatch.com