Sunday, January 1, 2012

Waking my Acer Aspire Running Ubuntu with a USB Keyboard and Mouse

In a previous post I detail how happy I am with my low-budget web-surfing Acer Aspire.  However, it would not wake up with the lid closed using an external keyboard.  A bit of Google-ing led me to the following:


On my Acer Aspire, the external wake on USB keyboard was not working.

"cat /proc/acpi/wakup" showed:
Device S-state   Status   Sysfs node
HDEF   S3 *disabled  pci:0000:00:1b.0
LANE   S4 *disabled  pci:0000:02:00.0
USB1   S3 *disabled  pci:0000:00:1d.0
USB2   S3 *disabled  pci:0000:00:1d.1
USB3   S3 *disabled  pci:0000:00:1d.2
USB4   S3 *disabled  pci:0000:00:1d.3
USB7   S3 *disabled  pci:0000:00:1d.7

Looking at syslog (or dmesg) I found the USB id to be, "0000:00:1d.7".  That corresponded to 
USB7.

The following commnad (as root, no sudo): 

'echo "USB7" > /proc/acpi/wakeup'

evice S-state   Status   Sysfs node
HDEF   S3 *disabled  pci:0000:00:1b.0
LANE   S4 *disabled  pci:0000:02:00.0
USB1   S3 *disabled  pci:0000:00:1d.0
USB2   S3 *disabled  pci:0000:00:1d.1
USB3   S3 *disabled  pci:0000:00:1d.2
USB4   S3 *disabled  pci:0000:00:1d.3
USB7   S3 *enabled   pci:0000:00:1d.7

And now it works.

Add the line above to "/etc/rc.local" to make it permanent. 

How to Create a Patch for an OpenBSD Program from the Ports Tree


A while back I was running mail servers for High Country Rugby and the Georgia Rugby Union.  During that time I had reason to use the Teapop mail server but wanted it to work with the Maildir format and with 'htpasswd'.  For whatever reason Teapop did not support this out of the box so I patched it to meet my needs.  I kept this note on how to create a patch and thought I would share it today. 

1. Determined how to force Teapop to use Maildir format with htpasswd:

   A. Make patch!
      1. cp pop_passwd.c to pop_passwd.c.orig
      2. edit pop_passwd.c and add "strcat(pinfo->maildrop, "/"); at  line 998(?)
      3. Create patch with diff -u pop_passwd.c.orig pop_passwd.c
 3.1 Name patch like so: patch-pop_passwd.c_in
  patch-[file name]_in
      4. place patch file in /usr/ports/mail/teapop/patches/patch-pop_passwd.c_in
      5. Execute "sudo make clean" and "sudo make package".
      6. Scp package to server.
      7. Unzip on server (my servers did not have gcc or other tools installed for security reasons).
      8. mv /usr/local/libexec/teapop to /usr/local/libexec/teapop.orig
      9. Copy new teapop executable to /usr/local/libexec/teapop
      10. Enjoy your patched program!

How To Print Unique IP Addresses from Apache Log File

I like to use the command line for simple tasks and this is something I've used as a basis for scripts in the past.


# Print unique ip addresses from apache logfile
cut -f 1 -d " "  [APACHE LOG FILE] | sort -nu

How To Use 'df' and 'awk' to View Disk Usage

One of my favorite command line tools for viewing disk usage is 'df'.  It's simple but with a few pipes, awk and grep it can do some neat things.

The line below only shows files or directories that match [something]G in the file size reported by 'df':


sudo du -h . | awk '{print $1 " " $2}' | grep ^[0-9.]*G

Wednesday, December 21, 2011

Acer Aspire 3680 Love

Recently, a family member asked me to recover data off of a failed hard-drive in an Acer Aspire 3680.  This was a $300 laptop at Wal-Mart several years ago.  I was able to remove the drive and recover the data.  Rather than go through the cost of upgrading the drive and the OS (it was running Vista and Win7 is much superior) we replaced it with a $300 unit from Best Buy with Win7 already installed.  This left me with an old machine to play with...

I had upgraded the RAM in this machine a while back to 2GB and I happened to have 60GB Razor SDD handy from an earlier upgrade.  This seemed to be a fine platform to test the usability of the current Ubuntu 11.10. 

It installed perfectly, it sleeps, wakes up, controls the fan and WiFi works (almost) out of the box!

I use a Microsoft Natural Ergonomic Keyboard and a Kensington roller ball with an LG 23" Flatron monitor and it rocks! 

I go back and forth between this Acer and my new MacBook Pro when sitting at my desk (the MacBook is in use when I need to be portable).

Seriously a fantastic setup and I've considered traveling with it but the battery life is poor and it doesn't have iTunes (yes, I'm sort-of bought into the Apple ecosystem).

Anyway, I was so happy I had to share.


Scott

Android Development is on Hold

I have returned to school, begun volunteering in a meaningful way, increased my responsibilities at work and re-focused on family. In short, Android development has moved to the bottom of my priority list.

When I finish school next year, I plan to take a semester off and learn iOS dev and port my calculator; I have yet to find a calc with a tape-like memory where you can view the previous calculations and click on them for reuse.

Tuesday, December 6, 2011

Organizing with Dropbox

Dropbox rocks! I have been using it for more than two years to manage non-sensitive personal data.

Last year I began using it for school in a big way and couldn't be happier with the results.

I keep most of my web passwords in KeePass(x) and keep the database synched in DropBox. 

It syncs with all my devices; Linux, Mac, Windows, Android and iOS; everything anyone could need to keep their data synched up.

It's hard to beat and you should try it out!