fogbound.net




Tue, 8 Jan 2013

iPhone 5 Wallpapers

— SjG @ 8:48 pm

I needed to change my iPhone lock screen image. With no further aesthetic commentary, here are three Retina-ready, iPhone 5-sized images you can use. They’ll also work on non-Retina or lower-resolution iPhone screens, you’ll just have to select a portion of the image (or scale it down). If you don’t know how to install Wallpaper images on your iPhone, the first page I Googled gave a pretty good step-by-step.

(Click on the thumbnail to see the full-size versions; right-click to download them)

Enjoy!


Mon, 31 Dec 2012

Weight of Things

— SjG @ 4:26 pm

It was bad luck that Ponderus, Fifth Imperial Lord of Varia, was born on a day with exceptionally light gravity. The Royal Minister of Standards duly weighed out the calibration stones, and a clockwork chain of events began: the Royal Metallurgist selected materials from her mineral store-room, and crafted the Standard Unit; from there, countless copies were cast at the Imperial Forge, endless couriers and emissaries spread out across the land, bringing the new metric to cities, towns, and villages alike.

Merchants groaned at the new metric, for, as luck would have it, the Fourth Imperial Lord had been born on a day of extremely high gravity, thus the old metrics had been small and easily carried. Now with Ponderus, the Fifth Imperial Lord, this convenience was gone. If someone purchased a simple quarter King of flour, it required seven large stones on the balance.

It was a mere four months later when Simon Waggoner, a potato farmer, had had enough. Over the course of the morning, he’d had to weigh out a thirty-king of potatoes twelve times, and something inside him snapped. In the middle of the market, he threw down his metrics onto the floor, shattering two of them. The entire throng of merchants, farmers, restauranteurs, household shoppers, and all fell silent and drew back. Inevitably, the word would get out, and soon armored legions of the Royal Knights would march in.

“Friends,” implored Simon. “I am nothing if not a loyal subject of his Supreme Majesty. But, if he loved his subjects, would he not give us a convenient weight, regardless of the day’s gravity?”

And thus the War of The Metric began…


Fri, 12 Oct 2012

Resizing LVM partitions

— SjG @ 10:30 am

I ran into a problem where the default installer for RHEL had configured a server’s partitions in a way that was really suboptimal for how the server was being used. It looks like the default was intended for workstation use or one in which a lot of users would keep their stuff in home directories, but this system is being used as a web application server. The root partition filled up, and the database (with its files in /var) got quite unhappy.

[root@epicwin]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_epicwin-lv_root
50G 47G 0 100% /
tmpfs 1.9G 76K 1.9G 1% /dev/shm
/dev/sde1 485M 80M 380M 18% /boot
/dev/mapper/vg_epicwin-lv_home
532G 198M 505G 1% /home

So I had to learn some LVM basics, and move the space around. I found various instructions out there, but many of them were missing steps or glossed over whether or not I’d suffer data loss. Here’s how I solved my problem (without data loss!) and got the system back on its feet.

  • Boot into “rescue” mode.
  • Decline to mount the existing system or filesystem for repair, instead go straight to a root shell.
  • Activate the LVM system:
    lvm vgchange -a y
  • Make sure the filesystems are clean:
    e2fsck -f /dev/mapper/vg_epicwin-lv_home
    e2fsck -f /dev/mapper/vg_epicwin-lv_root
  • Reduce the size of the lv_home logical volume from 540G to 40G:
    resize2fs /dev/mapper/vg_epicwin-lv_home 40g
    lvreduce -L 40g /dev/mapper/vg_epicwin-lv_home
  • Expand the size of the lv_root logical volume from 50G to 550G:

    lvextend -L +500g /dev/mapper/vg_epicwin-lv_root

  • Expand the filesystem on the root logical volume:

    resize2fs /dev/mapper/vg_epicwin-lv_root

  • Exit shell / reboot.
  • Watch SELinux freak out on next boot:

    *** Warning -- SELinux targeted policy relabel is required. ***
    *** Relabeling could take a very long time, depending on file ***
    *** system size and speed of hard drives. ***

  • Watch SELinux print asterisks and then the system reboot unexpectedly in a way that looks quite disturbingly bad.
  • System comes up clean!

A few notes:
If /home had a lot of stuff in it, this would obviously be a lot more complicated. This approach works because I had the space and it wasn’t being utilized. if /home had been closer to full, the approach would have been to add a new physical drive, and it to the logical volume set, and then do something similar to the above.


Thu, 11 Oct 2012

Perplexing

— SjG @ 8:40 pm

I have to admit, this latest presidential election has me perplexed1. Why is there even a contest? The Democrats love Obama, and the Republicans should too. After all, the Obama administration is the apotheosis of traditional supply-side GOP ideals — a Republican wet dream. “Wait. What?” I hear you say. Turn off the partisan filters for a moment, and consider the following facts:

  • Corporate profits are at an all-time high.2
  • CEO salaries are the highest ever.3
  • Wall Street salaries are close to the highest they’ve ever been.4
  • The Stock Market is within a few percent of its all-time high.5
  • Interest rates are the lowest on record.6
  • Corporate Taxes are at the lowest effective rate ever (recording begun in 1947).7
  • Tax rate for highest earners is the lowest it’s been since 1931.8
  • The US Defense budget is at an all-time high.9
  • There are more deportations of illegal immigrants than ever.10
  • More terrorists / enemy militants killed per year than ever before11

So, given this list, why is the current administration so hated by the American Right and so loved by the American Left? We have, in essence, a pitched battle between two symbols, which we choose to take at face value. Never mind that the actuality is nothing like what it says on the label12.

1 OK, not really. But the phrase works better, rhetorically. This entire posting should be considered in that light.

2“Corporate Profits Just Hit An All-Time High, Wages Just Hit An All-Time Low”, Business Insider Magazine, 22 June 2012.
US Department of Commerce, Bureau of Economic Analysis.

3“Historical Trends in Executive Compensation” (PDF), 1936-2003, Carola Frydman and Raven E. Saks, November 15, 2005.
“C.E.O. Pay Is Rising Despite the Din,” NY Times, 16 June 2012.
United States Bureau of Labor Statistics, Occupational Employment Statistics survey for 2001-2010.

4“Wall Street Pay: A Record $144 Billion, Financial Overhaul Has Affected Structure but Not Level; Revenue-to-Compensation Ratio Stays Flat”, Wall Street Journal, October 11, 2010.
“The Giant Pay Gap Between Wall Street And Everyone Else Isn’t Going Anywhere”, Business Insider Magazine, October 10, 2012.

5The Dow Jones Industrial Average was 13,494.6 on 3 Oct 2012, the all time high was 14,164.53, so it’s only 4.8% down from the highest it’s ever been. The S&P 500 was 1,450.99 on 3 Oct 2012, the all time high was 1,576.09, so that’s a bigger gap, but it’s still only 8% down from the all-time high.

6“Mortgage rates now below even lows of early 1950s”, Associated Press, 30 Sept 2011.
National Bureau of Economic Research, Macrohistory: Interest Rates.

7St. Louis Federal Reserve Bank, FRED® Economic Data, “Graph: Federal Government: Tax Receipts on Corporate Income (FCTAX)/(Corporate Profits After Tax (CP)+Federal Government: Tax Receipts on Corporate Income (FCTAX))”

8Historical Top Tax Rate, Tax Policy Center of the Urban Institute and Brookings Institution.

9Government Printing Office, Budgets
US Census Bureau historical records

10“President’s Approval Rating Drops, but He Leads 2012 Rivals. As Deportations Rise to Record Levels, Most Latinos Oppose Obama’s Policy” PEW research, 28 Dec 2011.
Numbers may have been inflated by changes in how they’re counted; even so, deportations are still higher than Bush numbers. “Deportation statistics said to be inflated”, Washington Times, 23 August 2012

11“The Year of the Drone. An Analysis of U.S. Drone Strikes in Pakistan, 2004-2012” New America Foundation

12And just so you don’t think I’m picking on the Democrats alone, I only point out the one side as it’d take a whole additional posting to show that the Republicans are the “spend and borrow” party, etc.


Mon, 17 Sep 2012

Cambot’s First Campaign

— SjG @ 10:30 pm

Cambot is a project based on the Teensy development board. Cambot creates an infra-red “trip beam” that triggers a pre-focused Nikon D90.

To create an IR beam and detector that work in direct sunlight, Cambot pulses the IR source every 10ms, and compares detected signal between the on and off states. If it’s greater than a threshold, it’s considered a valid signal. The sensor also has a vary small aperture which is additionally shielded with a filter to reduce the ambient IR. When powered on, Cambot goes into calibration mode, which lights up an LED when it detects a good signal. This is critical for lining up the IR sources and detector — once a good signal is sustained for 3 seconds, Cambot goes into “armed” mode. When armed, breaking the beam will turn off the IR source, half-press the camera’s shutter for 10ms so the camera can compute exposure, and then fires off a burst of pictures before re-arming itself.

While there’s nothing in Cambot that couldn’t have been implemented with, say, 555 timers, counters, and gates, having the ability to drive digital logic with C code makes things much more flexible. When trying to determine the proper threshold values for arming and triggering, the ability to output hex data over the USB connector to a host computer was invaluable.

Here’s Cambot’s first run, when the trip-beam was positioned over a tempting milkweed blossom in the back yard.

If there’s any interest, I’ll post a circuit diagram and source code.