Category: How-To

  • Gigabyte Brix: Which way up does the base plate attach?

     

    If you’ve taken off the Brix base plate and can’t remember which way was up originally (it attaches with the arrow pointing in two opposite directions…) here’s a picture which should help:

     

    gigabyte-brix-haswell-i5-4200-small-form-factor-which-way-does-the-lid-go-back-on

    The handle in the base should be on the rear side (the one with the most connections)!

  • XenServer 6.2: How to boot a VM to CD/DVD rather than disk

     

    We had a situation recently where a customer was experimenting with XenServer 6.2 and Ubuntu VMs; he accidentally powered off the VM during a distribution upgrade and the VM would only boot with a read-only filesystem. Loading an ISO into the virtual CD drive didn’t do the trick; there’s no obvious way of booting to another medium during the boot process.

     

    The trick is to boot into recovery mode; when the VM is powered off, select it and follow the menus like so:

     

    VM -> Start/Shutdown -> Start in Recovery Mode

     

    The VM should now boot to your Live CD/Rescue CD/etc.

  • Ubuntu: Where is the default tmux config file?

     

    This is a tricky one to find, mainly because by default it doesn’t exist. You create your custom configuration file in your home directory in a hidden file like so:

     

    ~/.tmux.conf

     

    …and add your desired configuration changes to that file. So, if you were the user bob, your config file would be located at:

     

    /home/bob/.tmux.conf

     

    Since it is a hidden file (prefixed with a period) you won’t see it on ls – you need to use:

     

    ls -al

     

    (or ls -a if you don’t like lists) to see it in the directory.

  • Performing a dry run with rsync

     

    One of the many useful options rsync offers is the ability to do a dry-run – in effect showing you what it would do without actually making any changes. To achive this we use the -n flag, like so:

     

    rsync -n /source /destination

     

    In practice we would likely use the -n switch in combination with other switches – commonly we use -avzP, so our real-world example would look like this:

     

    rsync -avzP -n /source /destination

     

    Thanks to the verbose flag (-v) you should see a full list of all of the files which would be transferred, as well as the final note on the last two lines:

     

    sent 26457 bytes  received 2086 bytes  19028.67 bytes/sec
    total size is 26377806232  speedup is 924142.74 (DRY RUN)

     

    …letting you know that it was a dry run and that no files were transferred.

  • Ubuntu: How to check the contents of a tape

     

    To check the contents of a tape, insert the tape and run the following:

     

    tar -tf /dev/[path to tape device]

     

    e.g.:

     

    tar -tf /dev/st0

     

    Note that typically it’s a zero, not a letter o, at the end.

  • How to stop Google going to the country-specific site (google.com.au instead of google.com)

     

    Sometimes you may wish to search Google without being redirected to your local country’s version, as you are likely to get different search results based on your location.

     

    Try the following URL:

     

    http://www.google.com/ncr

     

    NCR here is no-country-redirect, and Google will leave you at simply google.com rather than google.com.au for Australians.

  • Ubuntu: Killing a tmux pane

     

    Opened one too many panes in tmux? You can kill one by selecting it and doing the following:

     

    [prefix] x

     

    By default the prefix is ctrl+b – so in this case you would enter ctrl+b then x.

     

    Pane killed!

  • Ubuntu: Bringing a detached tmux session back

     

    If you’re just starting out with tmux you may have installed it, set up a session, detached and then… what?

     

    To re-join your detached session, simply run:

     

    tmux attach

     

    and you’re back in business.

     

  • Ubuntu: How to change tmux’s ctrl+b binding to ctrl+a

     

    If you’re used to screen you’ll be in the habit of using ctrl+a, for example detaching a session with ctrl+a then d – if you make the move to tmux it’s ctrl+b then d, which can take some getting used to. Often it’s easier to make tmux get used to you! To change tmux from ctrl+b to ctrl+a, make sure tmux isn’t running and create the following file:

     

    vi ~/.tmux.conf

     

    Here we have used the text editor vi to create the file. Now add the following:

     

    unbind C-b

    set -g prefix C-a

     

    Save the file. Now the next time you start tmux it should have changed to what you’re used to!

  • Changing or Updating the time zone in Ubuntu Server

     

    There are quite a few reasons you may find that you need to change your time zone – for example, if you’re using a pre-made image for a virtual machine you may find that the default timezone is not set to your country. You can change the time manually, though there is a quick and easy way:

     

    sudo dpkg-reconfigure tzdata

     

    This reconfigures the tzdata (timezone data) package and runs you through a series of prompts asking which country/city you live in, and updates the time accordingly.

     

    You can check the current system time with:

     

    date

     

    to verify that it worked!