Random Terminal commands

A place for Terminal/CLI commands that don’t merit a whole post to themselves. I’ll move the snippet if I do a longer post on the related subject.

Dropbox

Dropbox losses its notification icon on some Ubuntu installs, for me that version is 13.10 – to get it back run the following:

sudo apt-get install libappindicator1
sudo dropbox stop && dropbox start

This adds the icon back into the notification area. Continue reading “Random Terminal commands”

Setting up & using Git on Ubuntu

Installing Git and doing the initial set up is pretty straight-forward. I’m using Ubuntu 13.10 – open Terminal and run the following command:

sudo apt-get install git-core

You’ll need to create a Git configuration file in your home directory – I’ll use vi, because it’s just so user friendly:

sudo vi ~/.gitconfig

You should now be starting from a fresh/empty file, close vi and run the following commands to add details to your configuration file:

git config --global user.name "gitUserName"
git config --global user.email user.email@domain.co.uk

If you use GitHub use the same details you use to access the web site. Git is now installed and your user details should be saved in the configuration file.

Get the latest updates

Adding the latest version of Git from their package repository – useful on Ubuntu LTS versions where the Ubuntu Universe version is older than the Git version:

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get upgrade

Accessing GitHub

If you’re using GitHub as your central repository then you’ll need to do a few things to allow yourself access. First off you’ll need to install OpenSSH and create an authentication key. Once you’ve done that you will need to copy the contents of your public key and add it to your account on GitHub. Click on the account settings link on GitHub – it’s in the top right corner: github-account-links On the left hand side there is a link labelled ‘SSH keys’ – click that: ssh-link-in-left-panel-on-github The resulting page lists any keys you currently have associated to your account. In the top right of the content of the page you’ll have a link to ‘Add SSH key’: add-ssh-link-on-github The next page is quite straight-forward, give your key a title so you can identify it later and then paste the contents of your public key file into the other field: add-ssh-key-form-on-github Save your changes.

Using Git

Some common commands for everyday usage of Git from the command line. Change directory so you are in your repository – then run these commands depending on what you want to do.

Clone a repository

git clone git://github.com/path/to.git

Get status

git status

Update local

git pull

Commit changes

git add "path/to/file.ext"
git commit -m "A useful commit message"
git push

Or if you have a few changes to add at the same time you can run:

git add -A
git commit -m "A useful commit message"
git push

Setting up Apache 2 on Ubuntu

Using my black Apple MacBook (Mid 2007), these are the steps I’ve used to set up Apache 2 on Ubuntu 13.10 with virtual hosts.

Out of the box

Once my Ubuntu install had completed I tried my ‘localhost’ in a browser and got a message telling me the page didn’t exist.

Run the following in Terminal to install Apache from the Ubuntu Universe repositories:

sudo apt-get install apache2

Once complete I tried localhost’ again and the infamous ‘It works!’ text appeared!

Start/Stop/Reload

There are several options for each of these commands – I think I’m right in saying they all do the same thing. Their purpose can be fairly self explanatory but just in case I’ve added a brief note with each.

Start the Apache 2 service; use this command after you have stopped your Apache server for whatever reason:

sudo service apache2 start
sudo start apache2
sudo /etc/init.d/apache2 start

Restart the Apache 2 service; use this command to restart your apache server – this is effectively the same as running ‘stop’ then ‘start’:

sudo service apache2 restart
sudo restart apache2
sudo /etc/init.d/apache2 restart

Reload the Apache 2 service; use this command to gracefully reload the Apache configuration files – use this after making a change to your .conf files:

sudo service apache2 reload
sudo reload apache2
sudo /etc/init.d/apache2 reload

Setting up IMAP from NamesCo on Android

If I’ve set you up at NamesCo with IMAP email then you’ll need to follow these instructions to set up your email on an Android device such as the Nexus 5, Samsung S5 or the HTC One. I’ve used Android 4.4 here as that is the current version, but generally the set-up doesn’t change too much between versions.

In the instructions below, I’ll be setting up email for a web site called protosite.co.uk – where you see that you’ll need to add your own domain name. For a user I’ll be using John Doe; probably best if you replace that name with your own!

IMAP email on Android

Open your email client. The standard client in Android is simply called ‘Email’, then go to ‘Settings’:

  1. Tap ‘Add Account’
  2. Enter your email address – for example ‘john.doe@protosite.co.uk’
  3. Enter the user password given to you when your account was set up
  4. Tap ‘Next’

On the next screen you set-up security:

  1. Enter your username – for example ‘protosite.co.uk_john.doe’
  2. The password should be prefilled – if not then enter the user password given to you when your account was set up
  3. Enter the server name as ‘imap.hosts.co.uk’
  4. Skip to security type and select ‘SSL/TLS’
  5. Tap ‘Next’

On the next screen you set-up how your user sends email:

  1. Skip to security type and select ‘SSL/TLS’
  2. Change the username to ‘protosite.co.uk’
  3. The password should be prefilled – remove this and enter the SMTP password as given to you when your account was set up
  4. Tap ‘Next’

On the next screen you can change how your device interacts with your email account – generally you can leave these at their default but if you wanted your phone to check for mail more often then this where you’d do that.

Setting up IMAP from NamesCo on Mozilla Thunderbird

Setting up Mozilla Thunderbird to use with your NamesCo IMAP email account is fairly straight-forward. Anywhere I have used yourdomain.co.uk’, use your domain as used in your email address after the @ symbol. Where I use ‘your.name’ replace with your name.

Open Thunderbird and open the ‘Account Settings’ – on Ubuntu 13.10 that can be found in the ‘Edit’ menu.

Account settings screen

At the bottom of this screen on the left you’ll see a dropdown menu labelled ‘Account Actions’.

thunderbird-account-action-dropdown

Click on the dropdown and choose ‘Add Mail Account…’ – a new screen will open requesting your name, email address & password.

thunderbird-account-setup-step-1

Fill in the details and click ‘Continue’.

Thunderbird will attempt to find your account setting from Mozillas email database. When it fails it will display a configuration screen where you can add the correct details.

thunderbird-account-setup-step-2

The details for the NamesCo server are:

                   Server hostname    Port   SSL       Authentication
Incoming:   IMAP   imap.hosts.co.uk   993    SSL/TLS   Normal password
Outgoing:   SMTP   smtp.hosts.co.uk   465    SSL/TLS   Normal password

The username for your account should have been supplied to you – it is usually in a format as below:

Username:   yourdomain.co.uk_your.name

Fill in the details and click ‘Continue’ again. Thunderbird should connect to the NamesCo server, close the setup window and show you the ‘Account Settings’ window again.

Click on you email address on the left hand side. On the right you can update your account name with something easier to read:

thunderbird-change-account-name

You can also add your organisation name and a signature on the same screen:

thunderbird-add-organisation-and-signature

On the left under your account name you can see ‘Server Settings’ – click on that and check the box labelled ‘Clean up (“Expunge”) Inbox on Exit’:

thunderbird-expunge-inbox-on-exit

On the left under your account name you can see ‘Junk Settings’ – click on that and check the box labelled ‘Move new junk messages to:’:

thunderbird-junk-settings

On the left click ‘Outgoing Server (SMTP)’. Highlight the SMTP entry that corresponds to your new email account and click ‘Edit…’

thunderbird-smtp-details

The details for your SMTP server should mostly be correct as we set them up earlier – you will need to change the username though as it is different to your email user:

thunderbird-smtp-edit-screen

The settings should be:

Description:              Optional/Leave empty
Server Name:              smtp.hosts.co.uk
Port:                     465

Connection security:      SSL/TLS
Authentication method:    Normal password
User Name:                yourdomain.co.uk

Click ‘OK’.

SMTP password

Assuming all has gone well you should be able to receive email. From another device or from an online email provider test this by sending yourself an email.

When the email arrives reply to it – you will be asked for the SMTP password:

thunderbird-smtp-password

Enter your SMTP password, check the box labelled ‘Use password Mana…’ and click ‘OK’.

Setting up IMAP from NamesCo on iOS

If I’ve set you up at NamesCo with IMAP email then you’ll need to follow these instructions to set up your email on an iOS device such as the iPhone or iPad. I’ve used iOS 7 here as that is the current version, but generally the set-up doesn’t change too much between versions.

In the instructions below, I’ll be setting up email for a web site called protosite.co.uk – where you see that you’ll need to add your own domain name. For a user I’ll be using John Doe; probably best if you replace that name with your own!

IMAP email on iOS

Open your email client, Mail in iOS. If you haven’t set up any other accounts you will see a Welcome to Mail screen.

  1. Choose ‘Other’ at the bottom of the list of big email provider logos
  2. Go to the next screen

On this screen choose ‘Add Mail Account’ – you will be taken to the next screen.

On this screen you add your generic account details:

  1. Add your name as you want customers to see it
  2. Enter your email address – for example ‘john.doe@protosite.co.uk’
  3. Enter the user password given to you when your account was set up
  4. You can add a short description if you want
  5. Go to the next screen

On this screen you set up more specific details:

  1. Under Incoming mail server for host name add ‘imap.hosts.co.uk’
  2. Enter the Username as ‘protosite.co.uk_john.doe’
  3. The password should be prefilled – if not then enter the user password given to you when your account was set up
  1. Under Outgoing mail server for host name add ‘smtp.hosts.co.uk’
  2. Change the username to ‘protosite.co.uk’
  3. The password should be prefilled – remove this and enter the SMTP password as given to you when your account was set up
  4. Tap ‘Next’

Top 10 favourite films

This might be subject to change but here I present my top 10 favourite films of all time – at some point I might add an addendum covering films I really wanted to put in this list but couldn’t, 10 is just not enough!

I’ve numbered these, but to be honest I think they’re all as great as each other.

1. Se7en

Brad Pitt & Morgan Freeman turn in superb performances trying to catch a sadistic serial killer using the 7 deadly sins as inspiration. Se7en is…

Directed by David Fincher.

2. Fight Club

Edward Norton & Brad Pitt put the world to rights in this bizarre story about a man who can’t sleep. Fight Club shows …

Also directed by David Fincher.

3. Shawshank Redemption

Tim Robbins & Morgan Freeman

4. Aliens

Take everything you saw and experienced in Alien and scale it by ten – Sigouney Weaver

5. The Shining

Jack Nicholson

6. Saving Private Ryan

Tom Hanks, Tom Sizemore & Matt Damon

Ted Danson, Paul Giamatti & the ever popular Vin Diesel

7. Bladerunner

 

8. Amelie

 

9. Usual Suspects

 

10. Jaws

Pebble Steel

I was so excited when I first saw the Pebble Steel – it was for me the first smartwatch that looked like a high-end timepiece rather than a throwback from some childs Sci-Fi fantasy.

IMG_8631-2

I put my order in once they announced they had begun shipping backorders, figuring that I’d probably have to wait while they cleared early orders. Continue reading “Pebble Steel”