You are currently browsing the category archive for the ‘Linux’ category.

This is actually in Gnome; if you’re using KDE you’re out scout. This is one of those features that’s really easy to set and really annoying to un-set.

I recently got an iPod and when I plugged it in to my desktop I was greeted with this lovely dialog:

annoying_dialogOK, well, that’s kind of nice and user-friendly I guess but it was damn annoying so I chose ‘Open Rhythmbox Media Player’ and checked ‘Always perform this action’ and went on with my business.

Well as you can see from my screenshot, I’ve recently started using Banshee, largely for the Mirage project which I’ll probably post on at some point or another. Well dammit, I’d checked ‘Always perform this action’ so now Rhythmbox opened whenever I plugged in my iPod. That is annoying. And it took me way too long to figure out how to disable this so I’ll save you the hassle.

Open Nautilus. (On your taskbar Places->Home) Choose ‘Edit->Preferences.’ Choose the ‘Media’ tab.

hiddenwellenough

I figured the pepper brush was getting lonely in the GIMP.

There. There it is. I know that the ‘always do this’ option is for ease of use or convenience or something but geeze they made the opt-out hard to find.

screenshot1

screenshot2

Redressed my Tablet today. The htop and syslog are live on the desktop, “embedded” into it using the Tombuntu tutorial. The background was generated with the GIMP. Also shown is xchat, an IRC client, and Guake is at the top, which is a Quake-style pop-down terminal. It’s pretty neat; I’ve set it to be permanently translucent with Compiz…

I haven’t ever done one of these themes with the system info on the desktop so I thought it’d be fun. We’ll see how long it lasts.. :P

Maybe a racing stripe would look good? I’m not sure…

toworkwith31

The GIMP helps me choose a car color!

I took an image from http://www.classic-marques.co.uk/Tartan%20MGB%20Roadster%20001.jpg (If you’re the copyright holder and you want me to take this down, please let me know)

and worked with it a little…

Old

Original

Closer to the color I want my car!

Closer to the color I want my car!

Closer to the BRG Dad favors

Closer to the BRG Dad favors

I’m a bit of a novice so you can see it’s not perfect (notice the turn signal light) but it’s pretty cool for visualization! And this car was pretty close to the way mine will look when I’m done, minus the color.

This is actually me tooting my own horn for a past project.. but I’ve been meaning to do it for so long I’ve lost all the good screenshots :(

I used to attend a very specific boarding school, and one of the more annoying school policies was blocking software called “Websense” which some of you may be familiar with. Websense blocked access to a lot of sites, some legit (porn), some not (Facebook, MySpace, and anything about guns or Dick Cheney). On top of this, the internet cut off at midnight every night, again thanks to Websense. Every student at the school understood that midnight was far too early to lose internet access, and while I was there we went to great odds to find proxy servers to connect to on the internet to access the internet after midnight and to get to Facebook during the day.

When I graduated I had friends still there, notably my girlfriend, and I wasn’t going to settle for letting them suffer through what I went through. I set out to design a proxy server that would be secure, easy to use, and most importantly, undetectable by the IT department. While I was there we discovered that ssh could be used to obfuscate proxy services.

I opened The Senseless Web soon after my Freshman year began. The Senseless Web offered a shell account on my desktop to any NCSSM student. The student verified his identity by providing an NCSSM email to which the site sent a verification code. He then provided an alternate email for future communication so that the domain wouldn’t attract too much attention from ITS.

The shell accounts were neutered with a nonfunctional python shell and restrictive permissions. The account’s password was changed every ten minutes by a cron job and the user would enter his email in the only box on the homepage, receive the password via email, and sign in to the single shared account. I had instructions on the site and after a one-time setup the connection was simple. Everything was encrypted and I did little logging besides a counter to see how much it was being used so that the users had assurance of privacy.

Early on, ITS caught on to SSH forwarding that was going on to other sites, and blocked all outgoing ports except HTTP, HTTPS, POP, and IMAP. Since the others were all being used, I set up SSH to serve on port 143 (IMAP). I told users to change their settings and the site continued undisturbed until the end of the year. The command to connect was ssh -D 8080 efas@trantor.boldlygoingnowhere.org -p 143 if in Linux or a similar setup using putty in Windows. Then Firefox was told to look for a SOCKS proxy on localhost at port 8080. Clever! I wrote a script (since lost) that would set up the whole thing for Linux users, and Windows users could use a modified shortcut for putty and foxyproxy to make it a very short setup for a free-internet session.

By the end, we had over 5600 individual sessions. The whole thing was a huge success. Every user was allowed unfiltered, free internet whenever he or she wanted. From what I understand, the school has since lifted the more draconian of the rules, and students do not need/want such a service any longer.

Below are the only remaining screenshots, unfortunately, I have reinstalled all of my PCs since then and managed to lose all other screenshots. However I do have the code in a tarball if anyone is interested in seeing it.

This is the homepage. Note the use (not hit) counter, bottom left, and the one-box sign-in form at the bottom right.

This is the homepage. Note the use (not hit) counter, bottom left, and the one-box sign-in form at the bottom right.

This is the short registration page.

This is the short registration page.

Long live free internet!

Darn you Transgaming for not supporting my Intel graphics card!
If I get this working (at least marginally).. I’ll post about that too. Even if I get the textures to load the computer might just not be able to handle it :(.
Sigh. At least it works on my desktop….

City of Heroes screenshot showing messed up colors and textures and an abysmal FPS

City of Heroes with messed up colors and textures and an abysmal FPS (look carefully in the upper left hand corner)

OK now this is where it gets good. This is in order of importance and efficiency, and I tried to highlight the important stuff for you impatient people.

Install Xournal:
sudo apt-get install xournal
Install CellWriter:
sudo apt-get install cellwriter

CellWriter is kind of lame at first, and very personalized to your handwriting so if you’re sharing the computer be sure to set up another user account for whomever you’re sharing with. However, Cellwriter gets better and better as time goes on, and I have gotten quite fast on it. Not quite typing speed, but I don’t get frustrated with it for misunderstanding (often).
As soon as you open Cellwriter, go to Setup and check “Enable extended input events,” or your eraser won’t work. Then proceed with Training Mode, and the pen eraser will work. After Training mode, disable this option if you wish to be able to correct CellWriter when it is unsure (when the character shows up red) or when it chooses the wrong character. You can erase by drawing a slash across more than one cell.

My hint: draw your 1 with a hook at the top, make your | really long, give that lowercase L a slant or a little curl at the end or something, and put a slash through 0 and everything will be a lot easier. Seriously. This is one place where CellWriter could improve: context clues. I am not trying to write Ce||Writer or c0ntext c1ues. But I digress. If you are using your tablet often, put CellWriter in your session in Gnome so it starts automatically. It’s your best friend in tablet mode.

For best results in Xournal:
Under Options be sure that Use XInput, Discard Core Events, Eraser Tip, and Auto-Save Preferences are checked.
If you choose Options->Button 2 Mapping->Highlighter, you’ll get a Highlighter when you press the button on your stylus. Also note that under Tools->Eraser Options you can change your eraser to “Delete Strokes” which allows for Windows Journal-style quick erasing.

In GIMP:
Open a new drawing. In the drawing window choose Edit->Preferences. In the sidebar choose Input Devices and click “Configure Extended Input Devices.” Set “stylus,” “eraser,” and “cursor” to “Screen.” Save. The pen tip is now one tool, the eraser is another (both your choice, and both will default to brush so it might not be brutally obvious at first that this is working), and the side button is right-click.

Great so now tablet mode works. But it’s uncomfortable to hold like this! Let’s flip it to portrait mode. Automatic flipping is fancy and all, but I don’t care if I have to press the little “change to portrait” button on the screen, and you shouldn’t either. This way it also won’t randomly flip when you hit a bump on the bus or something.

The only hitch I found is that the x61 works with Compiz out of the box. And I’m not going to take away my wobbly windows, at least not in laptop mode! However, xrandr doesn’t work with Compiz, and the Compiz developers haven’t released any substitute, so we’re stuck switching to Metacity when we switch to tablet mode. No biggy. Open your terminal.
Install Ruby: sudo apt-get install ruby
Make a new file, in your home folder, and name it tablet.rb
Open tablet.rb and dump the following inside:

#!/usr/bin/ruby
$orientation = `xrandr -q | grep "1400 x 1050"`
if ($orientation.length != 0 )
	puts "Landscape to Portrait"
	`/home/yourusername/xrotate 3 && metacity --replace`
else
	puts "Portrait"
	`/home/yourusername/xrotate 0 && compiz --replace`
end

OK this script is RIDICULOUSLY HACKISH so don’t use it if you’re not using an x61. As you can see, all the script does is check if we’re in landscape mode (is resolution 1400 x 1050 or 1050 x 1400) and call another script (coming up here in a second) to do the real work, and switch us to/from compiz/metacity. Save the file. If you’re not using 1400 x 1050, change “1400 x 1050″ to your resolution, and also make sure you change ‘yourusername’ to your username. And if you didn’t, and you already tried to run it, smack yourself in the forehead.
Run chmod +x tablet.rb
OK the subsidiary script I snagged off of the interwebs, and thank you to the anonymous author who didn’t put his name in the file, and I don’t remember where I got it anymore, it’s been living in my home folder for too long. This is a heavy-duty bash script and it rotates your screen and the orientation of the wacom tablet behind your screen.
Copy and paste this into a file named xrotate:

#!/bin/sh

output="(normal left inverted right)" #LVDS
 # if [ "$XROT_OUTPUT" ]
 # then
 #         output=$XROT_OUTPUT;
 # fi
devices="stylus cursor"

geomnbr=0
xrandr=normal
wacom=normal
if [ "$1" == "-" ] || [ "$1" == "+" ] || ! [ "$1" ];
then
        operator="$1";
        [ "$1" ] || operator='+';
        case `xrandr --verbose | grep "$output" | sed "s/^[^ ]* [^ ]* [^ ]* ([^(]*) \([a-z]*\).*/\1/"` in
                normal)         geom=0;;
                left)          geom=1;;
                inverted)       geom=2;;
                right)          geom=3;;
        esac
        let geom=${geom}${operator}1+4
        let geom=${geom}%4
else
        geom="$1"
fi
case $geom in
        1)      wacom=2; xrandr=left ;;
        2)      wacom=3; xrandr=inverted ;;
        3)      wacom=1; xrandr=right ;;
        *)      wacom=0; xrandr=normal ;;
esac

echo "xrandr to $xrandr, xsetwacom to $wacom" >&2

if xrandr -o "$xrandr"; then
        for d in $devices
        do
                xsetwacom set "stylus" Rotate "$wacom"
        done
fi

#workaround for linuxwacom bug
if [ "`xsetwacom get stylus Mode`" == '1' ]; then
        for d in $devices
        do
                xsetwacom set stylus CoreEvent "off"
                xsetwacom set stylus Mode "off"
        done
        { sleep 1;
        for d in $devices
        do
                xsetwacom set stylus Mode "on"
                xsetwacom set stylus CoreEvent "on"
        done; } &
fi

Now run chmod +x xrotate.
OK, now running ./tablet.rb & should switch your tablet to/from tablet mode. No arguments, nothing, it figures it out on its own. If you like a different mode for tablet mode, change the 3 in `/home/yourusername/xrotate 3 && metacity --replace` in tablet.rb to 1. Don’t use 2, however, because it’ll break my hackish script. If you just like your tablet upside down, you weird non-portrait person, write your own stupid hackish script.

Now let’s map it to the little button on your screen. There’s probably a cleaner way to do this, but the way I know is with xbindkeys.
sudo apt-get install xbindkeys
Run xev | grep keycode, make sure the window that pops up is selected, and press the button you are going to map. Remember the keycode that appears when you press the button. xev will record everything, so press it a couple times to make sure that’s what you’re seeing, and not the mouse moving in and out of the window or some crap. My keycode is 219. Yours probably is too.
Close the xev window.
Create a file named .xbindkeysrc in your home directory
Put this in it:

I made a mistake here, and I apologize to anyone who it gave trouble to. I just noticed it; the first line below was wrong, but has been changed to the correct value.

"./tablet.rb"
    m:0x0 + c:219
    NoSymbol

Change your keycode to whatever it was, if it wasn’t 219. Run xbindkeys. Press the button. If it works, there’s just one more step, and if it doesn’t, something else is wrong.

Assuming it works, we just need to add xbindkeys to the current session so that it binds our new custom “keyboard” shortcut at login.
Click on the MintMenu->Preferences->Sessions. Click “Add.” Name: xbindkeys. Command: xbindkeys. Comment: whatever.

OK now the last two things remove the ‘oh I forgot to do x that I have to use my keyboard for’ situations that arise when you can’t use CellWriter for input for some reason. This only occurs 1) When you’ve locked your screen/you’re coming back from standby and it wants your password 2) at the GDM screen, and 3) if you decide you want to do updates without switching back to laptop mode.
For most of this, you just need to enable your fingerprint scanner. There’s no need to paraphrase ThinkWiki’s guide. It works, it’s easy, just make sure you’re looking at the Hardy section.

Finally there’s GDM. Once you have the fingerprint working that takes care of your password, but if you want to also choose a username with your stylus, go choose a GDM theme with a face browser. This one was the one I chose. If you’ve never changed your GDM theme before, it’s MintMenu->Administration->Login Window go to the “Local” tab and choose “Add,” and then point it to the .tar.gz you downloaded from the link above.

Done. Now, I usually just stop here. Your tablet is going to be pretty excellent at this point. You may want to remap the arrow pad on your screen so down is down when in portrait mode, but I never use it so unless I suddenly remember the name of the tool you use to do that, I’m not going to sit here and rack my brain.

Personally, I find NetworkManager to be a big heaping pile of shit, and I replace it with wicd the very first chance that I get. It’s not hard, just add their repo to your sources.list and sudo apt-get install, and then reboot. Knock yourself out. For me, this solved the ‘really flaky wireless on campus’ problem.

Also, remember to change your desktop wallpaper to “Zoom” and not “Stretch” or it’ll look like crap in portrait mode. No big deal, just one more thing.

Have fun.

OK, so here’s the deal: I’ve always wanted a tablet, especially once I got into college. You can’t take notes on your laptop in math unless you learn TeX and then that’s just too slow, and paper gets torn and destroyed and there are many advantages to taking notes on a tablet. Your notes sort themselves by date. They can be colorful and neat. There is no such thing as an ‘erase mark’ and with a program like Xournal erasing is also faster than with a pencil.
Anyway, that’s not why you’re here.

You’re here because the general consensus is that if you get a Tablet, you might as well run Windows XP Tablet Edition or Vista, and that if you want to run Linux you’re out scout. Well that’s simply not the case. Now, I didn’t pay for OneNote so when I got my x61 all I had to compare was the handwriting recognition and Windows Journal.

Simply put, Xournal beats Journal hands down, and the handwriting recognition in Windows is… more natural. You can write in cursive, which I feel the tablet lends itself to, and in Linux you have to write one letter at a time, but Linux is just as fast and just as natural after the learning curve.
I digress. You want to use Linux on your Tablet. Especially your Lenovo x61 Tablet, but I think the Fujitsus should work too … except for the fingerprint reader, if it exists. Anyway Lenovo sent me a bad hard drive and since you can’t install Windows on a blank one without a CD-ROM drive (Lenovo seemed shocked I didn’t have one in the computer they designed without one when I called tech support asking how the hell I was supposed to reinstall Windows.) I told them nevermind, I’ll install Linux. And I did. And now, so will you.

First of all, choice of a distribution is key. Ubuntu 8.04 provides a great backbone and the Wacom Tablet support is great (better than 8.10, so I think I’m going to stick with the LTS). However, setting up a tablet, you have your work cut out for you, so we’re going to install Linux Mint 5.0 which is based on Ubuntu but really takes care of the basics. When we’re done with the installation, you won’t have to worry about multimedia codecs or flash or any of that bullshit. Linux Mint takes care of it. But if you need help, hop over to the Ubuntu forums because everything works. Don’t even tell them you’re running Mint or you’ll confuse their pansy minds, just tell them you have 8.04 and your I-Hate-Linux-Brand Printer isn’t working. Or whatever. Your modem. God help you.

Now then, if you have a tablet with a CD-ROM drive, I trust you can do the installation yourself. You have a tablet and you’re planning to put Linux on it. This ain’t pussy stuff, but the base installation is easy. Just burn the iso and install it. You’ve installed Linux before. And if you haven’t, go find another howto. There’s a billion of them out there, especially for Ubuntu and Mint is virtually no different. Just make sure you get Linux Mint 5 and not 6. Six might be great on other computers but on your tablet it’s going to be a big steaming load of pain in the ass. Ubuntu changed something with HAL so if you want your pen to only work in GIMP or Xournal and not to be able to use the eraser without learning what “I hate the Ubuntu team” looks like engraved into your own forehead, go ahead and install Ubuntu 8.10/Linux Mint 6.0. Otherwise, click here and go grab Linux Mint 5.0 (called Elyssa).

If you have a tablet sans CD-ROM drive, like mine, grab a 1.0 GB or bigger thumb drive and back up everything on it somewhere else, and then wipe the thing. We’re going to install off of that. Don’t go to the Linux Mint site, that’s for noobs with CD-ROM drives. Actually this is really easy too. Go here and download UNetbootin, which is a utility for network-based usb-booted installs. Fortunately, they support Linux Mint 5.0, so just download that (Windows or Linux), plug in your USB drive, select “Linux Mint 5.0″ from the dropdown menu, and let it do its thing. It will download the correct iso, stick it on your drive and ask you to reboot. When you do, make sure you select “USB” in your BIOS settings, and then you will essentially get the LiveCD that you’re used to, but sans CD. Cool huh? Come back after you do the initial install and we’ll get the rest of your tablety functions working.

Done? Great.
First: install wacom-tools.
sudo apt-get install wacom-tools
Pop open your terminal and backup your /etc/X11/xorg.conf. We’re going to do this fast; this is ground that is covered by a lot of other blogs and wikis and not the point of my post. It’s just here for comprehensiveness.
Now open /etc/X11/xorg.conf in vim, gedit, nano, emacs *shudder*, whatever, and add this:
(Copy and paste without fear! I didn’t use WordPress’s <code> blocks, so those are straight quotes!)

Section "InputDevice"
Driver        "wacom"
Identifier    "cursor"
Option        "Device"        "/dev/ttyS0"
Option        "Type"          "cursor"
Option        "ForceDevice"   "ISDV4"
Option        "Mode"          "Absolute"
EndSection

Section "InputDevice"
Driver        "wacom"
Identifier    "stylus"
Option        "Device"        "/dev/ttyS0"
Option        "Type"          "stylus"
Option        "ForceDevice"   "ISDV4"
Option        "Button2"    "3"
EndSection

Section "InputDevice"
Driver        "wacom"
Identifier    "eraser"
Option        "Device"        "/dev/ttyS0"
Option        "Type"          "eraser"
Option        "ForceDevice"   "ISDV4"
EndSection

In your "ServerLayout" section, add the lines

InputDevice	"cursor"	"SendCoreEvents"
InputDevice	"stylus"	"SendCoreEvents"
InputDevice	"eraser"	"SendCoreEvents"

It will look like this:

Section "ServerLayout"
Identifier	"Default Layout"
Screen		"Default Screen"
InputDevice	"Synaptics Touchpad"
InputDevice	"cursor"	"SendCoreEvents"
InputDevice	"stylus"	"SendCoreEvents"
InputDevice	"eraser"	"SendCoreEvents"
EndSection

While you're already in your Xorg, go ahead and add

Option		"EmulateWheel"		"true"
Option		"EmulateWheelButton"	"2"

to your "InputDevice" section if you want middle-click scrolling.
This will get you going for a pen-based tablet. If you have a touch-based tablet, there is an extra part for that but I can't help you there. This guy talks about it some, but I think you have to compile a new version of X. Good luck.
Anyway, on to the real stuff. I guess I'll put it in another post.