Archive for the 'linux' Category

Virtual Workspaces

Thursday, November 20th, 2008

I was going through my Google Reader recently and I saw this post about workspaces and started thinking. Didn’t I do a post like that before? I mean, I probably had to, right? Out of all the topics out there, I’m pretty sure I had to mention this at one time or another. Besides, I have a vague recollection of writhing about it.

It turns out I was right. I did write about it last year. Thank you Google! You are by best friend, and nowadays that I actually figured out the site map thing (and by that I mean I found a plugin that will generate them for me) and I’m all indexed up you often work better than the shitty Wordpress search. You know what I’m talking about no? If you don’t look for the search box on top of the side bar. That defaults to the internal Wordpress search, but I might actually switch it over to the googles one of these days.

Anyways, I digress. Digressing is probably one of the things I do well. It is also one of the reasons why my posts are longer than they need to be most of the time. The other is my tendency to use seven sentences where one would be enough. Being concise is a skill that I have never mastered. I am always amazed when people take my 15 minutes of rambling and abstract it into a 5 words or less. I’m like - wow! Yes, that’s exactly what I meant. Of course being a long winded writer has some benefits - for example I never had to worry about meeting length requirements on school papers. My friends were doing all these tricks with changing the font size, changing the face to the widest one available. I’d just write the damn essay, notice it is 3 pages to long, then cut some stuff out, rewrite bits to be shorter and I was done. And that was when I was speaking strictly on topic. Not like I’m doing now.

Anyway, I re-read my earlier post and decided that - what the hell - let’s talk about this again!

How do you organize your virtual workspaces on your machine? Do you organize your windows based across worskpaces based on some sort of order, or randomly assign them to the virtual desktops on a first come first served basis. I’m surprisingly organized when it comes to my worskspaces. Surprisingly, because you wouldn’t be able to tell that if you had seen my actual desk where everything is arranged using a stack methodology. ANd I mean that literally - I stack things on top of each other until they fall off which is what I call a natural stack distribution.

My virtual workspaces however are nearly arranged like this:

workspaces.png

It pretty much goes like this:

  1. Email - first workspace is always for work/school email. My personal email lives on the second desktop because it is web based, but my work and school emails live inside Kmail and always are located on the workspace number one.
  2. Web - second desktop is for firefox, and assorted windows that I use for web browsing, downloading shit from the web and etc..
  3. Code - third desktop always holds my IDE. More often than not it is Komodo Edit which I like because it has limited vim bindings. Sometimes it is Eclipse though.
  4. Virtual Machines - my windows XP instance lives here. I use it to run shitty Windows only software like Monarch, Office 2007 and some other proprietary apps that my company supports.
  5. Stuff - this is the workspace where I open all the random windows that don’t fit anywhere else - like Dolphin for file browsing, random shell windows, random Vim windows, and sometimes Gimp when I need to edit some images (which is almost never)
  6. Remote - last worskpace is reserved for remote desktop sessions for the servers that I maintain. Usually they are rdp sessions, but I sometimes I have a VNC window there (for remote support stuff)

How about you? How do you organize your desktops?

Oh, a word about windows - I have yet to find a virtual desktop manager for that OS which would work the way these things work in Linux. The MS Powertoy is slow and buggy in my experience. I found the popular VirtuaWin to be ass backwards and counter intuitive when it comes to moving window across the desktops. The Sysinternals Tool is nice but so bare-bones that it doesn’t even have the functionality to move windows between desktops. Virtual Dimension was possibly the only tool that I knew off that would actually show you what is on which desktop (the way KDE pager does) but it did not integrate into the task bar, and it has not been updated in over 3 years. So meh… I’m not using workspaces on my Windows box. Then again I hardly do any coding on Windows anymore and for entertainment I usually either run Firefox or fullscreen video games so I don’t really need the virtual worskpace functionality for that.

Any suggestions for a working windows virtual desktop manager though?

Ubuntu: Change Sensitivity of the Synaptics Touchpad

Tuesday, October 28th, 2008

I hardly ever use the touchpad on my laptop. At work, my morning routine is plugging in my external monitor, ethernet cable and the USB hub into the back of my machine. Yes, I could get a docking station but why bother? I have a little USB hub on my desk where I connect my mouse, keyboard, the external drive for backups and occasionally a flash drive or two. It is almost like a desktop replacement which it practically is. Dell Latitude 830 is a monster of a laptop. I love this machine but it is big and bulky and definitely designed to be stationary more than portable.

Today I had the crazy idea of walking around with it and using it as a normal person would use a laptop. Bad idea! It is nice to have that big wide screen when you work on this machine but it really was quite unwieldy when I was trying to carry it and a stack of papers around the building. Not to mention that the suspend to disk just does not work on that machine. Not that I’m surprised. I have never owned, nor seen a Linux laptop in which ACPI functions such as suspend or hibernate would work with any degree of reliability. If you have one, congratulations! I envy you. Perhaps Hardy will solve my issues once I finally upgrade to it. But I digress…

I took the laptop with me to the classroom without an external mouse and noticed two things. One, my keyboard was dusty showing how often I actually use this machine as a laptop. Two, my touchpad was sluggish. Quick glance at the KDE System Settings panel assured me that there was no such thing as touchpad settings applet. One was clear - I had to do something. I tried using the rubber nipple (yes this a technical term) located between my G and H keys but that thing is so inaccurate it is not even funny. It is like trying to mouse around with a Joystick - something that I actually did quite a few times back on Amiga when I was to lazy to plug in a mouse in between games. It will get things done, but it is neither pleasurable nor productive.

So I decided to fix this. Quick google told me that all I really needed to do was to add few short lines to xorg.conf. Look for the following section in your file:

Section "InputDevice"
    Identifier     "Synaptics Touchpad"
    Driver         "synaptics"
    Option         "SendCoreEvents" 	"true"
    Option         "Device" 		"/dev/psaux"
    Option         "Protocol" 		"auto-dev"
    Option         "HorizEdgeScroll" 	"0"
    Option	     "MinSpeed"		"1.0"
    Option	     "MaxSpeed"		"1.8"
    Option	     "AccelFactor"	"0.3"
    Option	     "MaxTapTime"	"0"
EndSection

This is how mine looks right now, which is after applying the changes. You see, I added the MinSpeed, MaxSpeed and AccelFactor options to this section. You might need to play around with the numbers but keep in mind that the higher the MaxSpeed the less control you have over the cursor. At 1.8 my touchpad is a bit jumpy but I can swipe it from corner to corner of my screen without picking up my finger which is what I wanted. I’d say that 1.5 would be a medium speed you’d want to aim for, and 2.0 is way to fast. I haven’t experimented with acceleration much because I got tired of restarting my X.

Here is the thing - why can’t I have an applet with adjustable sliders for all of this in my System Settings area in KDE? It would be much easier and more convenient than editing xorg.conf and restarting X, don’t you think?

In case you noticed the last option MaxTapTime being set to 0, that is me disabling the tap to click functionality. Why? Because it was just to sensitive. I was sitting in the class as my students were taking an exam and readig Terminally Incoherent comments. At one point I was trying to move my muse pointer and I inadvertently clicked on one of the google video ads that sometimes show up above or below the comment box and my laptop went:

“DUM DUM DUM DUM! THE ICREDIBLE HULK! CRAAAAASH! ROOOOAR! COMMING SOON ON DVD! BA DUM DUM DUM! WHOOSH! KABLOOM!”

By that time I of course scrolled up so I didn’t see the video playing. I was just like “WTF??? Who is watching videos during an exam”. Then I realized it was me. Fun times.

So yeah, tap to click is gonzo for now. I don’t really need it and it was more annoying than useful.

Using Dropbox without Gnome

Wednesday, October 15th, 2008
dropbox.gif

If you haven’t heard about Dropbox you have probably been living under a rock for the last month or two. It is the latest and the greatest file syncing project out there. I usually describe it to people as a cross between rsync and web 2.0 application. Only more intuitive. The concept is simple - Dropbox gives you a free 2GB of space on their server. You install their client, add a computer to your account and designate a folder on your drive. Anything in that folder will be automatically synced up with Dropbox’s server almost in real time. Trust me it is fast!

That’s not all though. If you add more than one computer to your account, Dropbox will automatically sync the files from all of them. So the latest change you do on your desktop will be seamlessly pushed out to your laptop, and your work computer. You don’t really have to do anything - you just save files into your dropbox folder and they get updated everywhere. And if you are away from your machines, you can access your files via their web interface. It’s great.

Naturally, you should be concerned with privacy issues but that’s what encryption is for. I wouldn’t put any sensitive data in that special folder without encrypting it first. But that’s besides the point. The service just works, and has clients for Windows, Apple and Linux. Well, almost.

Here is my problem with the service - the Linux client is heavily dependent on Gnome and Nautilus. This sucks for me, because I’m a die-hard KDE user who runs Kubuntu. I checked what it would take for me to install Nautilus and ended up with over 200 packages that needed to be downloaded. Nope! I’m not doing that. I decided to pass on the Gnome client and wait for a KDE or at least a command line version. There is a project to develop KDE client on Launchpad but it seems to be in very early stages of development. It might actually be abandoned or simply parked for future use. I have been checking it almost daily for like a week now, and I have yet to see any activity there.

So while my windows boxes have been seemlesly syncing school related files (ppt slides, handouts, etc..) my Kubuntu laptop was cut off from the fun. I had a client running in the Virtual Windows XP that I have on that machine but it’s not the same. It was annoying. Today my problem was solved by Mr. Deepak who wins 1 Internet for his solution which turned out to be astonishingly simple:

  1. Download the generic linux binaries
  2. Un-tar them and put the .dropbox-dist folder in your home diretory
  3. Run ~/.dropbox-dist/dropboxd to initiate the graphical configuration dialog, and add your computer to the account
  4. Finally do: ln -s ~/.dropbox.dist/dropboxd ~/.kde/Autostart/dropboxd to always run dropboxd daemon at login

No Gnome needed. You don’t get fancy little sync icons on your files, and you don’t get a taskbar doodad that will let you know whether or not the syncing up finished but the daemon works. Files are getting uploaded to the dropbox server without any issues or interruptions behind the scenes. I can’t believe I didn’t think of ever trying that. It was so simple!

Some Dolphin/Konqueror integration would be nice of course but I don’t mind dealing with background process magic for now. As long as my files are getting synced in the mysterious dropbox way I’m happy. Thanks Deepak!

Firefox 3 Thumb Button brings up Save As dialog

Thursday, October 2nd, 2008

This has been driving me nuts since I have upgraded to Firefox 3.0.1 on my laptop like a month ago. I’m still running Gutsy on that thing, and only the beta version (which crashes a lot) is in the repositories. So I pretty much did the same thing as back when FF 2.0 came out and I was running dapper. I snagged the statically linked linux binary from the website, dumped it into /opt/firefox and un-installed the old version. It works fine with a single exception - my thumb button was acting weird as hell.

This requires some explaining. I’m using Logitech VX Revolution wireless mouse and the btnx to detect and remap all the additional buttons on the mouse. I configured it so that the back and forward thumb buttons are set to emulate the Alt+ left arrow key and Alt+ right arrow key. These are of course Firefox shortcuts for Back and Forward controls.

To tell you the truth, I actually forgot how to press the back and forward buttons on the FF chrome. I just never do it. At home I am using MS Sidewinder mouse which also has convenient thumb buttons. I always use them while browsing because it is just so much faster than anything else. Faster than keyboard shortcuts because when I’m browsing one of my hands is usually holding the mouse. So thumb buttons are perfect for quick flicking back and forward between pages and I miss them when I’m forced to use a mouse which doesn’t have them.

Ever since I started using FF 3.0.1 on my laptop the back thumb button started doing something weird. In addition to sending the browser the “Back” signal it would also invoke the “Save As” dialog. Yes, it would just pop up in the middle of the screen. Attempting to use the dialog would be futile however. I tried to actually save whatever it was asking me to save several times, but Firefox never actually produced any files as a result of using this particular dialog.

It was nothing more than a constant annoyance. Every time I tried to go back a page, I would have to cancel this dialog. It was actually more annoying than clicking the buttons manually, or taking my hand off the mouse do do the Alt+ Left Arrow thing. Since then I have reconfigured btnx dozens of times, and kept searching Google for a possible solution. No luck. Eventually I figured out this had to be some Firefox setting and started digging in about:config.

Through bunch of trial and error tests, and good amount of luck I finally managed to identify the culprit. If you have this problem, all you have to do is to set:

middlemouse.contentLoadURL = false

From mozilla knowledge base:

Background:

This preference determines how to handle middle clicks in the content area. It was split off from middlemouse.paste, which now handles middle clicks in text fields only.

Possible values and their effects:

True: Load the contents of the clipboard as a URL. (Default for Linux/Unix.)

False: Handle middle-clicks normally. (Default for all but Linux/Unix.)

I actually never, ever use this feature because 90% of the time the thing in my clipboard is not a loadable URL. Besides, since I switch between platforms a lot, I generally don’t get used to platform specific features like that.

I have no clue why this particular setting kept picking up the Back Thumb button as some sort of “Save As” invocation. Note that this was not happening in FF 2.x, so go figure. Setting it to false solved the issue for me. I can browse like a normal person again.

Hopefully this post will help some other poor soul frustrated by this issue. )

Create Arbitrary Sized Sparse Files under Windows and Linux

Thursday, September 25th, 2008

Apparently there is something to be said about short blog posts. Allegedly I tend to get long winded sometimes and my posts can run a tad verbose sometimes. I usually tell people to STFU and go read Steve Yegge if they want to see verbose. I’m short, concise and to the point compared to him. But I figured that I’ll try some of that short blog post thing that people seem to be enjoying in other parts of the web. So I’m making a post about a silly little windows command. This is so that I don’t forget it about it next time I need it.

Have you ever needed a file of specific size to test something but you didn’t care what that file was? You know, just a space holder or a space filler kind of a thing? This is what you need to do to create one on Windows XP:

fsutil file createnew file.ext 10000

Naturally file.ext is the desired name of the file you want to create, and the numeric argument is the desired size in bytes. Note that fsutil creates a sparse file which means that this operation will be blindingly fast. For example it took about 3 seconds to create a 10GB file on my elderly windows machine.

Useful trick. I sometimes use it to see how a given app will act when it encounters a file of certain size. To accomplish the same thing in linux you apparently need to do something like:

dd if=/dev/zero of=my-file bs=1 count=0 seek=10G

I messed around with it, and the bs and count are important so don’t just skip them. The seek attribute specifies the desired size of your file, and here you can use human readable units (like 10Gb in the example).

So if you ever need a file of a specific size to test something, here is how you make one. How is that for a short post? What do you mean 350 words is not short? Ah, go to hell then. I tried. Next post will be verbose again. )