Azitech

Azimout's Linux weblog

Archive for the ‘Tricks’ Category

Byobu function keys from PuTTY

leave a comment »

In order to get the F2, F3, F4 and other function keys used by Byobu work when connecting with PuTTY on Windows, set “function keys and keypad” to “Xterm R6” under “Keyboard” in the PuTTY settings.

Advertisements

Written by azimout

20/06/2013 at 14:50

Posted in Tricks

open html link in new tab

leave a comment »

If you want to manually open a link into a new window/tab while keeping the originating page open, just press and hold Ctrl on your keyboard while clicking on the link.

The site’s author can force this behaviour by adding the attribute target=”_blank” in the <a> html tag.

However, the default behaviour in most browsers is to open a new browser window, rather than a new tab in the current window. To change this behaviour:

  • on Mozilla Firefox, open Options – Tabs and enable “open new windows in a new tab instead”
  • on Internet Explorer, open Internet Options – General – Tabs – Settings and under “when a pop-up is encountered” choose “always open pop-ups in a new tab”

Written by azimout

18/03/2013 at 15:50

Posted in Tricks

libvirt domain ip address

leave a comment »

If you are using virsh / qemu / libvirt / kvm for your virtual machines and you type “virsh help” in a terminal, you’ll get more than 200 possible commands that you can use to manipulate your host, domains, etc.

However, I couldn’t for the life of me find a command that will give you a VM’s IP address. Apparently other people have the same problem, cause you can find several scripts out there that try to provide this functionality. The simplest way I have found is to obtain the MAC address with “virsh domiflist <domain>”, and then grep your syslog for that MAC address: you’ll get a bunch of dnsmasq-dhcp log lines matching IP to MAC.

The reason I wanted to find the VM’s IP address was in order to ssh into it. So far I had worked around that by giving it a static IP address (in the 192.168.122.x range, of course) and adding a record to my host’s /etc/hosts file. Instead, today I discovered that if you know the hostname you gave your VM (might be different from the domain name), your host will know it as <vm’s hostname>.local!!!

Written by azimout

01/03/2013 at 22:52

Posted in Tricks

MySQL without a password

leave a comment »

If you want to be able to access the MySQL prompt without entering your password each time, add the following section to ~/.my.cnf:

[client]
password=your_pass

Reference: http://dev.mysql.com/doc/refman/5.1/en/password-security-user.html

Written by azimout

28/02/2013 at 20:44

Posted in Tricks

Search from the Firefox address bar

leave a comment »

One of the things I like about the Google Chrome browser is that there’s just one bar for entering both addresses and searches. Firefox still comes with two bars, one for each.

However, what many people might not know is that you can search also from the address bar in Firefox. So go ahead and get rid of that search box on the browser’s top right!

Minor detail: if you only type one search word in the address bar and you have a D-Link router, rather than getting the Google search results as normal, you will get search results from dlinksearch.com (powered by Yahoo search). To disable this annoying inconsistency, log into your router and, under Setup – Internet – Manual Setup, disable the “Advanced DNS” anti-phishing option.

Written by azimout

03/02/2013 at 15:19

Posted in Tricks

Upstart script for Davmail

leave a comment »

Below is a very simple Upstart script for Davmail. To be installed under /etc/init. Borrowed and slightly adapted from http://sourceforge.net/tracker/?func=detail&aid=3004256&group_id=184600&atid=909907

# davmail -DavMail POP/IMAP/SMTP/CalDav/LDAP Exchange Gateway

description "DavMail POP/IMAP/SMTP/CalDav/LDAP Exchange Gateway"

start on started network-manager
stop on stopped network-manager

env DAVEXEC=/usr/bin/davmail
env DAVCONF=/etc/davmail.properties

expect fork
respawn

exec /usr/bin/nohup $DAVEXEC $DAVCONF

Written by azimout

01/01/2013 at 21:41

Posted in Tricks

Favourite Thunderbird addons

leave a comment »

My favourite mail client is Mozilla Thunderbird. The addons I have installed are:

  • Lightning for calendaring
  • Google Contacts and Provider for Google Calendar to better integrate the
  • SOGo Connector which, together with DavMail, allows me to access contacts and calendar on an Exchange Server
  • Enigmail for PGP encryption and signing
  • Display Mail User Agent which shows me which email client the sender used

Written by azimout

21/11/2012 at 13:29

Posted in Tricks