Friday, 28 September 2012

How To Upgrade Linux Mint Debian Edition

Upgrade

I recently had to perform upgrades for multiple machines from Update Pack 4 to Update Pack 5. It was really rather easy to do as the following instructions show.
Thanks to this blog for correcting some of my mistakes.

Update the Update Manager

The update manager will indicate when updates are available. For a distribution upgrade like Update Pack 5, I revert to command line. Use CTL-ALT-F1 to switch to a native console session. Then update the update manager with the commands
sudo apt-get install mint-debian-mirrorssudo apt-get install mintupdate-debiansudo apt-get --fix-missing --list-cleanup updatesudo apt-get install mintupdate-debian

Run Distribution Upgrade

So, now we are ready to perform the upgrade with
sudo apt-get --fix-missing --list-cleanup updatesudo apt-get dist-upgrade

Questions Asked During Upgrade

Questions will be asked during the upgrade. If you have a default installation you can normally use the package maintainers version. If unsure check the differences.
With kernel updates you will be asked where to install Grub.
Answer with the location of your current Grub menu, which on most systems is /dev/sda.

Post Upgrade Tasks

Get Best mint-debian Mirror

After installation refresh mirrors with
sudo dpkg-reconfigure mint-debian-mirrors
When I did this I got the following error.

How to Solve NO_PUBKEY 07DC563D1F41B907

Thanks to this blog for this solution.
If we add the repository http://www.debian-multimedia.org  on Debian testing
it can happen that when we try to execute the comand apt-get update, we see a GPG error:
W: GPG error: http://www.debian-multimedia.org squeeze Release:The following signatures couldn't be verified because the public key is not availableNO_PUBKEY 07DC563D1F41B907
To solve this problem we need to install the debian-keyring package
apt-get install debian-keyring
And then execute this command:
gpg --keyring /usr/share/keyrings/debian-keyring.gpg -a --export 07DC563D1F41B907 | apt-key add -
After that, when we try to execute apt-get update, there will be no the GPG error anymore.

Google Chrome

The repositories for Google Chrome (I use the beta releases) are no longer valid. Google recommends downloading the Debian package and re-installing. This updates the Debian repositories.

Thunar Slow to Start

This is due to Thunar trying to auto-mount network drives. It is easy to fix with,
vi /usr/shares/gvfs/mounts/network.mount
And set 
AutoMount=false

Monday, 6 August 2012

Using True Type Fonts in XTerm

I’ve not had to use TrueType fonts before as my desktop display resolution never warranted it. Now with eyesight failing and much better monitors, I decided to give them a go. Fonts are globally managed by settings in /etc/X11/app-defaults. However, TrueType fonts can be locally set using ~/.Xresources.
To browse the list of fonts use
fc-list :fontformat=TrueType -f "%{family}\n" | sort -u | less
Test a font by specifyng in the xterm command -fa option
xterm -fa 'Luxi Mono' -fs 10
Where fa refers to the fonts face name, and fs, the font size.

Once happy with your font, apply to your application in ~/.Xresources
For example to apply for XTerm
! my customisations
XTerm*faceName: DejaVu Sans Mono
XTerm*faceSize: 11
The final step is to set these resource changes using xrdb
xrdb -merge .Xresources
So, next time you invoke a plain xterm command you will be greeted with your new font.

Friday, 6 July 2012

How To Generate SSH Keys for automatic login to target host


To Generate Key

On source host run ssh-keygen(1)
ssh-keygen -t rsa -b 2048Take defaults on prompts.
This will generate two files in .ssh
.ssh/id_rsa.pub
.ssh/id_rsa
Copy these from source to target host with
cat .ssh/id_rsa.pub | ssh user@target "cat >> .ssh/authorized_keys; chmod 600 \ .ssh/authorized_keys"
Now you can login without password from source to target using
ssh target

References

http://www.openssh.org/manual.html
http://www.wikihow.com/Use-SSH
http://en.wikipedia.org/wiki/RSA_(algorithm)

Tuesday, 6 March 2012

GPS Information in photos
I got a post today asking
I had no idea this could happen from taking pictures on the blackberry or cell phone. It's scary.http://www.youtube.com/watch?v=N2vARzvWxwY
The short answer is, yes if you have location services switched on then photo's you take can include that information. How detailed is it? And how can you use it?
As an example consider this photograph,




It contains a metadata including GPS properties. I used ImageMagick to extract the following,
Image: CameraZOOM-20120215124309832.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Class: DirectClass
Geometry: 1944x1944+0+0
Resolution: 72x72
Print size: 27x27
Units: Undefined
Type: TrueColor
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
...
Image statistics:
...
Page geometry: 1944x1944+0+0
Properties:
...
exif:GPSAltitude: 0/1
exif:GPSAltitudeRef: 0
exif:GPSDateStamp: 2012:02:15
exif:GPSInfo: 302
exif:GPSLatitude: 37/1, 48/1, 58099/1000
exif:GPSLatitudeRef: S
exif:GPSLongitude: 144/1, 57/1, 57862/1000
exif:GPSLongitudeRef: E

exif:GPSTimeStamp: 144/1, 57/1, 57862/1000
exif:ImageLength: 1944
exif:ImageWidth: 1944
...
Highlighted in red is the relevant location information. With a little work, this information can be used to find a map reference. The method is
  1. Convert latitude and longitude from Degrees/Minutes/Seconds (DMS) in decimal
  2. Plug this into an online map
1. Conversion
You can use one of many an online calculators to do this. But it is easy enough to manually perform the calculation.
Converting Latitude:
exif:GPSLatitude: 37/1, 48/1, 58099/1000
exif:GPSLatitudeRef: S

This is
   37 Degress, 48 Minutes, 58.099 Seconds, South
Which is
   37.0 + 48/60 + 58.099/(60*60)
Or (rounded to 6 places)
   37.000000 + 0.800000 + 0.016139

That is
   37.816139
But since this is South, the real value is
   -37.816139
Converting Longitude:
exif:GPSLongitude: 144/1, 57/1, 57862/1000
exif:GPSLongitudeRef: E

This is
   144 Degress, 57 Minutes, 57.862 Seconds, East
Which is
   144.0 + 57/60 + 57.862/3600
Or (rounded to 6 places)
   144.000000 + 0.950000 + 0.016073
That is
   144.966073
2. Map Coordinates
Put this into Google Maps as -37.816139,144.966073 will yield you this map,
View Larger Map
Wolfram Alpha does this whole thing in almost one step:
Just put 37 Deg 48' 58.099"S , 144 Deg 57' 57.862"E into the search field and you get taken straight to a map.