A window stuck in the top menu Ubuntu Unity 14.04

Some of my windows (for example libre office) have been getting stuck on the top left of the screen because Ubuntu Unity was appearing to eat the menu controls. I could not minimise, maximise or close the windows simply because the menu button weren’t visible.

The solution is to hold down the ‘alt’ key and drag the windows away from the top.

I didn’t know about alt-drag but is a really useful little tip.

Let me know if you find another solution.

How to install ssh-copy-id on OSX (the easy way!)

If you have migrated from Linux to OSX… you might well be missing ssh-copy-id. Frankly, the easier way to do this is to install the Brew repository / package manager for Mac and then install ssh-copy-id on your Mac in one command.

Install Brew (if you don’t already have this awesome tool!).

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Then simply..

brew install ssh-copy-id

Job done!

How to move From Ubuntu to OSX

I’ve decided to stop using Ubuntu as my primary home computer and make the switch to OSX. I’ve purchased a new Macbook Pro and for the first time ever not immediately installed Ubuntu. I love Ubuntu (and this blog is 99% all about Ubuntu); so why have I decided to make this change?

Why go to OSX?

1 – My company has started developing software for Windows and Mac. I need to test the software. I can run Windows and Linux in a VM but can’t run OSX without a Mac.

2 – I don’t have some much time to geek and make Ubuntu work with my Android phone, my wifes Mac, a Nas, 4oD, Amazon streaming videos or any other random bits of hardware and software I need. Fundementally, OSX is better supported and just works most of the time.

That doesn’t diminish how brilliant Ubuntu is. It’s awesome and does 99% of what I want. I have written this post because perhaps there are other people changing from Ubuntu to OSX. So, I thought that I would note down the changes that I made to the default OSX – after all it isn’t perfect!

HyperDock – I miss the awesome windows snapping of Ubuntu Unity. Hyperdock brings this to Mac.

Pathfinder – The default file manager on Apple really sucks. No folders? WTF? Install Path Finder.

Firefox / Chrome – Let’s be honest – Safari sucks.

Libre Office – Apple provide Numbers and Words which are simply too basic for my taste.

Install a repository
Would you believe it but Apple don’t have a system repository like Linux. By default you simply can’t just ‘apt-get install randompackage’. This feels like lossing my right arm after living with the awesome repositories the Ubuntu / Debian provide. Luckily, the open source communitry have made a solution. It is called Brew.

You install Brew by running:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Then you can now run this one line…

brew install package

You can check for updates:

brew update

and upgrade like so:

brew upgrade

Install zsh
After using the awesome Ubuntu terminal, the default Apple terminal feels pants. You can fix this is just a couple of lines once you have Brew installed.

http://jakoblaegdsmand.com/blog/2013/04/how-to-get-an-awesome-looking-terminal-on-mac-os-x/

Remove the stupid [Process Completed] messages – When you exit the terminal you get the most annoying [Process completed]. This is super annoying.

Go to Terminal -> Preferences -> Settings -> Shell . Change “When the shell exits” to “Close if the shell exited cleanly”. This will close the window immediately after [Process completed] has shown.

Remove the stupid donk sounds –

 

I’m still learning about Mac’s and am updating this posts with all the changes that I made.  I will keep editing this post as I change other things.

Fogbugz stopped working after upgrade to Ubuntu 14.04

We have had Fogbugz installed on Ubuntu since Ubuntu 12.04. However, after upgrading to Ubuntu 14.04, we found that the software would not run. I could not find anything only about how to make Fogbugz work on Ubuntu 14.04. So…

We have moved to Jira and it sooooo much better than Fogbugz.

1) It is cheaper – just $10 for 10 users.
2) It is easier to install – it runs on Java and not on Mono
3) It is nicer to use – frankly Fogbugz is looking a little old fashioned!

So… Fogbugz is dead… long live Jira!

How to restore a single file in Bacula

I wanted to restore a single file from Bacula. I’m writing this tutorial partically to remind myself how to do this but perhaps it will help someone in the future.

You will need to do this from bconsole on your Bacula server.

1 – You need to find the filename of the file. For example: myfile.xml

2 – You then need to find the last time that this file was backed up. You can do this using the restore command:

restore
select option 2 - list jobs of command seperated JobIDs to select
select the client - 1 
Enter file name (no path): myfile.xml

This produces a list of JobId’s and the complete path to possible files.

+———+———–+———-+———–+
| JobId | Name | StartTime | JobType | JobStatus | JobFiles | JobBytes |
+———+———–+———-+———–+
| 8862 | /mnt/pd/Documentation/X015/myfile.xlm | 2014-05-14 20:39:00 | B | T | 10 | 3837733 |
| 8844 | /mnt/pd/Documentation/X015/myfile.xlm | 2014-05-13 20:42:16 | B | T | 7 | 88229 |
+———+———–+———-+———–+

3 – If the file appears then you can to restore from one of the selective JobId like so:

restore
select 3 -Enter list of comma seperated JobIds to select
select the files you require by browsing around - cd / ls / add filename then done

You might need to modify the ‘where’ part of the generated job like so:

mod
select 9
enter the full path to a restore path

Then the files or directories you have selected should be restored.

Kayako wget OpenSSL: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

We are using Kayako for our support ticket system. I just updated our server from Ubuntu 12.04 to Ubuntu 14.04. We started to see a problem with some crons which automate the importing and processing of emails.

This is the error that we got:

Resolving support.oursite.com (support.oursite.com)... 127.0.1.1
Connecting to support.oursite.com (support.oursite.com)|127.0.1.1|:443... connected.
OpenSSL: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Unable to establish SSL connection.

There are several possible SSL problems that this could be:

1 – The destination site does not like the protocol – this could be caused but CURL / WGET not using a compatible version of SSL as the server. So you can try setting the version of ssl like so:

wget -secure-protocol=SSLv2 https://example.com
curl --sslv2 https://example.com

2 – The destination site does not like the cipher. This can be caused by a poor cipher configuration in Apache or anonymous ciphers is disabled on the server.

Finally – and this was my problem…

The php script that was making the request was located on the same server as the Kayako support ticket system. The url for the server was something like support.randomhacks.co.uk and the hostname of the server was also support.randomhacks.co.uk . So, when looking up the DNS record for support.randomhacks.co.uk the computer went to /etc/hosts and returned 127.0.0.1 rather than the public ip address. So, when the script tried to connect to Apache at 127.0.0.1 using https it failed because SSL certificates a limited to one ip address only and this was the public IP address.

I hope help solve you problem. I would be great to hear if you have another solution.
I hope this helps someone.