Posts Tagged ‘Ubuntu’

Kindle Touch landscape mode – Ubuntu / Linux fix (my solution…)

December 5, 2011

I got my Kindle Touch Wi-Fi with special offers last week. More info on this nice device at the Amazon Kindle Touch page, the Kindle Wikipedia article page, and of course Google searches will do you lots of good.

Granted I’m busy so I’ve not been able to maximize its use yet but I’ve been able to play with it and organize my books and personal documents already. Overall I like the look and feel and functionality of the Kindle Touch (or KT) and I believe you can search reviews with Google, including this good Kindle Touch review by CNET. For reading novels in the native formats accepted by Kindle (e.g. .mobi, .azw files) the pinch-and-zoom as well as the swipe (or just tap) to go to the next/previous page, among other features of KT, are great.

As a researcher though I have lots of PDFs to read, many of which have text formatted in mathematical notation (such as those made using LaTeX). Of course KT can handle PDFs, and even though you could pinch-and-zoom as well as swipe to pan through a page or through pages, reading a PDF  file this way can be really cumbersome especially since the default orientation of viewing in KT is portrait mode. It would be nice if we can rotate the KT to landscape orientation to better read PDF files. However, according to an official statement from a Kindle Customer Support representative, landscape mode is not available on KT. Bummer. I immediately emailed Amazon at kindle-feedback@amazon.com (all of you should! 🙂 ) asking for future software/firmware update to automatically change orientation in KT, and when might this be.

Right now, a sort of “hack” is possible to allow Ubuntu (and other GNU/Linux distros) users like myself to read our PDF books and files in landscape mode in the KT. An answer is to use the pdftk commandline tool which I made a post about some time ago. You can also refer to the man page of your GNU/Linux distribution after installing pdftk. In Ubuntu, a simple and quick apt-get or Synaptic installation should  do the installation job for you (check my post about pdftk above, or search this blog). The “hack” goes like so:

Say you have a PDF file named mydoc.pdf. To rotate the entire PDF file (assuming it is in portrait orientation by default) 90 degrees counterclockwise (so now the mydoc.pdf is now in landscape orientation) fire up a terminal and type:

$ pdftk mydoc.pdf cat 1-endW output tmp.pdf

Where tmp.pdf is the desired output filename of the re-oriented (now in landscape) version of mydoc.pdf. Now you can copy or email the file tmp.pdf to your KT and read your PDF file in landscape mode. 🙂 I’ve yet to check if pdftk works in Mac OS (I won’t be surprised if it does) though I believe this pseudo-hack might turn out to be more “graphical” or point-and-click in nature than my commandline solution above. 🙂 A user from the Amazon KT support page above mentioned using a professional version of Adobe reader to graphically do this, perhaps in Windows and in Mac OS as well. I’d appreciate if somebody would post a link on how to do this graphically in Ubuntu (GNU/Linux), Mac OS, and even in….Windows… 😉 🙂

Happy hacking and Kindling. 🙂

SVN over HTTP

January 31, 2011

Hello there true believers, been a while since I’ve written something here.


A quick FYI on those wanting to use SVN but are restricted to use it from within a network with a proxy.
If you try using SVN over HTTP, it most likely won’t work by default since SVN uses a different network port (usually 3690 for *nixes) and HTTP proxies by default use 80 or 8080 as their ports.
If you try checking out or updating or committing to/from an SVN repo by default, you’ll run into a problem saying SVN couldn’t connect. Uh oh spaghetti-oh. 🙂
In my Ubuntu 10.04 machine, what I do is open (with sudo/root properties) the file:

/etc/subversion/servers

and uncomment (or add, if the following are not present) these parameters:

http-proxy-host = yourproxy.com
http-proxy-port = port

e.g.

http-proxy-host = 10.10.10.10
http-proxy-port = 8080

I save the file, then try SVN again. Voila. I’m back to coding again. 🙂

Reference/s:

Virtualbox shared folder access: Mac OS X host with Ubuntu 10.04 as guest

November 13, 2010

Whew. It’s been a while since I’ve done anything here. 🙂 Now time to do some geeky blogging (and so much more soon) once again mis amigos y amigas. 🙂

Tech specs of the setup

(Host)

Mac OS X Version 10.5.8

$uname -a

Darwin theorylabs-P-System-iMac.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

VirtualBox (non-OSE version, but still free) Version 3.2.10 r66523

(Guest)

Ubuntu Lucid Lynx 10.04 32bit

Setting it up

Essentially just add a shared folder using VirtualBox, whether a VM is running or not. In the guest OS, create a directory where you want your host OS’s files to be mounted (with R or R/W permissions).

Then in the guest OS make sure that the guest additions are successfully installed already. This step is easily and quickly done by mounting the ISO into the guest OS, then allowing Ubuntu 10.04 to detect an autorun script. It will warn you that the running of certain scripts can pose a threat to your system, so we go ahead knowing that the ISO is from Oracle. Otherwise, you can run the script by double-clicking on it or using a terminal.

Once the guest additions have been successfully installed, the following command should mount the host OS’s folder onto the newly created folder in the guest OS which we just created from above:

sudo mount -t vboxsf virtualbox_shared_folder_name guest_os_directory_path

Where virtualbox_shared_folder_name is the name of your host OS’s folder which you entered in the VirtualBox shared folder setting, which may not necessarily be the real directory name of the directory you want to share from your Mac OS X.  guest_os_directory_path is the newly created folder from above awhile ago.

A note on the virtualbox forums, several users say that changing one’s directory in the guest OS to / (root directory of the filesystem) helps, although this wasn’t the case for me.

Hope that helps ladies and gents. Questions are very much welcome. 🙂

Reference/s:

Thoughts on Ubuntu/Kubuntu 9.10

December 2, 2009

After more than a month since Ubuntu/Kubuntu 9.10 codename Karmic Koala was released, here are some thoughts and noteworthy things about it:

Grub2

Ubuntu 9.10, among other recent Linux distros, now uses Grub2. I didn’t read all the release notes, and when I suddenly became curious at taking a look at my menu.lst to see what Grub2 has in store for me, I was in for a surprise. Grub2 doesn’t use menu.lst anymore. It seems menu.lst is already part of legacy Grub. Initially I disliked this, having used menu.lst since I started Linux (6 years ago). The menu.lst has now been superseded by the /boot/grub/grub.cfg file. However, the grub.cfg file is preferably not to be edited by the user, as it is automatically generated by other scripts such as grub-mkconfig. Now I think it’s a good idea to have this boot file editable by a script, which has rigid syntax and rules in order to properly create a boot config file. Of course, nobody is really stopping the hacker inside any of us to not edit the file, nor to create our own menu.lst, or even to revert to legacy Grub versions.

source/s:

Xorg

Ubuntu 9.10 also uses the updated version of Xorg  (as of typing this I use version 1.6.4) doesn’t use an xorg.conf anymore. As Ben Grim/The Thing puts it, “What a revoltin’ development!”. Again initially I was irked by this, but later I also realized it was for the better, since xorg.conf was becoming too cryptic for newer users of Linux. Now the xorg.conf tasks are being handled by several other config files and scripts.

Which got me thinking, since xorg.conf has already been deprecated, what of the ctrl+alt+backspace that we (or at least I) have grown to love when restarting X? It turns out, the ‘dontzap’ option didn’t work anymore, I tried it. The ‘dontzap’ directive worked for 9.04, but apparently not so for 9.10 onwards.  As a result, one way to turn on ‘ctrl+alt+backspace’ back in Kubuntu via graphical method is as follows:

Enabling Ctrl-Alt-Backspace for Kubuntu

  • Click on the Application launcher and select “System Settings”
  • Click on “Regional & Language”.
  • Select “Keyboard Layout”.
  • Click on “Enable keyboard layouts” (in the Layout tab).
  • Select the “Advanced” tab. Then select “Key sequence to kill the X server” and enable “Control + Alt + Backspace”.

Or, for command line folks like me, by doing

setxkbmap -option terminate:ctrl_alt_bksp

source/s:

Deprecation of hal

Several scripts, including devkit-power and devkit-disks are being used as replacements for hal. So far no issues here, and I think so far power as well as disk management in 9.10 is doing great. I do still see hald running in my machine, wonder why that is.

Some caveats and surprises

I’ve had several issues regarding my initial install of Kubuntu 9.10 32 bit desktop. One was Dolphin crashed a few times while I was dragging and dropping files to VLC’s playlist window. These crashes happened in the first 2 to 3 weeks of my installation, regardless of my constant updating of the system. The great thing however is that KDE wallet, coupled with the revamped bug reporting of KDE 4.3.X/Kubuntu 9.10 makes it so much easier to report bugs nowadays. Eat your heart out Micro$oft. 🙂 I do wish they’d fix and close the bug soon. 🙂

I haven’t really been using Konqueror a lot lately since Kubuntu 9.10 now has an ‘Install Mozilla Firefox browser’ option included, even in the live version of the OS, which is nice. In the KDE 3.5.X era I used Konqueror a lot, not as a browser but as a very useful file, ssh, ftp, samba, whathaveyou browser. Nowadays Dolphin is all that except a browser. I can still use Konqueror as my main file browser though, I might try that some time. But I’ve grown to slowly accept Dolphin in my day to day computing tasks. The previews, zoom in/out sliders,  different panels, and the widget make of Dolphin make it a delight to use. So so far no issues with Konquer in 9.10 yet.

Dolphin also makes management of drives a breeze, whether they be internal (IDE, SATA etc.) or external (USB drives, media players etc.). The Oxygen theme also looks very sleek and futuristic.

As with my installation of Ubuntu 9.04, ext4 was a marvel to behold, more so since the 9.10 version uses ext4 by default. Even with apache2 and mysql running at boot, my boot time is well under 30 seconds, even with older single core procs.  Scripts like ureadahead make booting much faster.

Conclusion – for now

Other than perhaps minor setbacks I forgot to mention, plus the introduction of some new technologies I listed above, the 9.10 version of Ubuntu/Kubuntu is a marvelous piece of work, stability, dependability,  and usability wise in my opinion. So far. Can’t wait for 10.04/Lucid Lynx.

Ubuntu, Ubuntu 9.04 Jaunty Jackalope, MSI Wind netbook, and everything in between

April 30, 2009

I just downloaded Ubuntu 9.04 codename Jaunty Jackalope (let’s call it Jaunty for brevity’s sake). I’ve been very occupied the past few days with my morning and afternoon/evening work that’s why it took me this long to sit down and check out Jaunty.  And this post is a quick overview of what’s it like to experience Jaunty, specifically over my MSI Wind U100x.

Aesthetics

Jaunty looks much sleeker and more streamlined than previous Ubuntu incarnations, as shown by the loading splash image.

The login screen has also been revamped and kind of feels more like KDE (which isn’t bad in my opinion).

The geeky stuff

Jaunty gives you the option to install your system using the new ext filesystems, ext4. I tried it out and though I haven’t done any timing tests, the bootup from a clean install seems to be slightly faster. Of course, ext4 has been released for quite a while now and one more reason to use it other than it improves upon the performance of ext3 is that Ubuntu usually never releases/allows untested software (filesystems not the least of these) so you can be pretty sure ext4 is a safe bet. Plus, there’s support from Canonical.

I’m still plowing through Jaunty but the news is that ctrl+alt+backspace, used for restarting the X server, doesn’t work by default. To turn it on, edit your xorg.conf and add:

Option "DontZap" "false"

to the ‘ServerFlags’ section which you should also create/add. The result should look something like

Section "ServerFlags"
    Option         "DontZap" "false"
EndSection

and can also be quickly resolved via a quick Google search. If you want to turn off the restarting effect of ctrl+alt+backspace, then change ‘false’ to ‘true’. More info here.

The boys and girls at the MSI Wind forums have been talking about how Jaunty works in MSI wind. The MSI Wind wiki even has an entry for Jaunty found here, though I must say I didn’t really need much or even all of it to make everything run on my Wind. I’m also quite surprised that that wiki is pretty updated, last updated April 30 when I checked last. The webcam, wi-fi (which is quite surprising since it’s been plagued with problems since Hardy and Intrepid, the 2 previous Ubuntu releases before Jaunty) and others work after a fresh install. Of course for the web cam, you’d have to install a web cam softwaree like Cheese for example, which is readily available in the list of availabe software for download. No config whatsoever as written by the links I gave above. That hassle free setup is kind of scary (at least for me) since I usually like fiddling with my *nix box via the console, but then again nothing is really stopping me right?

Ubuntu 8.04.X (Hardy Heron) wi-fi on Wind

As for making wi-fi run on Hardy, I essentially followed what’s been written here in this part of the MSI Wind forum, particularly this section:

First, you need a proper build environment with the appropriate kernel headers. This is done fairly easily:

Code:
sudo apt-get install build-essential linux-headers-`uname -r`

Next, download and unpack the modified driver sources:

Code:
wget http://scopeboy.com/things/rtl8187se_linux_26.1012.0331.2008_modified.tar.gz
tar xvzf rtl8187se_linux_26.1012.0331.2008_modified.tar.gz

Now build them. Note that you’ll need to set an environment variable in order to avoid a certain problem:

Code:
cd rtl8187se_linux_26.1012.0331.2008
export KBUILD_NOPEDANTIC=1
./makedrv

Now, assuming everything compiled without errors, try starting it all up using the wlan0up script. This will insert the appropriate modules and enable the wireless device. You should then be able to use it with Ubuntu’s network manager.

Code:
sudo ./wlan0up

One other thing to note here is that the person who wrote the piece above was using 8.04.1, and not just 8.04, so it may not necessarily work for you. What you do is just download (from the same forums) the tar.gz driver appropriate for your Hardy version. I myself was using 8.04.2 so I used a .1016.0331 driver package instead of the .1012.0331 shown above. The you can install programs like wi-fi radar (to install it just run ‘apt-get install wifi-radar’) to scope out existing wifi networks around you.

The cool commandline tool I like using is iftop  (apt-get install iftop). The tool iftop shows you what networks/hosts/IP addresses you are connecting to or they to you. It also shows you all the traffic that goes your network card’s way. You run it via

    sudo iftop

which by default let’s you view your first NIC which is usually your wired connection so you do a

    sudo iftop -i wlan0

to view the traffic passing through your wireless card (just replace wlan0 with whatever the command ifconfig gives you as the device name for your wifi card). Then assuming you followed the steps above correctly and you didn’t encounter an error, you should be seeing arrows pointing to and from your IP address coupled with the download and upload speeds (in Bytes, KB or even MB depending on how fast your wireless connection is).

Verdict

So if you really want to stick with Ubuntu’s current LTS (i.e. Hardy) since it gets software updates till 2011, then try the trick above to make your wifi run. Otherwise if you don’t really mind updating your system every 12 months or so, then go for Jaunty. Look and feel and performance is topnotch. So far 🙂 But knowing Ubuntu’s history on software updates and support, plus the huge community and industry support/help you can get, it’s more than enough I think to make you switch from the ‘other’ popular operating system with 4 colors 🙂

rdesktop in Linux + Ubuntu vulnerability and fix

October 22, 2008

I’ve been working back and forth from one of my PCs running a Windows XP (note: I’m in no way promoting the use of Windows here 🙂 ) for some tests I’m doing, and this has continued for many days already. Then (unfortunately, this took me several days to realize) I hit an epiphany: Why don’t I do something so that I won’t have to get up from my seat everytime I need to check up on my Windows PC? The solution? Why rdesktop in Linux of course! Not VNC and not virtualization. Actually I already had a virtual machine running Window$ (the dollar sign there isn’t accidental) but I needed a real machine/PC which will run Window$ [sic], since software such as DirectX require specific hardware which cannot usually be duplicated by virtual machines. rdesktop is particularly useful if you want to graphically control your Windows machine remotely, that is, control your own desktop and computer just like you were sitting in front of it. You can also use it to help others diagnose their PCs for example.

To install it in a machine running Ubuntu or Debian, just do a

$ sudo apt-get install rdesktop

The way to use it is actually very simple:

$ rdesktop  host

And then just replace the host part with the network or IP address of the PC you want to connect to. In your Windows PC, right-click on your My Computer and then click Properties. Then on the Remote tab, you can then enable there the Remote Desktop functionality. This will then allow people who have user accounts on that Windows machine to remotely connect and control/view their Windows desktops. Of course, since we’re talking about Windows here, might as well talk about security. One of the most obvious ways is to always create accounts with passwords, unless you have a very good reason to allow no password logins. Another is if you’re going to use remote desktop over the Internet, better setup a firewall with port forwarding to the Windows PC you’re connecting to (by default it’s port 3389 for remote desktop).

Doing a

$ man rdesktop

Will give you a load of other options such as compressing your data before transmitting them over the network, which conserves bandwith albeit with the added computing resource cost, for example.

Lastly, don’t think that us Linux users, with the built-in (down to the kernel level) security, can sleep calmly at night. There is a vulnerability in rdesktop (particularly in Ubuntu) as stated below:

It was discovered that rdesktop did not properly validate the length of packet headers when processing RDP requests. If a user were tricked into connecting to a malicious server, an attacker could cause a denial of service or possible execute arbitrary code with the privileges of the user. (CVE-2008-1801)

==Ubuntu Security Notice USN-646-1  September 18, 2008rdesktop vulnerabilities
CVE-2008-1801, CVE-2008-1802, CVE-2008-1803==

A security issue affects the following Ubuntu releases:

Ubuntu 6.06 LTSUbuntu 7.04Ubuntu 7.10Ubuntu 8.04 LTS

In order to fix this dilemma, it is advised to upgrade to the following (depending on what Ubuntu version you’re using):

Ubuntu 6.06 LTS:  rdesktop                        1.4.1-1.1ubuntu0.6.06.1

Ubuntu 7.04:  rdesktop                        1.5.0-1ubuntu1.1

Ubuntu 7.10:  rdesktop                        1.5.0-2ubuntu0.1

Ubuntu 8.04 LTS:  rdesktop                        1.5.0-3+cvs20071006ubuntu0.1

Check your installed rdesktop version with the ones above in order to fix the vulnerability. Click here for more information on the vulnerability.

And again, while I’m at it, I’ll include another not so new but pretty alarming vulnerability in Debian based distributions which use ssl for encryption. The vulnerability and fix for Debian is here, as for Ubuntu, click here.