As of writing this (March 31, 2014), the version of Boost included in Debian Wheezy is 1.49. This is a bit problematic for me, as some very useful things are included in more recent versions (e.g., better syslog event handlers in the logging library). One of the problems I sometimes face with Boost is in remembering how to compile/install it. The Boost “Getting Started” pages basically say that most of Boost is header-only and doesn’t need to be compiled, but that there are 16 libraries that need to be compiled. Unfortunately, it stops there. So, this is for future reference and for others that may find it useful. How does one compile/install all of Boost?

The first thing we need to do is make sure all the dependencies for Boost are available. Using your favorite package manager, make sure you have the following. (Depending on your distro, they may be named slightly differently. But, make sure you have the dev version when required.)

- build-essential - g++ - python-dev - autotools-dev - libicu-dev - libbz2-dev

Next, download and decompress the Boost version that you’d like. I’m using 1.55.

$wget http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz$ gunzip boost_1_55_0.tar.gz $tar xvf boost_1_55_0.tar Finally, as root, build and install. Since I’m placing the installation in /usr/local (as is the default), I’m not issuing any prefix declaration here. There are really just two commands: (root)$ ./bootstrap.sh (root) $./b2 --with=all -j 2 install The -j n option will build the libraries using n threads, so this can be changed based on your system. After completion, you should be able to include and link against the required headers and libraries.h I use GNOME 3 in OpenSUSE relatively frequently at work. I’m familiar with this “shell” flavor of GNOME and have watched it evolve over recent years. But, I’ve stuck with XFCE on my personal machines for several reasons: • XFCE is very customizable. • It looks professional and doesn’t throw useless flashy buttons or movements in front of you. • While there are some pretty horrible themes, it generally hasn’t been hit with the ugly stick. This was my main reason for moving away from GNOME 2, which was my first Linux desktop environment after starting with Ubuntu years ago. I revisited GNOME 3 today in Debian for my personal laptop. I’m sad to say that I still can’t use it. While there are great aspects to it, there are still bits that infuriate me. Icon Sizes Believe it or not, the issue of icon size was the original thing that pushed me from GNOME 2 to XFCE. Here’s a sample of what toolbar icons look like in GNOME 2. This is the icon equivalent of bad kerning. Icons are simply stuffed full-size into a toolbar, with no space between them and no vertical padding in the toolbar. This drives me nuts and it looks horrendous. At least in XFCE, I get reliable spacing and padding around icons to make them look reasonable. Yep… that’s the original reason why I switched to XFCE. GNOME2 was just hit with the ugly stick in a big way. Moving on to GNOME 3, it gets worse. While the toolbars are basically gone, I now have the currently open application showing in the top toolbar as follows. So, Iceweasel (the Debian equivalent of Firefox) is open here and the icon is so big that it won’t even fit in the toolbar. Plus, there’s text to show me the application name associated with the icon that is now unrecognizable because it’s so huge. This is simply GNOME 3 trying to add some design appeal, while forgetting that this Iceweasel icon and text do absolutely nothing, except for possibly closing Iceweasel. It gets worse. If I click on this monstrosity, it pops up a menu with a single option: “Quit,” which stays open until I click the icon/text again. It’s useless, beyond letting you know which program you’re using, in case you forget. And, you can’t get rid of this ugliness. Sure, there are add-on extensions to remove this little useless graphic, but I haven’t been able to get them to work. So, I’m stuck with ugly, space-sucking, useless graphics on my desktop. Good job. While we’re on the topic of icon sizes, I should mention that I was able to find an extension that would allow me to change the notification icons on the right-hand size of the top toolbar in GNOME 3. They now, after being modified from their original form, look as follows. That actually looks good. I like that. It’s clean and functional. Activities I like the mouse gestures associated with the “Activities” button in the upper-left side of my screen, but I don’t understand why it is called “Activities.” It would be more appropriately called “Stuff” or “Dashboard” or even “Oberoth,” the name of my laptop. If you name it “Activities,” then it should actually be a route for accessing items that are actually activities: “write an email,” “browse a website,” etc. Instead, “activities” are things like “removable devices” and “windows.” I don’t even see why “activities” is there in the first place. If I go in to “activities” and then click on “applications,” I get an array of huge icons associated with programs. I do like that I can start typing the name of a program and have this list be filtered. But, the array of icons and text isn’t incredibly easy to use. I was able to reduce the icon size a bit, but now we find ourselves in the following situation. Just to recap, the six application options in these six icons are as follows: “gedit”, “GNU Im…”, “GParted,” “Hugin …”, “Hugin …”, “Hugin …”, “LibreO…”, “LibreO…”, and “LibreO…”. Only two of these nine options remove any doubt as to what they access. This is just horribly designed. Conclusion I could go on, but won’t. It’s this sort of nonsense that I don’t miss when using XFCE. I think the look and feel overall is nice, but it’s infuriating during actual use. I can’t find what I’m looking for, and thing I’m not looking for take up space. The clock, for instance, takes up about 3x the space on the GNOME 3 toolbar as my XFCE clock does on my XFCE toolbar. I’ll try again in another year or so. Until then, XFCE still has my vote. By the way, below is a screenshot of what my XFCE environment currently looks like. Problem I have been using XFCE as a desktop environment in Linux ever since I became frustrated with GNOME 2 (it was hit with the ugly stick). I’ve used a few others (GNOME 3, LXDE, etc.) and some window managers as well (OpenBox), but I keep coming back to XFCE for its simplicity and elegance. What annoyed me for some time though was that the display manager of XFCE didn’t appear to support multiple monitors. In reality, you just have to know how to do it … which isn’t terribly complicated. XRANDR Xrandr is the “primitive command line interface to the RandR extension.” This is what will allow us to enable and configure multiple monitors via the terminal. The first thing we’ll do is see what sort of displays are available. I’m running a Lenovo ThinkPad on a dock, so I’m going to have a load of display ports at my disposal. Xrandr is almost certainly installed if you’re running a distro such as Debian, Ubuntu/Xubuntu, etc. We can get a list of available display ports by simply typing ‘xrandr’ at the prompt. jason@oberoth:~$ xrandr Screen 0: minimum 320 x 200, current 1600 x 900, maximum 8192 x 8192 LVDS1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 309mm x 174mm 1600x900 60.0*+ 40.0 1440x900 59.9 1360x768 59.8 60.0 1152x864 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) HDMI2 disconnected (normal left inverted right x axis y axis) HDMI3 disconnected (normal left inverted right x axis y axis) DP2 disconnected (normal left inverted right x axis y axis) DP3 disconnected (normal left inverted right x axis y axis)

As xrandr shows, I’m currently running with only my laptop screen, which is named LVDS1. This screen has a resolution of 1600×900, and it’s currently running at that resolution. If I connect a VGA cable from my dock to my monitor, I’ll get a slightly different output.

jason@oberoth:~$xrandr Screen 0: minimum 320 x 200, current 1600 x 900, maximum 8192 x 8192 LVDS1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 309mm x 174mm 1600x900 60.0*+ 40.0 1440x900 59.9 1360x768 59.8 60.0 1152x864 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 connected (normal left inverted right x axis y axis) 1920x1080 60.0 + 1600x1200 60.0 1680x1050 60.0 1280x1024 75.0 60.0 1440x900 75.0 59.9 1280x960 60.0 1280x800 59.8 1152x864 75.0 1024x768 75.1 70.1 60.0 832x624 74.6 800x600 72.2 75.0 60.3 56.2 640x480 75.0 72.8 66.7 60.0 720x400 70.1 HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) HDMI2 disconnected (normal left inverted right x axis y axis) HDMI3 disconnected (normal left inverted right x axis y axis) DP2 disconnected (normal left inverted right x axis y axis) DP3 disconnected (normal left inverted right x axis y axis) Now, VGA1 is connected and the data shows that it is capable of running at 1920×1080. There are multiple ways to tell xrandr that we’d like to use both LVDS1 (laptop monitor) and the external monitor connected at VGA1. First, we need to determine the orientation of how we’d like to set things up. My preference is to have my laptop monitor maintain my XFCE desktop toolbar and be viewed as the “primary” screen. My external monitor will sit off to the right size of the laptop screen, and I need to tell xrandr where to place this monitor in reference to my laptop screen. I do that like so. xrandr --output LVDS1 --auto --primary --output VGA1 --auto --right-of LVDS1 This tells xrandr that the first output is LVDS1, which is set to automatically register resolution and also be set as the primary output. The second output is VGA1, which also has resolution set automatically and resides to the right of LVDS1. Once we issue that command, the second monitor becomes active and I can move my mouse pointer and drag windows between monitors. If we issue an xrandr command now, we see this. jason@oberoth:~$ xrandr Screen 0: minimum 320 x 200, current 3520 x 1080, maximum 8192 x 8192 LVDS1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 309mm x 174mm 1600x900 60.0*+ 40.0 1440x900 59.9 1360x768 59.8 60.0 1152x864 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 connected 1920x1080+1600+0 (normal left inverted right x axis y axis) 477mm x 268mm 1920x1080 60.0*+ 1600x1200 60.0 1680x1050 60.0 1280x1024 75.0 60.0 1440x900 75.0 59.9 1280x960 60.0 1280x800 59.8 1152x864 75.0 1024x768 75.1 70.1 60.0 832x624 74.6 800x600 72.2 75.0 60.3 56.2 640x480 75.0 72.8 66.7 60.0 720x400 70.1 HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) HDMI2 disconnected (normal left inverted right x axis y axis) HDMI3 disconnected (normal left inverted right x axis y axis) DP2 disconnected (normal left inverted right x axis y axis) DP3 disconnected (normal left inverted right x axis y axis)

We see that screen 0 now registers as being 3520×1080, and it holds two outputs: LVDS1 with resolution 1600×900 at 0×0 and VGA1 with resolution 1920×1080 at location 1600×0.

The only awkward issue here is that my external monitor is taller than my laptop. Right now, the monitors are aligned vertically at the top. What if I want them aligned vertically by the bottom of the screens? Keeping in mind that the external monitor is 180 pixels taller than the laptop, I could position the external monitor manually as so.

xrandr --output LVDS1 --auto --primary --output VGA1 --auto --pos 1600x-180

Rotating the External Monitor

One thing I like to do while coding, or even reading webpages, is to rotate my external monitor for a taller reading profile. I do that as follows.

xrandr --output LVDS1 --auto --primary --output VGA1 --auto --right-of LVDS1 --rotate right

Maybe some time in the future I’ll come up with a script to automate this.

There’s this annoying thing that’s happening at work. It started with one or two sites being blocked from access while on the company network. It has grown to the point where standard, run-of-the-mill stuff is blocked. For instance, the Google image search for “Linux Mint XFCE” (I’ve been considering switching my work desktop to Mint) turns up results that are blocked by the network. Here’s a screenshot of the warning that a Linux Mint screenshot image link produces.

It would be one thing if I only ran into this “access denied” warning while browsing during lunch. But, this keeps popping up for work-related searches, including the recent issue of not being able to access a page about Python’s Twisted module because it … apparently … contained information about weapons.

Forwarding HTTP Traffic over SSH

So, what I’m going to do is to reroute all of my browser traffic over SSH and through a server that I administrate. Come to think of it, this is a safe solution for many situations (travels, working on sensitive data over an open wifi connection, etc.).

First, you need to have SSH access to a server that can act as a proxy for your web browser connection. I’m using a server that I’ll call proxy.myserver.com. We’ll set up the forwarding here. There are a few command options that we use for the ssh command here. Namely, the D option specifies a local application level port forward and the N tells proxy.myserver.com that we don’t want to interact… we’ll just open a connection in the terminal and let it sit there without a prompt. The real data transfer work is going to be done through the web browser.

Here’s how we set it up, forwarding port 9999 from my desktop to proxy.myserver.com, I enter the following in the terminal on my desktop.

\$ ssh -ND 9999 jason@proxy.myserver.com

After entering the password, it just sits there, which is exactly what should happen. Now, let’s set up the browser. I’m using Iceweasel (Firefox) on Debian. By entering the options menu at Edit->Preferences and finding our way to Advanced->Connection->Settings, we get the following menu.

By entering a manual proxy configuration with a SOCKS host, we will be able to utilize our SSH port 9999 connection.

Now, Firefox/Iceweasel will use the proxy connection through proxy.myserver.com to fetch any web traffic. If for some reason that connection dies, we’ll get a warning from the browser stating that the proxy isn’t accepting any connections.