Connect Ubuntu to a Samsung M2022w printer

Setting up your Samsung M2022w wireless printer can be a pain if you don’t know where to look – luckily someone has taken that pain upon themselves so you don’t have to.

The Samsung Unified Linux Driver Repository is the place to get your Samsung driver for Ubuntu (or Linux in general).

Start by adding the repository – in Ubuntu Terminal:

sudo wget -O - | sudo apt-key add -

Then refresh your updates cache:

sudo apt-get update

Install the driver:

sudo apt-get install suld-driver2-1.00.06

Setting up the printer

With the driver installed you can now set up the printer – find the Printers applet, click ‘Add’.


Open ‘Network Printer’, after a short while a whole bunch of options will appear like below. Click on the option titled ‘Samsung M2022 Ser…’ and then ‘Forward’.


Some screens will pass that are very self explanatory, you really can’t go wrong. The last screen allows you the option to do a test print, feel free.


Click ‘OK’.

Replicating a mySQL database

The database

If you’re running a site that uses mySQL then you’ll need to export the data into a text file (.sql) somewhere on the file system.

If you don’t have root or sudo access then choose somewhere in your home folder:

cd ~/

Then run the following command replacing user_name with your mySQL username,database_name with the name of the database you want to export and filename

Continue reading “Replicating a mySQL database”

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 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 "gitUserName"
git config --global

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://

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!


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