Archive for the ‘Toys’ Category

Apple Genius Bar Advice on Notebook Battery Life

Sunday, December 13th, 2009

I talked to an Apple Genius recently about improving notebook battery life.

His recommendations to improve notebook battery life were:

  • kill any runaway programs
  • reduce screen brightness to 50% or less
  • move any Desktop files you don’t need on the Desktop to another folder. This reduces the amount of screen redraw work.
  • update to the latest SMC firmware
  • once a month, unplug the power adapter and run your notebook until it sleeps automatically. Then plug in the adapter and allow it to charge for 8 hours.
  • if there’s still a problem, drop by an Apple store and he’ll run the battery diagnostics program from their bootable service iPod nano. Bring along your receipt in case there’s a problem still covered under warranty.

Reducing the screen brightness from max to 50% immediately improved battery life on my old notebook by 50%, from about 2:15 to 3:30.

Also, remove the plastic packaging from new batteries to prevent them from permananently sticking to the plastic battery casing. The plastic is sticky on one side and can be cut into several cell phone display protectors. :)

apple.com: Apple Notebook Battery Care
apple.com: Lithium-Ion Battery Care
support.apple.com: Apple Portables: Tips for maximizing your battery charge
gizmodo.com: How To Maximize Your iPhone 3G’s Questionably Adequate Battery Life
theappleblog.com: What’s the Ideal Strategy to Maximize Notebook Battery Lifespan?

Replacing Mac Powerbook G4 12″ Keyboard

Saturday, December 5th, 2009

The Powerbook G4 12″ that I bought from Craigslist was sweet overall (1.5 Ghz, 1.5 GB RAM, 250 GB hard drive), but the keyboard looked a little ratty.

So I bought a new keyboard from a Hong Kong seller on eBay for $28.00 (including shipping) and installed it today according to the relevant faqintosh. Very shiny!

My only issue was getting the keyboard connector mated securely enough for all keys to work. And not knowing what a black stick is. :)

Update: The Apple Genius Bar will sell you replacement keyboards for $40, installation included.

faqintosh.com: Remove keyboard on a PowerBook 12”
command-tab.com: Apple’s “Black Stick”
tuaw.com: Tracking the mysterious ‘black stick’

MD1000 and MD3000 Redundancy Matrix

Friday, December 4th, 2009

I manage several Dell/Equallogic MD1000 storage arrays. They require careful understanding of their limited redundancy features.

I find that it helps to remember this: the MD1000 is a JBOD. Period. Any data redundancy actually depends on your RAID controller.

Although most components are modular, that only helps with field repair, not availability:

Device Component Feature Note
MD1000 Disks Hotswappable Yes, but depends on your RAID controller. You should offline the disk first. Note that rebuilds involving large volumes will take weeks to complete, so use 73GB disks if that’s a problem.
    Redundant Yes, depends on your RAID controller.
  Cables Hotswappable No, requires host and array power down first.
    Redundant No, MD1000 alone does not support multipath like the MD3000.
  Power Supply Hotswappable Yes
    Redundant Only for 5 minutes since 3/4 fans are required to cool.
  Fans Hotswappable Yes, as part of Power Supply module.
    Redundant Yes, 1 spare with both power supplies working.
  EMM Hotswappable MD1000 alone: Not really for EMM0, since removing EMM0 loses disk communication, and failback is not automatic. EMM1 can be hot swappable if enclosure is in unified mode, thus not used. Also, the host must be rebooted. Connected to MD3000: supposed to be hotswappable.
    Redundant MD1000 alone: No. There can be 2 EMMs installed, but if EMM0 fails, then some disk communications will be lost, whether unified or split mode. Also, no automatic failback. EMMs provide redundancy for enclosure control functions only. Connected to MD3000: supposed to be fully redundant.
  Front Panel Hotswappable No, requires power down and enclosure disassembly to replace.
    Redundant No, only 1.
  Firmware Updates without Reboot Server Maybe with latest firmware, but a reboot is recommended (common sense), especially with multiple arrays.
    MD1000 Maybe with latest firmware and Perc 6/E. See R216024. A reboot is recommended (common sense), especially with multiple arrays.
  Clustering   MD1000: No. MD3000: Yes, should work if you’re lucky.

Notes:

  • A backup is recommended and needed before any configuration changes are made in hardware or software.
  • Adding a MD1000 to an existing daisychain requires latest firmware to be loaded first. Mixing firmware is undefined. Also a reboot has been required in the past.
  • Adding a MD1000 to MD3000 daisychain requires reformatting of MD1000 disks.
  • Adding a MD1000 to a MD1000 daisychain renumbers the enclosure IDs.
  • All MD1000s must finish startup before MD3000s, and before host servers, or disks will be “missing” or “foreign”. So configure servers to “off” after power failure.
  • In fact, Perc controllers can “forget” their volume configuration after reboot, so put everything on a UPS and never reboot.
  • MD3000 with MD1000s daisy-chained from 2 HBAs supports redundant cables.
  • Do not read log if a rebuild is in progress.
  • Snapshots can be done with linux and any filesystem that supports it, such as ext3 with LVM.

So what are you paying for? Basically, a well-manufactured, well-tested, non-HA, field-serviceable DAS device with good Linux and Windows support and reasonable performance without licensing encumbrances (well, Dell has starting to restrict disk replacements.) Most people who buy other no-name JBOD devices that I’ve talked to never get something that works right, though SuperMicro multi-disk servers seem to be popular.

Choosing the iSCSI versions could avoid a lot of the cabling and reboot order issues.

Please add a comment with your suggestion or tip about managing the MD1000 or MD3000, or recommendations for affordable, more-available arrays.

Dell Powervault MD1000 Manuals
MD3000 and MD3000i – Generation 2 Firmware Update (2008-12-21)
Dell Support Forums: MD1000 Redundant EMM?
bladewatch.com: Dell Server Firmware
dell.com: PERC 5/E Fault Tolerance Features
ftp.dell.com: Dell PERC 6/i Integrated Firmware Update 6.2.0-0013 – R216024
INetU Labs takes on the Dell MD3000i: Is it an Enterprise-capable workgroup SAN?
IDC numbers show Dell server storage booming

theregister.co.uk: Dell servers block un-Dell HDDs
dell.com: Third-party drives not permitted on Gen 11 servers
dell.com: Why Customers Should Insist on DELL™ Hard Drives for Enterprise Systems
cyberciti.biz: RAID 5 vs RAID 10: Recommended RAID For Safety and Performance

Nagios check_http.c Patch to Display Result Page Snippet

Tuesday, December 1st, 2009

Nagios LogoHere’s a minor change to the nagios plugin check_http.c that shows the first 128 bytes of the page body if the -s match option is used:

  /* check elapsed time */
  if (strlen(string_expect) && strlen(page)) {
#define MAX_BUFFER_PAGE_SAMPLE 128
     char s[MAX_BUFFER_PAGE_SAMPLE];
     strncpy(s, page, MAX_BUFFER_PAGE_SAMPLE);
     s[MAX_BUFFER_PAGE_SAMPLE-1] = 0;
     /* Need to strip JavaScript here to prevent XSS */
     strip_xss(s);
     strip(s);

     asprintf (&msg,
            _("%s - %d bytes in %.3f second response time %s%s|%s %s"),
            msg, page_len, elapsed_time,
            (display_html ? "" : ""), s,
            perfd_time (elapsed_time), perfd_size (page_len));
  }
  else {
     asprintf (&msg,
            _("%s - %d bytes in %.3f second response time %s|%s %s"),
            msg, page_len, elapsed_time,
            (display_html ? "" : ""),
            perfd_time (elapsed_time), perfd_size (page_len));
  }

void
strip_xss (char *t)
{
   char *s;

   for (s=t;*t;*t++) {
       if (*t == ' ' ||
           *t == '.' ||
           *t == '-' ||
           *t == '\'' ||
           *t == ':' ||
           *t == ',' ||
           isalnum(*t)) {
          *s++ = *t;
       }
   }
   *s = 0;
}

Then you can use the usual Nagios check_http command with the -s option:

# 'check_http_str' command definition with options:
# -u URI without leading scheme and hostname
# -s "string" to match
# -M seconds is max acceptable age of page
# -L $HOSTADDRESS$ makes it a hyperlink to source page

define command{
        command_name    check_http_str
        command_line    $USER1$/check_http -I $HOSTADDRESS$ -u "$ARG1$" -s "$ARG2$" -M $ARG3$
        }

The result looks like:

HTTP OK: HTTP/1.1 200 OK - 377 bytes in 0.163 second response time
OK - System: 'PowerEdge 2950', SN: 'N1234', hardware working fine,
11 logical drives, 51 physical drives

The improved status display allows me to more easily use HTTP for remote nagios monitoring, instead of NRPE. Almost worth dropping into C for. :)

Dell MD1000 and Samsung 1 TB HE103UJ-1113 RAID Drive

Sunday, November 29th, 2009

Samsung HE103UJ 1 TB Hard DriveI was in Fry’s Campbell a few days ago, and inquired which 1 TB Enterprise drives they carried.

They only stock one model, the $120 Samsung 1 TB HE103UJ-1113 RAID drive.

So I bought two drives and have been testing them in a Dell 2950/MD1000/Perc5E running CentOS 5.3 64-bit, and the latest Dell firmware as a RAID1 (mirroring) volume.

So far, so good …

The Samsung drives were recognized by the Perc5E BIOS, and Dell OpenManage and LSI MegaCli work fine. After configuring the RAID1 volume, I created an ext3 filesystem.

What’s really nice is that the Dell’s Perc vendor, LSI, officially supports the HE103UJ in their new 87xx/88xxx RAID controllers. So as long as the drives are reliable, LSI will likely continue to support and test them.

Here’s what omreport says:

$ omreport storage pdisk controller=1

[...]
ID : 0:2:0
Status : Ok
Name : Physical Disk 0:2:0
State : Online
Failure Predicted : No
Progress : Not Applicable
Bus Protocol : SATA
Media : HDD
Capacity : 931.00 GB (999653638144 bytes)
Used RAID Disk Space : 931.00 GB (999653638144 bytes)
Available RAID Disk Space : 0.00 GB (0 bytes)
Hot Spare : No
Vendor ID : DELL
Product ID : SAMSUNG HE103UJ
Revision : 1AA01113
Serial No. : S13VJ1KS600078
Negotiated Speed : Not Available
Capable Speed : Not Available
Manufacture Day : Not Available
Manufacture Week : Not Available
Manufacture Year : Not Available
SAS Address : 50022192C4394888

ID : 0:2:1
Status : Ok
Name : Physical Disk 0:2:1
State : Online
Failure Predicted : No
Progress : Not Applicable
Bus Protocol : SATA
Media : HDD
Capacity : 931.00 GB (999653638144 bytes)
Used RAID Disk Space : 931.00 GB (999653638144 bytes)
Available RAID Disk Space : 0.00 GB (0 bytes)
Hot Spare : No
Vendor ID : DELL
Product ID : SAMSUNG HE103UJ
Revision : 1AA01113
Serial No. : S13VJ1KS600079
Negotiated Speed : Not Available
Capable Speed : Not Available
Manufacture Day : Not Available
Manufacture Week : Not Available
Manufacture Year : Not Available
SAS Address : 50022192C4394887

$ omreport storage vdisk controller=1

[...]
ID : 6
Status : Ok
Name : vd15
State : Ready
HotSpare Policy violated : Not Assigned
Progress : Not Applicable
Layout : RAID-1
Size : 931.00 GB (999653638144 bytes)
Device Name : /dev/sdi
Bus Protocol : SATA
Media : HDD
Read Policy : No Read Ahead
Write Policy : Write Back
Cache Policy : Not Applicable
Stripe Element Size : 128 KB
Disk Cache Policy : Enabled

The results from hdparm are as expected for 2 SATA drives in a RAID1 volume:

$ hdparm -tT /dev/sdi

/dev/sdi:
Timing cached reads: 20896 MB in 1.99 seconds = 10485.84 MB/sec
Timing buffered disk reads: 360 MB in 3.00 seconds = 119.96 MB/sec

Aventis Systems has used the Seagate ST31500341AS 1.5 TB “Desktop RAID” Drive
wikipedia.org: RAID
Moritz’ Perc5 Cheat Sheet
LSI MegaRAID Interoperability Report for 87xx/88xx Series, June 18, 2009

Accelerating Personal Internet Access with Squid

Thursday, November 26th, 2009

squid-cache logoI’ve been using the free Squid proxy on my Mac and Windows notebooks for a few weeks.

One motivation was the horrible wifi access during my last trip to Asia, especially the HK airport departure area. Both DNS lookups and HTTP requests were glacial, with name lookups taking 1 second or more – as if the sites were hosted on the moon.

The main feature of Squid is that it transparently caches (makes a timestamped copy) of files that are downloaded from a network connection, so you only need to fetch them once.

Squid also has additional security features, like ACLs, and load balancing.

The advantages of running Squid on my notebooks are:

  • even though web browsers have a cache manager, squid still reduces page load times, the result being pages load 2x to 5x faster with squid proxy. Generally I use 8 Mbps DSL and local public wifi hotspots for Internet access. In areas with unreliable Internet access, the benefits of Squid would be even more dramatic.
  • web site pages are more likely to finish loading within a reasonable timeframe (browser status bar says “Done” in a few seconds)
  • the WordPress admin UI is actually usable for the first time in recent memory, indicating that AJAX apps are also helped by caching JavaScript.

The minor disadvantages include:

  • it is possible that a stale object could be cached. If you’re a web designer or digital artist, you should be aware of that and know how to clear the cache. To force cache clearing of a specific item you can use the squidclient command line tool:

    squidclient -m PURGE 'URL'

  • anybody who gains access to your notebook would be able to see what sites you’ve visited, so it would be a good idea to clear the cache weekly.

Installation

Mac OS X

Squid is trivial to install on a Mac with MacPorts installed:

sudo port install squid
sudo port load squid
# configure your browser's proxy setting to point to http://127.0.0.1:3128

To uninstall Squid later:

sudo port unload squid
sudo port uninstall squid

To clear the Squid cache:

sudo port unload squid
sleep 10
sudo squid -z
sudo port load squid

Microsoft Windows

The Squid Windows port is available from 2 places:

  1. Running a Squid Proxy Under Windows No configuration is needed for use on localhost.
  2. Acme Consulting.

Resource consumption by squid with the default configuration is negligible with any computer made in the past 5 years.

Squid Reporting

Squid comes with a basic textual reporting tool called cachemgr.cgi. Sadly, it requires that you install apache or IIS to run it – the program should have been written as a built-in squid resource.

CacheMgr does give you basic reporting on cache hit rates and object usage, but end-users will get bored in a day or so, at which time the web server can be uninstalled.

Some issues to consider when using CacheMgr, which can largely be mitigated with binding the web server to localhost or using a .htaccess file:

  1. access to the remote shutdown facility
  2. access to who is downloading what could be fairly sensitive information (Cache information shows FDs with the IP and the URL they are accessing)
  3. maybe a resource drain while listing Objects
  4. running a web server is required.

webalizer is a cross-platform graphical web reporting tool that can parse squid logs and is easy to install. It can be run from the command line and generates HTML and graphics files that can be viewed locally or shared using a webserver.

Squid LAN Configuration

To allow multiple computers to use a single squid proxy, squid.conf would need to say something like:

http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
acl mylan src 192.168.10.0/255.255.255.0
http_access allow mylan
http_access deny all
cache_dir /squid.cache 5000 16 256

Squid FAQs

Load Balancing and Routing with Two ISP Connections Overview

Saturday, November 21st, 2009

Connecting 2 different Internet providers to your home or office can provide a number of benefits:

  1. connection fail-over, increasing availability (best compatibility, since only 1 network route provided from your office to a remote site, and thus most likely to work reliably)
  2. load balancing, increasing total bandwidth (2 routes available, which can confuse secure sites, and SOHO devices usually have practical issues)
  3. reducing Internet access cost by replacing 1 expensive provider with 2 cheaper, perhaps less-reliable or slower providers.

How you connect with 2 different ISPs depends on whether you want to buy or build …

Here’s 3 options to consider:

1. DIY with Linux iptables

  1. assemble a linux machine with 3 network interfaces (WAN1, WAN2, LAN)
  2. read the iptables page on split access and multipath routes, understanding that you are getting routing-based stickiness
  3. do some testing and tweaking of weights and other configuration items.

You don’t have to be a network engineer to get this working, but you should know things like static routing with the linux route command, to have a reasonable chance of success.

I’d suggest investing at most 4 hours in a project like that, then move on to one of the next options.

2. Use an Existing Open Source Project

  1. pfSense – based on FreeBSD. Dual-WAN Load Balancer FAQ, Dual-WAN Router Tutorial.
  2. Untangle is a subscription-pay but 95% Open Sourced software firewall with WAN failover ($5+/month) or WAN load balancing ($10+/month) modules
  3. m0n0wall, based on FreeBSD, is working on multi-WAN support
  4. LokiWall1 for Linux (2006)
  5. LokiWall2 for Linux (coming soon)

3. Buy a Dual-Wan Router Appliance

There are several SOHO appliances available for under $350.00:

  • Cisco (LinkSys) RV042 and RV082 (fanless, size of a hardcover book, is export-restricted, requires a free online support account and approval of 3 EULAs to download drivers.) I have used the RV082 for a month, and noticed: the built-in switch ports cannot drive cables longer than about 15 meters, the default failover probe settings are 5x for 30 seconds, which is too long, so I use 3x for 15 seconds. Otherwise it seems to work ok with two WAN connections, one fiber and the other DSL, though failback is not supported and failover is not logged. The average IT employee or power user can configure the web-based admin screens with no training.
  • Netgear FVX538 and FVS336
  • Netgear FVS124G (Discontinued)
  • HotBrick LB-2 (XinCom XC-DPG502?)
  • Peplink

Most, if not all appliances, are just linux or BSD embedded systems. But appliances are pre-tested, nicely packaged, and have a friendly web-based UI and technical support.

Also, an appliance will use less power and emit less noise than the typical desktop PC running linux.

Unfortunately, it’s hit-or-miss whether your appliance (or it’s firmware version) will work reliably. Most blogs report less than glowing results, especially with load balancing.

tomshardware.com: Dual WAN router suggestions needed (2008)
dslreports.com: Best Dual Wan Router? (2007)
Advantages/Disadvantages of Dual Wan Routing
linuxquestions.com: Script to Load Balance two ISPs with ip route & ip rules
mikrotik.com
Soekris

HP Procurve J9028A 1800-24G Switch Review

Saturday, November 21st, 2009

Here’s some notes on the HP Procurve J9028A 1800-24G gigabit switch. I use a few in a data center.

They are managed via a web interface, not telnet or ssh.

If you look at the changelog, some serious bugfixes have been released regarding usability and features, so it’s important to update the firmware.

J9028A Pluses:

  • 24x 10/100/1000 switch ports, 2 of them dual-personality mini-GBIC slots. Each port has several duplex settings.
  • Jumbo frame support up to 9216 bytes, but switch-wide, not per port (Cisco IOS is much worse, though. See link below.)
  • supports 64 VLANs numbered up to 4096, with 1 reserved for mgmt. The documentation recommends just using VLAN 1, which is a security hazard in the networking world. The web UI does a good job of preventing the user from disabling ports because of misconfiguration in the current firmware revision, but don’t assign the port you connected in with to a different default VLAN than 1, or you will be denied mgmt. access on that port.
  • read-only SNMP (haven’t figured out if the counters are 64-bit yet)
  • lots of protocols supported, including LACP, priority, flow control, etc.
  • good performance specs – 1000 Mb Latency <3.0 µs (64-byte packets) and 48Gbps, compared to much worse performance of consumer gear like Linksys and Netgear.
  • web UI in current firmware is very nice, showing a detailed graphical model of the switch, and fairly useful help dialogs. Comparable to Netgear GS108T feature-set overall, which is a compliment.
  • modest power consumption – about .50 amps at 110 volts to boot, .25 amps when idle according to my KilloWatt. The manual lists a max of 0.4/0.8. Light and compact at 1U. Could prolly run fanless – the manual says it is, but something is generating a buzzing noise and there’s a fan cutout in the case
  • relatively quiet – makes a slight buzzing sound and could prolly use in office environment, but not at home outside of a closet.
  • recently discontinued by HP, so available for cheap ~$150 each. Originally came with free rack-mounting ears.

J9028A Minuses:

  • weird front-panel link and activity status LEDs that have a modal switch, looks like it was originally designed for 10/100-only switches. Need to break out the manual every time I look at it.
  • read-only SNMP
  • no dedicated reset switch, a full reset requires connecting Ports 1 and 2 and cycling the power, which makes remote mgmt. more difficult
  • only 1 power supply and 1 power cord
  • no per port Jumbo Frame settings, so less useful in data center VLAN situations. (Need to buy separate switches for Internet and LAN if you want to use Jumbo Frames on LAN.)
  • rack-mountable, but feels consumerish overall. Nice silk screen case artwork, though.
  • sample switch configurations on HP site don’t apply to this switch, just more advanced models.

Overall, it’s a nice switch if you can live with a web UI and single power supply.

Some configuration notes:

  • to connect multiple switches, a regular straight-through cable can be used, but configure the uplink ports as “tagged, VLAN None.” That works for me with all ports on VLAN1.
  • I wanted to use VLAN1 for mgmt. ports and VLAN2 for other ports for security reasons, but I can’t seem to ping across all switches that way. So for now all ports are on VLAN1, which is what the manual and online help suggest. I’ll have to try VLAN configuration again later.

HP Procurve 1800-series FAQ
cisco.com: Jumbo/Giant Frame Support on Catalyst Switches Configuration Example (only 6000 and up support jumbo frames per port)