Wednesday, November 26, 2014

VI or VIM cheat sheet

Moving to a Unix system is a lot easier than it use to be but learning all the terminal commands can be daunting. There are awesome cheat sheets to help new users remember the system commands, but few for learning the specific text based programs.

I am a big fan of the VI text editor. It's fast, customizable and available on pretty much all Unix/Linux machines. Over the years, I'm relied on VI for most of my text editing work but I've always thought I was just scratching the surface of VI with respect to all the functionality it ships with. Furthermore, most of the vi cheat sheets are multipaged, complex and hard to understand and master.

Last weekend, I decided to spend some time looking through all the VI commands and then compiling a single-page cheat sheet with commands I thought was essential. My hope is this will help me use more of the VI functionality, which I have already accomplished by creating the cheat sheet.

I modeled the VI cheat sheet after Fosswire.com's awesome Linux cheat sheet and hope new and existing users of VI will find it useful. Please let me know if you find any errors.





Thursday, August 21, 2014

Special keys keybindings on a Thinkpad running Xubuntu 14.04

IBM Thinkpads came with tons of extra buttons affectionately knows as special keys. See here for a full list of the keys and the actions they triggers. All the keys work out of the box except for the Access IBM next to the Esc key and the Previous and Next Page keys on either side of the up arrow key.

For as long as I can remember I've key those keys to do the following.

Pushing the Access IBM key launches my terminal. I'm always in the terminal, so this is convenient and easy.

Pushing the Previous Page key moves to the workspace on the left, while the Next Page key moves to the workspace on the right. I work with many applications at a time with lots of opened windows, so having multiple workspaces and an easy way to access them makes life much easier.

Friday, August 1, 2014

Better font rendering in Xubuntu

Xubuntu is a great distro but I never liked the way it rendered fonts. Through trial and error I've come up with the best font rendering settings for me. Basically, I went to settings ---> Appearance ---->Fonts. Then I change the fonts to Ubuntu + regular + 10. See image for more details.

Fonts settings in Xubuntu
To fix font rendering in system wide, especially in Firefox, follow the advice in this blog post.

Saturday, July 26, 2014

Make GIMP interface look like Photoshop

I love GIMP and I've been trying to learn how to use it for image processing. However, I've gotten quite good at using Photoshop and the thought of learning a new interface and work flow is not appetizing. To that end, I did some googling and discovered that GIMP can be themed.

I installed a great theme that mimicked the Photoshop interface and I must say it looks pretty darn good. It's almost like I'm using Photoshop. See images below and judge for yourself.

GIMP with Photoshop theme.
So far I've not noticed any issues with GIMP and everything works as it should. Now if I can only do the same with Inkscape and Scribus, I would be golden.

Wednesday, July 23, 2014

Enable hibernation in Xubuntu 14.04

Hibernation is disabled by default in all Ubuntu-based distributions because of problems in some laptops. However, it works fine on my Thinkpad. I do not use hibernation much, but sometimes I want to switch batteries without closing all my applications.

Before enabling hibernation, test that it works on your machine by running the following code.
sudo pm-hibernate

If hibernation works, enable it permanently by opening, with sudo,
/var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

Then find the two sections below,
[Disable hibernate by default in upower]
[Disable hibernate by default in logind]

Finally, change
ResultActive=no” to “ResultActive=yes” in both cases.

Restart your computer and you should be able to hibernate your computer from the power menu.

Tuesday, July 22, 2014

How to monitor Thinkpad power consumption in Xubuntu

I received my new battery yesterday and was curious about my laptop's power consumption. I did some searching and found the perfect tool. It's a small command-line application called powerstat. It's easy to run and available in the package manager.

Output of powerstat

 

To install powerstat

sudo apt-get install powerstat

Saturday, July 19, 2014

Installing Tex Live 2014 and using LaTex in Xubuntu 14.04

I got into the LaTeX game late--after I had already written my PhD thesis--but I am glad I discovered it and now I use it all the time to write reports, letter and anything I will export to PDF and want to look nice.

Installing LaTeX on the mac is as simple as installing the MacTex.pkg, which also includes LaTeX editors, a bibtex reference manager, a spell checker and an equation editor.

On the linux side of things, it's not as simple to get the latest release of TeX Live but not that difficult. You should know that Tex Live 2013 is available in the Ubuntu repositories and can be installed with synaptic. However, I wanted the latest release.

Install Texlive 2014

I used a script by  Scott Kosty to install the latest version of TeX Live. Literally, all you have to do is down and run the script and have a cup of coffee while the script downloads, installs and configures LaTeX.


Texlive 2014 installed

UPDATE 1:

I've decided that the full Tex Live install is overkill and I will probably never use most of it. Plus all the extra fonts increased Inkscape's startup time from a few seconds to almost a minute. So, I uninstalled the full Tex Live 2014 and install the following Tex Live 2013 packages from the Ubuntu repos.

  1. texlive-base , 
  2. texlive-latex-recommended 
  3. texlive-fonts-recommended 
  4. texlive-lang-eng
I tested this install with a few existing tex documents and it worked fine.

Install a LaTeX editor

There are many latex editor for (X)ubuntu to choose form. I tried Texstudio, Gedit with latex plugin and a few others, but I eventually settled on Gummi, which is lightweight and simple with an integrated PDF viewer. I installed Gummi using the synaptic package manager.

Gummi LaTex editor

UPDATE:

Gummi apparently can only run bibtex, but I use biblatex with biber. Unless an update is released that support biber, I will use TexStudio for editing latex documents.

TexStudio

Install a bibtex reference manager

For writing reports that require references and a bibliography, using bibtex is the way to go. The most well-know bibtex editors available for linux is JabRef , but I like Pybliographer, which is lightweight and simple. The version in the Ubuntu repositories is outdated so I downloaded a .deb of the latest version of from the website and installed with GDebi.

Bibtex file editor


With those applications you are now ready to write beautiful, well-formatted documents.