ubuntu

Google Fonts – nasty bold

Say you are using Google Web fonts for some CSS. Well, if you don’t include the correct bits you may encounter this problem.

Say, you use the Ubuntu font, for instance, and you have this in your <head>  block:

<link href="http://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet" type="text/css" />

Then, you use this font everywhere, and this includes a <th> section. You may find that the font displays like this:

Odd bold variant on Google Webfonts

Why has this happened? Well, its because you’ve not included the bold variant of the font in the header link.

For this particular font, it should be:

<link href="http://fonts.googleapis.com/css?family=Ubuntu:400,700" rel="stylesheet" type="text/css" />

700 is the bold variant. Once you’ve changed this, you should find that the bold is rendered correctly:

Fixed version of Google Webfont bold

Setting up Postfix to use an external mail server

Sometimes sending mail to a dev account is all well and good, but if the mail server you are sending to is not accepting the mail for one reason or another (disallowed dynamic ip addresses, for instance) then you might need to set it up to send through a mail server (relay).

I am using smtp.tatedavies.com as an example here, and the user “frank” with his password being “penguin” (clearly a very high security password)

Fire up terminal and sudo in.

sudo su
postconf -e "relayhost=smtp.tatedavies.com"
postconf -e "smtp_sasl_auth_enable=yes"
postconf -e "smtp_sasl_password_maps=hash:/etc/postfix/smtp_password"
echo "smtp.tatedavies.com frank:penguin" > /etc/postfix/smtp_password
chmod 600 /etc/postfix/smtp_password
postmap /etc/postfix/smtp_password
service postfix restart

Getting wkhtmltopdf working on Linux

I’ve had a few troubles getting this running, and thought I would document it here.

First of all get the static binaries from the wkhtmltopdf site

And then install the following packages: (either through yum or aptitude)

  • libXrender
  • libXext
  • xz
  • openssl-devel
  • glibc
  • glibc-common
  • ld-linux.so.2
  • urw-fonts
  • libfontconfig.so.1
  • libz.so.1
  • libXext.so.6
  • libstdc++.so.6

Now, I have done this before, in Ubuntu and not hd to install the .so.x files but Centos 6 required that I did so… Annoying, and head scratching…

 

How to transfer files over SSH/SCP

I often forget the syntax for getting files over a SSH connection.

scp user@address:/path/to/file /path/of/new/file

For example:

scp root@domain.com:/tmp/mysql/test.sql .

Will transfer test.sql to the current folder (.) Also, if you need to change the port, just use the -P option

scp -P 9000 user@address:/path/to/file .

If you want to transfer a file TO another server:

scp /path/of/file user@address:/path/to/new/location

 

God, Windows is sloooooow

I am assisting a colleague today check out a rather large feature branch. I showed him the branch address and he started checking it out using Tortoise SVN on Windows 7.

Upon returning to my desk (Ubuntu 11.10), I decided to merge the branch with the major trunk. I checked out a brand new copy of the branch, merged it (for the first time in several months) and then re-committed the pages.

Guess what, he’s still checking out the original!!!

Do yourselves a favour guys, make it Linux this Christmas…

Ubuntu, Thunderbird always maximised

I recently switched from Linux Mint back to the old trusty Ubuntu (11.10)

One major problem was Unity, but I got round this by installing Xfce and use that as a shell instead. Much better.

Now, my Thunderbird is proper maximised. Like full screen, so I can’t switch to any applications unless I use ALT TAB. Found help on the net.

1) Close Thunderbird

2) Locate your localstore.rdf file, mine was in:

~/.thunderbird/ftfxbq7f.default$

3) Edit the file, and find the section that looks a little like this:

<RDF:Description RDF:about="chrome://messenger/content/messenger.xul#messengerWindow"
                   width="1024"
                   height="1024"
                   screenX="344"
                   screenY="113"
                   sizemode="fullscreen" />

And change it to:

<rdf:Description RDF:about="chrome://messenger/content/messenger.xul#messengerWindow"
                   width="800"
                   height="600"
                   sizemode="normal"
                   screenX="5"
                   screenY="5" />

Then, once restarted, Thunderbird should be all nice and accessible again. Thanks to Greg for this one!

Stopping Ubuntu opening F-Spot when I plug in my iPhone

When I installed Ubuntu, every time I plugged in my iPhone it popped up a prompt asking me what to do about the digital music/photos. After clicking “do nothing” for months I decided to let it open F-Spot to import my photos. This is all well and good, but it now pops up f-spot whenever I plug it in, several times a day!

To combat this, open a terminal session and type:

nautilus-file-management-properties

Then, you can click on the Media tab, and choose “Do Nothing” for Photos.

Job done. Thank god!