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.
This blogs chronicles my adventures running linux on old IBM Thinkpads. My current model is an IBM T42p running Xubuntu 14.04 LTS
Wednesday, November 26, 2014
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.
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.
To fix font rendering in system wide, especially in Firefox, follow the advice in this blog post.
Fonts settings in Xubuntu |
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.
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.
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. |
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.
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 powerstatSaturday, 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.
With those applications you are now ready to write beautiful, well-formatted documents.
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.- texlive-base ,
- texlive-latex-recommended
- texlive-fonts-recommended
- texlive-lang-eng
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.
Friday, July 18, 2014
Package management in Xubuntu
Xubuntu ships with the bloated, clunky, slow and ugly Ubuntu Software Center. I always remove this monstrosity from my system and replace it with more sensible options that run great on old machines.
For installing apps in the Ubuntu universe, I install Synaptic Package Manager. This is the old G of package management. I use it for updating, installing and uninstalling applications, adding and removing repositories and other package management tasks.
For installing DEB files downloaded from the internet, I use GDebi. GDebi is a simple application that also fetches dependencies if needs be.
To remove Ubuntu Software Manager
sudo apt-get autoremove software-center
Software Center |
For installing apps in the Ubuntu universe, I install Synaptic Package Manager. This is the old G of package management. I use it for updating, installing and uninstalling applications, adding and removing repositories and other package management tasks.
Synaptic Package Manager |
For installing DEB files downloaded from the internet, I use GDebi. GDebi is a simple application that also fetches dependencies if needs be.
GDebi |
sudo apt-get autoremove software-center
To install Synaptic Package Manager
sudo apt-get install synaptic
sudo apt-get install synaptic
To install GDebi
sudo apt-get install gdebi
sudo apt-get install gdebi
IBM T42p RAM upgrade and new (used) 9-cell battery
My IBM T42p came with 1.5 GB of RAM--a 500 MB stick in the slot under the keyboard and a 1 GB stick in the slot on the back of the machine. Don't get me wrong, 1.5 GB of RAM is not bad, especially using Xubuntu. However, the machine can address a maximum of 2 GB, so I wanted to max it out.
I had an old 1 GB stick around the house from the old PC2700 DDR days, so I removed the keyboard and replaced the 500 MB stick with the 1 GB stick. See instructions for removing the keyboard below.
My Thinkpad came with a pretty crappy battery that lasted a cool 30 minutes. This meant, I was pretty much tethered to my outlet with the AC adaptor. I wanted a better battery, so I went to eBay. I bought a SANYO replacement (not genuine IBM/Lenovo) that was dead on arrival (DOA), but the seller gave me a refund. With the refund, I then bought a genuine--but used--IBM/Lenovo 9-cell battery that was guaranteed to last at least 3 hours.
I'll update this blog post when I receive my new (old) battery.
UPDATE:
The 9-cell battery I purchased on eBay arrived today and it looks like a great purchase.
It's been through only 3 charge cycles, and retains 96% of the designed charge capacity. With this capacity I should get between 3.5---4 hours of battery life between charges. See the tlp stats below.
I had an old 1 GB stick around the house from the old PC2700 DDR days, so I removed the keyboard and replaced the 500 MB stick with the 1 GB stick. See instructions for removing the keyboard below.
My Thinkpad came with a pretty crappy battery that lasted a cool 30 minutes. This meant, I was pretty much tethered to my outlet with the AC adaptor. I wanted a better battery, so I went to eBay. I bought a SANYO replacement (not genuine IBM/Lenovo) that was dead on arrival (DOA), but the seller gave me a refund. With the refund, I then bought a genuine--but used--IBM/Lenovo 9-cell battery that was guaranteed to last at least 3 hours.
DOA SANYO replacement battery |
I'll update this blog post when I receive my new (old) battery.
UPDATE:
The 9-cell battery I purchased on eBay arrived today and it looks like a great purchase.
New 9-cell battery |
It's been through only 3 charge cycles, and retains 96% of the designed charge capacity. With this capacity I should get between 3.5---4 hours of battery life between charges. See the tlp stats below.
My new 9-cell battery is awesome |
Thursday, July 17, 2014
Essential applications on a new Xubuntu install
Xubuntu is a pretty bare boned system, which makes it fast and lightweight. It's also easy to customize and really make your own. Following are a few things I did to customize my Thinkpad to my work flow.
Power Management
For advance power management I installed tlp. See site for details.
Office Suite
Xubuntu ships with Abiword for word processing and Gnumeric for manipulating spreadsheets. These programs are lightweight and easy to use, but not powerful enough for my needs. The obvious choice is LibreOffice, but I decided to go with Kingsoft Office. Kingsoft has been around for a while but only recently ported their office suite to linux. Although, it's still in alpha testing the applications are powerful, the UI is familiar and they are completely compatible with Microsoft Office generated files. Download here.
Design and graphics
For editing images, creating illustrations and page layouts, I use Gimp, Inkscape and Scribus, respectively. These are all available from the application center.
Internet
I use Firefox browser, which ships with Xubuntu. I added the Adblock Plus and Youtube HTML5 extension. I uninstalled Thunderbird and installed Geary mail client.
Python development
I use the Geany IDE for working with Python.
More to come later...
Power Management
For advance power management I installed tlp. See site for details.
Office Suite
Xubuntu ships with Abiword for word processing and Gnumeric for manipulating spreadsheets. These programs are lightweight and easy to use, but not powerful enough for my needs. The obvious choice is LibreOffice, but I decided to go with Kingsoft Office. Kingsoft has been around for a while but only recently ported their office suite to linux. Although, it's still in alpha testing the applications are powerful, the UI is familiar and they are completely compatible with Microsoft Office generated files. Download here.
Presentation Application |
Spreadsheet Application |
Word Processor |
Design and graphics
For editing images, creating illustrations and page layouts, I use Gimp, Inkscape and Scribus, respectively. These are all available from the application center.
Gimp |
Inkscape |
Scribus |
I use Firefox browser, which ships with Xubuntu. I added the Adblock Plus and Youtube HTML5 extension. I uninstalled Thunderbird and installed Geary mail client.
Python development
I use the Geany IDE for working with Python.
Geany |
Installing Xubuntu 14.04 LTS on an IBM T42p Thinkpad
First off, I decided to go with Xubuntu because it was more resource and user friendly compared to Ubuntu or Kubuntu. Also the interface felt more natural to me because I'm an OS X user both at home and work.
Downloading Xubuntu 14.04 LTS and creative LiveCD
Running the Live environment
Fix for on-screen display for volume and brightness changes
Downloading Xubuntu 14.04 LTS and creative LiveCD
- Get the 34 bit iso from xubuntu website
- My Thinkpad came with XP, so I used LiveUSB Install to create a bootable USB with the iso.
Running the Live environment
- With the LiveUSB in the usb port, I restarted the computer and entered BIOS where it can the boot order to check for usb boot drives before my hard drive. Restart again.
- The boot failed because my IBM T42 does not have PAE enabled. The get boot to work use these instructions (see summary).
- Play around with the Live environment to make sure that the keyboard, trackpad and track point work.
Install Xubuntu
- Double click on Install Xubuntu to install the operating system.
- From my 60GB HD, I create swap (2GB), root / (20GB) and home (rest of drive) partitions.
- After installing, restart computer and remove the LiveUSB. You may also want to change to boot order so that the hard drive boots first but this is optional as it only add a few seconds to the boot each time.
Xubuntu is awesome on the T42p. It's fast and all my hardware is recognized without any issues. There were only three issues I had to deal with.
The default screen locker has a nasty bug, which prevents the display from powering up after sleep. When this happens, you will have to force logout or restart and lose all unsaved documents or edits. To remedy this, I uninstalled light-locker (sudo apt-get purge light-locker light-locker-settings) and install xscreensaver (sudo apt-get install xscreensaver).
UPDATE 1:
The problem with light locker has been fixed. xscreensaver is no longer required. I've moved back to light locker and it works great.UPDATE 2:
There are still lingering issues with light locker in Xubuntu. To get the system to work properly, set light locker to lock session "When the screensaver is deactivated." See screenshot below.Light locker settings |
Fix for on-screen display for volume and brightness changes
The volume, mute and display brightness buttons worked but there was no on-screen display when the buttons were pressed. I fixed that by:
sudo -i
cp /sys/devices/platform/thinkpad_acpi/hotkey_all_mask /sys/devices/platform/thinkpad_acpi/hotkey_mask
gedit /etc/rc.local
Add Line: cp /sys/devices/platform/thinkpad_acpi/hotkey_all_mask /sys/devices/platform/thinkpad_acpi/hotkey_mask
Fix to unlock keyring on login
cp /sys/devices/platform/thinkpad_acpi/hotkey_all_mask /sys/devices/platform/thinkpad_acpi/hotkey_mask
gedit /etc/rc.local
Add Line: cp /sys/devices/platform/thinkpad_acpi/hotkey_all_mask /sys/devices/platform/thinkpad_acpi/hotkey_mask
UPDATE 1:
Systemd is disabled on newer Xubuntu release. For the above to work systemd has to be activated. See this page to instructions.Fix to unlock keyring on login
The login keyring not opening after logging in. This can be fixed by:
My New (Old) Thinkpad has arrived
I'm a big Thinkpad fanatic--have always been. Recently, I saw an old IBM T42p on eBay for $80 and immediately purchased it. I thought it was a good deal considering that it originally cost almost 3 grand in 2005. I have a late 2011 15" MacBook Pro that I used for work and when I need lots of computing power, but I love playing around with the Thinkpad for everything else
The laptop has a large and bright 14.1" screen with 1400x1050 resolution. It has a 1.8GHz processor and came with a 1.5 GB of RAM and a 60GB Hitachi HD.
It came with Windows XP SP3 installed and not much else. Since, XP is no longer support I've decided to run Xubuntu 14.04 LTS, which is supported until 2017. I opted for Xubuntu because of its resource friendly and works great on older machines.
This blog serves two purposes:
The laptop has a large and bright 14.1" screen with 1400x1050 resolution. It has a 1.8GHz processor and came with a 1.5 GB of RAM and a 60GB Hitachi HD.
It came with Windows XP SP3 installed and not much else. Since, XP is no longer support I've decided to run Xubuntu 14.04 LTS, which is supported until 2017. I opted for Xubuntu because of its resource friendly and works great on older machines.
This blog serves two purposes:
- A place for me to keep a record of everything I did to the system. This is essential because I know I will break the system in the future because I'm always messing around with configuration files and installing unstable applications from untrusted sources.
- I decided to keep a blog so that others trying to run linux on old Thinkpads can learn from my experience and avoid spending hours in forums looking for solutions to problems that I've already encountered and solved.
Subscribe to:
Posts (Atom)