Thursday, March 22, 2012

Tweaking display set-up on Ubuntu

(Thank you very much, Shinobu!)

I was trying to switch to the Nvidia drivers for Ubuntu 10.04, but was running into the same problem that made me ditch the drivers in the first place: I couldn't get Nvidia's config tool to rotate one of my monitors and leave the other alone.

Thanks to http://zuttobenkyou.wordpress.com/2009/10/04/linux-nvidia-xinerama-guide-rotating-just-one-monitor-in-a-dual-head-setup/ , I was able to switch to Xinerama (an Xorg extension), and rotate one of my monitors.  It involved some manual editing of my /etc/X11/xorg.conf , but nothing too painful.

Here's my /etc/X11/xorg.conf :


# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 1.0  (buildd@yellow)  Fri Apr  9 11:51:21 UTC 2010

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 1024 100 
    Screen      1  "Screen1" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "1"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "DELL ST2420L"
    HorizSync       30.0 - 83.0
    VertRefresh     56.0 - 76.0
    Option         "DPMS"
    Option         "Rotate" "Left" # for portrait mode
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "DELL 1907FP"
    HorizSync       30.0 - 81.0
    VertRefresh     56.0 - 76.0
    Option         "DPMS"
    #Option         "Rotate" "Left" # for portrait mode
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "Quadro FX 4600"
    BusID          "PCI:8:0:0"
    Screen          1
    Option         "RandRRotation" "on"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "Quadro FX 4600"
    BusID          "PCI:8:0:0"
    Screen          0
    Option         "RandRRotation" "on"
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "TwinViewXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "DFP-0: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "DFP-1: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Extensions"
    Option         "Composite" "Enable"
EndSection


I'm sure there's still some cruft in there, but oh well.

Thursday, March 1, 2012

Debugging Google Chrome / Chromium CPU Horror

I hated to admit that using Google Chrome was destroying my productivity on my Ubuntu workstation at work.  The CPU usage was absolutely horrible, and the average load on my machine was usually anywhere from 1.5 to 7.  I know!

My workstation was fairly beefy memory-wise and CPU-wise, and had plenty of disk space.  I disabled everything I could think of, enabled GPU rendering of things, disabled debugging, extensions, ETC. . . .

I exited Chrome and waited for the processes to die.  Usually, I just verify this happened by looking at top; since Chrome usually owns the top spots (no pun intended), I wait until top shows no chrome processes, then I restart it.  This time, I did ps for chrome and chromium processes.  TURNS OUT that after using the Profile Manager[1] extension, several chrome and chromium processes were starting up every time I logged in.  I verified this by looking at "~/.config/autostart", which showed several *.desktop files pointing to Google Chrome and Chromium profiles.

So far, the change is extremely significant.  I recorded no benchmarks along the way, so I am unsure of how much each of my changes improved performance.  However, it appears that all of the extra Chrome processes were what made the biggest difference.

Chalk up another win for blogging about anecdotal information that may or may not lead to misunderstandings about technology.  :-)  You're welcome!


-Ali


[1]  I started using Profile Manager because I wanted to run multiple Chrome sessions in isolation, depending on what I was working on.  For my day-to-day work, I use one profile.  For my volunteer work, which I associate with its own Google Apps account, I use another profile.  For my browser testing, I use another.  THE LIST GOES ON.

Wednesday, January 18, 2012

Fwd: Why is the Internet on strike today?



---------- Forwarded message ----------
From: Mozilla Firefox <mozilla@awesomeness.mozilla.org>
Date: Wed, Jan 18, 2012 at 08:21
Subject: Why is the Internet on strike today?


 
Trouble viewing? Read this in your browser.
Firefox & You
From Mozilla, a non-profit organization and developer of Firefox
 
 
Stop Censorship Today, Mozilla is joining the virtual strike against Internet censorship – along with others like Wikipedia and Google – to raise awareness of US Congress legislation that could fundamentally alter the Internet we know and love.

This harmful legislation, called the Stop Online Piracy Act (SOPA) in the House and the PROTECT IP Act (PIPA) in the Senate, will be voted on as early as January 24th in the Senate.

If you live in the US, there's still time to help stop these bills from becoming law. Please visit mozilla.org/sopa for information on the bill, and on ways you can reach out to your senators.

What makes this legislation so bad? Here's how it would change the Web:
  • Communication platforms – from YouTube to Facebook to Amazon – could be shut down if a single rights holder alleges a violation.
  • It would make the Web less stable and less secure.
  • Social networking sites, like Twitter or Facebook, could be forced to track and control user behavior, stunting innovation and undermining free expression.
  • Your Internet provider could be required to inspect all of your traffic and browsing.
Visit mozilla.org/sopa right now for information – and make your voice heard before it's too late.

Please join today's strike, and help protect the Internet.

Sincerely,

Jane & Winston
Editors



Help spread the word
Share on Facebook Share on Twitter
 
   
Thanks for Reading!

Monday, December 5, 2011

Google being evil?

Hi,

Right now we have a huge opportunity to deal a serious blow to one of
Washington's most powerful lobbies, the U.S. Chamber of Commerce. At
Google headquarters, employees are intensely debating whether Google
should quit the Chamber in the next few weeks. Google quitting would be a
huge blow to the Chamber's credibility.

I signed a petition to Google employees to ask them to stand up for us and
our democracy by quitting the U.S. Chamber of Commerce. Will you join me?

http://civic.moveon.org/googlechamber1/?r_by=33547-19148747-xF_2Wxx&rc=googlechamber1_letter.email.g0

Thanks!



Wednesday, November 23, 2011

Advice about who should use or not use Perl

From Learning Perl, 6th ed. (6):
If you're going to use a programming language for only a few minutes each week or month, you'd prefer one that is easier to learn, since you'll have forgotten nearly all of it from one use to the next.  Perl is for people who are programmers for at least twenty minutes a day, and probably most of that in Perl.
The highlights are mine.

I went to YAPC::NA 2011 and in my narrow slice of experience of the event and ancillary meetings (including Perl Mongers meetings), this quote from Learning Perl resonates with me.

Unfortunately (!), only jobs I've *applied* for would have me writing Perl everyday.  As it is, and has been for nearly a decade, as much as I've wanted Perl to be my job, it has been nearly none of it.  Thankfully, at least, my work now puts me back in front of actual code, so while it isn't Perl, it is something (Python and PHP).




  • Schwartz, Randal L.; Foy, Brian D.; Phoenix, Tom. Learning Perl. 6th ed.

Friday, October 14, 2011

Best way to aggregate content for reading offline

I started using Instapaper  a looooooooooo . . . ooooooooong time ago for aggregating things I wanted to read later.  However, less and less of the content I want to read is actually in the feed or article that I have at hand to forward to Instapaper (via my personal Instapaper e-mail address).  So what happens is that I go to my Instapaper feed, sync it to my Nook, for example, so I can read it offline, but when I sit down to read it, all I get are headlines and excerpts; all of the meat of the articles lay elsewhere on some network, so I still need a data connection in order to access it.  Mission failed.

So, it would be great to find a way to not only sync a given feed (or, like my Instapaper, a feed of feeds) with a device or offline app, but to spider that feed and keep all of the content together.

Surely this exists!  Or will I have to write it myself?

Wednesday, October 5, 2011

Ubuntu + x11vnc + TightVNC = happytime

In searching for the current best way to access remote X sessions, I tried out x11vnc and TightVNC -- not the native client, but the Java app, no less -- and was immensely pleased!  Just ran "x11vnc -display :0" on a remote console, and connected with TightVNC instantly.  No additional config.  The display was very smooth, and resolution was 1280 x 1024.

FYI, that was a password-less session, so if you want to secure it, gotta do a little better than that.  But with a simple SSH tunnel, should only involve another command on the remote shell, right?