[Linux] Tip for heavy users of Ctrl + R

After a lengthy JIRA tip, I’m about to blog a Keyboard Ninja tip for users who do a lot of Ctrl + R thingy to navigate Bash history.

This came up when I didn’t want to use a session manager like PAC but rely on Bash history. I have a server IP address and SSH access.

So, instead of doing just ssh -v shaakunthala@xxx.xxx.xxx.xxx thing, I do this:

ssh -v shaakunthala@xxx.xxx.xxx.xxx #jirauat

Those who are familiar with scripting know this: Whatever you type after the hash sign won’t effect, because Bash interprets that as a comment. However, Bash history records the complete line.

Later, I don’t have to remember the IP address, but, when I type Ctrl + R followed by jirauat, it comes up quickly. Just hit Enter!

(reverse-i-search)`jiraua': ssh -v shaakunthala@xxx.xxx.xxx.xxx #jirauat

And that’s how you easily save few keystrokes plus an additional minute without having to recall numbers.

Wunderlist Today wallpaper for Ubuntu

Wunderlist again. Currently this is the only Microsoft thing that I use – apart of Windows servers involved in my DevOps job.

Wunderlist hasn’t been treating nice for Ubuntu recently. So I thought about working on something that works for Ubuntu. Then here I got an idea of a very small app that will embed your day action items into the desktop wallpaper. Since I’m not very much into software development, this as a pilot project will make me comfortable for building something better for Ubuntu.

To be honest, first I was planning to do some browser DOM hacking and figure out how it works. Soon after, I found out that there’s a public API for Wunderlist (awesome, isn’t it?), and that can avoid the need of DOM hacking. So, that’s how wunderlist-ubu-wallpaper started as my pilot project.

It is still very young, and I’m sure my code needs a little cleanup as well. It’s just a 150 line Python script – not at all a big deal. Readme file has all the information you need to set it up on your Ubuntu. Run it and see what happens to your Ubuntu wallpaper. Isn’t that awesome?

14 years back when I was a kid, I was just making little Windows executables (I was a Windows user back then) with Visual Basic. After that I did programming to a some level when I was a systems administrator, but I was never permitted to release my work to the public for obvious reasons. After that, here comes my very first little code contribution to the world of Open Source.

By the way, my all other action items are overdue! 😳

Wunderlist for Ubuntu

Wunderlist killed its app for Ubuntu long time back.

And then it was bought by Microsoft, so I hardly think there will be a Linux app ever again. For a long time I didn’t use Wunderlist, but I thought of giving it a try once again. I figured out that pinning Wunderlist tab on Firefox works to some extent.

Today I was installing new software on my new Ubuntu installation, and figured out Atlassian HipChat is now ‘hipchat4’. The new hipchat4 is not the same as old app, but just the web app launched in a lightweight web browser. It’s the same way that Amazon app works (I’d love to use it but they don’t ship to Sri Lanka 😦 ). Can’t this also be working for Wunderlist?

So here’s what I did:

$ gedit ~/.local/share/applications/wunderlist.desktop

And here’s the file contents (in fact, I copied this from an existing .desktop file and changed several lines 😉 ).

[Desktop Entry]
Version=1.0
Name=Wunderlist
GenericName=Wunderlist
Comment=Wunderlist Task Management Tool
Keywords=Tasks;Tasklist;Wunderlist;TODO;
Type=Application
Icon=/opt/wunderlist/icon.png
Exec=webapp-container --enable-media-hub-audio "https://www.wunderlist.com/webapp#/lists/today" --maximized
Terminal=false
Categories=Accessories;Office;
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;
X-Ubuntu-Touch=true
X-Ubuntu-Gettext-Domain=webapp-container
X-Ubuntu-Single-Instance=true
X-Ubuntu-Default-Department-ID=web-browsers
X-Screenshot=/opt/wunderlist/screenshot.png
X-Ubuntu-Splash-Color=#FFFFFF

Find a Wunderlist icon and a screenshot using Google image search, and copy them to /opt/wunderlist.

$ sudo mkdir /opt/wunderlist
$ sudo mv icon.png screenshot.png /opt/wunderlist/

Hit Super Key and type Wunderlist (perhaps you may need to log out and log in again to make it appear for the first time). Launch Wunderlist and log in. Right click the Wunderlist icon on Unity launcher and click ‘Lock to Launcher’.

That’s it!

Desktop notifications and audible bell are also working, but file upload isn’t working with this.

උබුන්ටුවේ සිංහලෙන් ලියමු

උබුන්ටු වලට සිංහල දාන හැටි? කැම්පස් කාලෙ ලියාපුවනේ…! 😀

හරි. එහෙනම් චූටි ළමයි ටික ඉස්සෙල්ලම අහගන්න. මීට අවුරුදු හත අටකට කලින් ඔය ළමයි ඉස්කෝලෙ යන කාලෙ උබුන්ටු වලට සිංහල දානව කියන්නෙ වෙනමම ගේමක්. ඒ දවස් වල අපි අළුතින් වින්ඩෝස් හෝ ලිනක්ස් ඉන්ස්ටෝල් කළ ගමන්ම ඊළඟට දාගන්න එක තමා සිංහල යුනිකෝඩ් කියන්නෙ. ඊටත් කලින්, වින්ඩෝස්, ලිනක්ස් ඔය ඔක්කොටම සම්මතයක් විධියට සිංහල යුනිකෝඩ් එක ගේන්න විවිධ බාධක මැද තවත් පිරිසක් තමන්ගෙ කාලය, ශ්‍රමය කැප කරමින් ගොඩක් මහන්සි වුණා. තවත් පිරිසක් සිංහල භාවිතය ප්‍රචලිත කරන්න ලොකු වෙහෙසක් දැරුවා. ඒකෙ ප්‍රතිපලයක් විධියට, අද වෙනකොට අළුතින් වින්ඩෝස් හෝ ලිනක්ස් ඉන්ස්ටෝල් කළාම සිංහල ඉන්ස්ටෝල් කරන්න ඕනෙ කියන එක අමතක වෙන තරමටම අද අපි සිංහල භාවිතා කරනවා. වෙන එකක් තියා, සිංහලෙන් ලියන එක පොෂ් මදි වගේ දැනිච්ච අයත් අද අපූරුවට සිංහලෙන් ලියනවා. සිංහල තමා දැන් ට්‍රෙන්ඩ් එක! 🙂

ඉතින් ඔය වැඩේ කරන හැටි මතක තියාගන්න අමාරු නිසා අපි උදව් ගත්තේ sinhala.sf.net කියන අඩවියෙන්. හැබැයි මේ අඩවිය 2009න් පසුව යාවත්කාලීන වෙලා නැහැ. එදාට වඩා අද උබුන්ටු වලට සිංහල දානවා කියල කරන්න තියෙන්නෙ input method එක දාගන්න එක විතරයි. පෙරනිමියෙන් දීලා තියෙන phonetic method එකට වඩා ඉතා පහසු විජේසේකර යතුරුපුවරුව හදාගන්න මෙන්න මේ ටික කළා නම් හොඳටම ඇති. Ctrl + Alt + T ගහලා අරින්න ටර්මිනල් එකක්..

$ sudo apt-get install ibus-m17n m17n-db m17n-contrib
  1. System Settings –> Text Entry
  2. (+) ලකුණ ක්ලික් කරලා wijesekara කියල ටයිප් කළාම එන එක එකතු කරගන්න.
  3. “Switch to next source using:” කියන තැන ක්ලික් කරලා Left Alt + Left Shift තද කරන්න – නැත්තම් ඉංග්‍රීසි-සිංහල අතර මාරු වෙන්න තමන්ට පහසු යතුරු සංයෝජනයක් ඇතුළත් කරන්න.

ඉතාම සරලයි. 🙂

දැං ෆේස්බුකියේ ලිය ලිය ඉන්න ගමන් Left Alt + Left Shift ප්‍රෙස් කළ ගමන් එතනින් එහාට ලියවෙන්නෙ සිංහලෙන්. ආපහු ඒකම කළාම ආපහු ඉංග්‍රීසි.

ප.ලි. –
විජේසේකර සිස්ටම් එක අමාරුද? මගේ ඇඟිලි ඊට වඩා අමාරු එකක් මේ දවස් වල පුරුදු වෙනවා. ඒ තමා ගිටාර් එකේ F කෝඩ් එක ප්ලේ කරන හැටි.

Cisco AnyConnect VPN for Ubuntu Xenial?

Post-upgrade first World problems are here.

A friend who recently upgraded to Ubuntu 16.04 Xenial Xerus LTS told me that Cisco AnyConnect VPN doesn’t work anymore. So I wanted to give it a try.

In Ubuntu 14.04 what you’d normally do is installing the three packages network-manager-openconnect, network-manager-openconnect-gnome and openconnect (or may be two of them – can’t recall).

However, this no longer works. You can install the packages but you will no longer see the “Cisco AnyConnect compatible” OpenConnect option when you attempt to create a new VPN connection.

What now? Back to basics!

Hit Ctrl+T to get a terminal and here’s all what you have to do:

$ sudo openconnect --setuid=`id -u` --user=shaakunthala vpn.provider.com
  • Replace shaakunthala with your username in the VPN server.
  • Replace vpn.provider.com with your actual VPN provider’s hostname.

Hit Ctrl+C to disconnect.

Surf and enjoy!

Getting old Truecrypt to work with Xenial

Truecrypt died two years back.

Despite their warning I continued to use it for encrypting some of my data, because I believe Truecrypt was rather killed by a hidden hand – not actually because of any unfixable vulnerabilities.

So, straight to the topic; a new Ubuntu LTS is here and everyone is upgrading. I wanted to install it from the scratch this time. Therefore first of all I took backups using Truecrypt that I have been using since 2014. (My laptop had Ubuntu 14.04 LTS until right now)

All went so smooth until I tried to mount my encrypted Truecrypt volume with the previous Truecrypt 7.1a binary I had. It has been previously compiled into one single executable binary, and the architecture was the same (x86_64).

The error was;

error while loading shared libraries: libwx_gtk2u_adv-2.8.so.0: cannot open shared object file: No such file or directory

Mmm… dependency problem! I tried to install libwxgtk-2.8 from official Ubuntu Xenial Xerus repositories, but the only available version was 3.0. Installing version 3.0 did not address the issue.

After trying out a couple of other options I figured out that easiest option is directly downloading and installing dependencies from the Launchpad. It fixed the issue!

So, this is what worked for me:

$ cd /usr/bin
$ sudo ln -s /opt/truecrypt truecrypt    #Note: I put my previous binary in /opt
$ mkdir /tmp/wx
$ cd /tmp/wx
$ wget http://launchpadlibrarian.net/219037037/libwxgtk2.8-0_2.8.12.1+dfsg2-2ubuntu2_amd64.deb
$ wget http://launchpadlibrarian.net/219037033/libwxbase2.8-0_2.8.12.1+dfsg2-2ubuntu2_amd64.deb
$ sudo dpkg -i *.deb
$ truecrypt &

I believe this is the time I should be looking for an alternative encryption solution, because eventually dependencies will also get old and die, completely killing Truecrypt.

 

[Ubuntu] “not a com 32R image” boot error

A new LTS is here and it’s the season for upgrades.

I downloaded Ubuntu 16.04 Desktop 64-bit and wanted to give it a try. First thing I would normally do is installing it on a virtual machine. So I could install software, customize, shake it, break it and feel how it works.

Next thing is preparing a startup USB stick (I don’t use DVDs) and booting up my laptop to test it. And here I kept getting this error when booting up.

Missing parameter in configuration file. Keyword: path
GFX BOOT.c32: not a com 32R image
boot:

And, finally I got it after a bit of trial and error. If I create the startup disk from the VM, this error doesn’t occur and it boots up the machine.

How?

The culprit I suspect here is BIOS. For years I’ve had enabled the BIOS compatible legacy boot mode on top of UEFI in my laptop.

If I create the startup USB stick through the currently installed Ubuntu on my laptop, Startup Disk Creator thinks my computer boots with UEFI, so it prepares the USB stick to be booted up with UEFI.

If I create the startup disk using the VM which is BIOS (by directly presenting the USB stick to VM), Startup Disk Creator does it the way it is supposed to do in a BIOS environment.

That’s my hypothesis. I don’t have a conclusion yet, but if you use legacy boot options in your computer’s startup settings, create Ubuntu startup USB stick using a computer that has true BIOS. Or, switch to UEFI booting for good.

Got anything to add?