A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Working with RPMs

Use -q to query:
    rpm -qi package_name # display info about the specified package
    rpm -ql package_name # list all the files in the specified package
    rpm -qa # list all installed packages

Add -p if you're querying an RPM file, omit it if you're querying an installed package.

How to view .msg files on Ubuntu

wget http://www.matijs.net/software/msgconv/msgconvert.pl
sudo apt-get install libemail-outlook-message-perl
sudo apt-get install libemail-localdelivery-perl
perl msgconvert.pl YourMessage.msg

Thanks to this software

How to install CPAN Perl modules on Ubuntu using apt-get package manager

script:

PACKAGE=$(echo "$1" | perl -e '$x=<>; chomp($x); $x=~s/::/-/g; $x=lc($x); print "lib$x-perl"')
sudo apt-get install $PACKAGE

Thanks

Configuring Ubuntu

After upgrading from Ubuntu 11.04 (Natty Narwhal) to 12.04.2 (Precise Pangolin), I couldn't make my original account log in to gnome. So I had to copy over all the settings to a new user account. Also, a number of things are different in Ubuntu 12.
  • To bypass Unity, select 'Ubuntu classic' window manager at login screen
  • In Synaptic package manager, find overlay-scrollbar and uninstall it, then reboot
  • There is no top-level settings menu like 11.04, instead look under the Applications menu
  • Gedit: Set tab width to 4, insert spaces instead of tabs, and use automatic indentation
  • Nautilus: Edit | Preferences | Views (tab) | View new folders using: List View
  • Increase terminal buffer to 'unlimited'
  • Copy over SSH keys:
    • cp -rp ~olduser/.ssh ~newuser/
  • Install chromium, copy settings from chrome:
    • sudo cp -Rp ~olduser/.config/google-chrome/ ~newuser/.config/chromium/
  • Install Thunderbird 24 + Lightning calendar plugin, copy user profile across
    • mv ~newuser/.thunderbird/axhtibx7.default{,.backup}
    • sudo cp -Rp ~olduser/.thunderbird/sw5u8ylf.default ~newuser/.thunderbird/axhtibx7.default
    • The 'Accept' button is missing for some event invites
      • "This message contains an event that this version of lightning cannot process"
      • This is a bug (reported and fixed via developer's patch)
    • Sort by 'Received' and 'Threaded' to get threads ordered by last received message
  • Install Firefox, copy user profile:
    • mv ~/newuser/.mozilla/firefox/ce3ut43x.default{,.backup}
    • cp -rp ~oluser/.mozilla/firefox/ra129tce.default/ ~/newuser/.mozilla/firefox/ce3ut43x.default
  • Install Pidgin for IRC, copy config across:
    • cp -rp ~olduser/.purple/ ~newuser/
    • Error, Pidgin crashes with "SIGSEGV in pthread_mutex_lock()"
    • So, re-set up pidgin for all networks
    • Disable smileys as they intefere with pasted code:
      • Tools | Preferences | Themes | Smiley Theme | None
  • Install VirtualBox, go to "Machine | Add", and browse to your VM on disk
  • Install Skype 4.0.0.8, because 4.2.x crashes on incoming calls:
    • Type Ctrl-O to reach the options screen to set the proxy in 4.2.x (source)
    • Disable 'contact online' and 'contact offline' notifications because of this
    • Skype has no sound, in fact Ubuntu has no sound:
      • killall pulseaudio (source, source)
      • restart Skype (may need to "kill -9 skype")
  • To find the exact version of Ubuntu I'm running:
    • This only shows 12.04: Applications | System Tools | System Settings | Details
    • This command tells you the exact version (12.04.3):
      • lsb_release -a
  • Configure multiple workspaces:
    • Right-click in the bottom-right-hand corner and edit preferences (source)
    • Still can't actually switch workspaces though without the screen freezing up.
    • Hold Ctrl-Alt-Del for 5 seconds to get back.
  • Fix Alt-tab:
    • sudo apt-get install compizconfig-settings-manager
    • Scroll to bottom, check 'Static application switcher' (source)
  • Fix the date display:
    • Use dconf-editor | com | canonical | indicator | appmenu | datetime (source)
  • I get "Ubuntu internal error" sometimes, that never happened under 11.04.
  • Beware of cancelling a logout. An application preventing the logout may eventually crash or close, and the logout will happen at that point without further warning.
  • Problem: Sound comes out of both the laptop speakers and the headphones at the same time.
  • Problem: Workspaces don't work properly. Cannot right-click on window's title to send it to a new workspace. Clicking on a new workspace in the bottom right doesn't work.
  • Problem: The top and bottom taskbars are visible even when the screen is locked, when using multiple monitors (bug report).

Can't push to github




The problem:

Git asks you for your password, when it should just accept your SSH key.

$ git push origin master
Password for 'https://github@github.com': 


The solution:

1) First, read the github documentation to ensure your SSH keys are set up correctly

2) Then add this to your ~/.ssh/config:

Host github github.com
Hostname github.com
User git
IdentityFile ~/.ssh/github/id_rsa


3) Finally, clone using ssh instead of https:

git clone https://github.com/username/project-name.git # wrong

git clone git@github.com:username/project-name.git # right

4) Push should now work as expected