Tag: ubuntu

  • 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!

  • How to erase a tape in Ubuntu

     

    This is another nice and easy one, though it may take a while depending on the size/speed of the tape:

     

    sudo mt -f [/path/to/tape] erase

     

    e.g.:

     

    sudo mt -f /dev/st0 erase

     

    That’s /dev/st(zero) not /dev/st(letter o), in case it’s not clear from the font. This will likely take some time as the tape is erased from end-to-end – once it is done you will be returned to a prompt.

  • How to rewind a tape drive in Ubuntu

     

    This again uses the mt command, and is nice and easy:

     

    sudo mt -f [path/to/tape/drive] rewind

     

    A common example would be:

     

    sudo mt -f /dev/st0 rewind

     

    Easy done! In the above example it’s st (zero) not st (letter o) – in case it’s not clear from the font.

  • 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!

  • Installing Xen on Ubuntu: Error “makeinfo is missing on your system”

     

    This is another error that seems to crop up when making Xen on Ubuntu – you can fix it by installing the texinfo package:

     

    sudo apt-get install texinfo

     

    The error message should now no longer appear.

  • Installing Xen on Ubuntu: Error bits/predefs.h: No such file or directory

     

    This error cropped up when we were building Xen on a system running Ubuntu 12.04 Server:

     

    /usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory

     

    To get past this point, install gcc-multilib.

     

    sudo apt-get install gcc-multilib

     

    The required files are around 20MB and should allow you to get past that point of “make”.

  • Ubuntu: How to delete a user

     

    In Ubuntu 12.04 and 12.10, to delete an additional user you have created, use the following:

     

    sudo deluser [username]

     

    By example, if we wanted to delete a user we created called “test”, we would run:

     

    sudo deluser test

     

    Which gives:

     

    Removing user `test’ …

    Warning: group `test’ has no more members.

    Done.

     

    Be careful with this – don’t delete your admin account 🙂

  • Ubuntu: How to add a existing user to an existing group

     

    To add an existing user to a second group, use the following command:

     

    sudo usermod -a -G [group] [user]

     

    e.g.:

     

    sudo usermod -a -G geeks bob

     

    This will add the user bob to the group geeks.