Monday, December 24, 2012

keep a dark background when toggling between light/dark inverted modes in OSX


keep a dark background when toggling between light/dark modes in OSX
(Use something other than control-shift-option-8 to trigger, I'm using control-command-8)

If background stays light, toggle state of c-s-o-8 once to get background in sync first.

save as an applescript service that receives no input:

tell application "System Events"
  tell current desktop
    get properties
    set desktop_pic to picture as Unicode text
  end tell
end tell

if "Light" is not in desktop_pic then
  set desktop_pic to POSIX file "/Library/Desktop Pictures/Solid Colors/Solid Gray Light.png"
else
  set desktop_pic to POSIX file "/Library/Desktop Pictures/Solid Colors/Solid Gray Dark.png"
end if

tell application "Finder"
  set desktop picture to file desktop_pic
end tell

tell application "System Events"
  tell application processes
  key code 28 using {command down, option down, control down}
  end tell
end tell



inspired by: http://kinderman.net/articles/2007/11/11/reversing-screen-colors-on-a-mac-and-keeping-a-black-background-on-terminal

Wednesday, September 5, 2012

preferred list of openwrt packages


packages we like installed on our openwrt:

bash
less (requires: opkg install less --force-overwrite):
curl
tcpdump
ip
luci-app-qos
ntpdate

Tuesday, August 28, 2012

LVM based mirrors (kinda suck)

I recently noticed that my mirrored LVM volume wasn't.

No notice, no visible warnings in 'lvm' output or anything.

Neat.

Recovery instructions:

http://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/mirrorrecover.html

Now to add monitoring.

Sunday, April 22, 2012





http://wdc.com/en/products/products.aspx?id=330

Considering the good reviews everywhere -- this looks like it will be my MythTV frontend.

http://www.mythtv.org/wiki/WD_Live_HD_Media_Player
says it will apparently work out of the box.

If it does netflix and huluplus, total win.
Film at 11.


Saturday, April 21, 2012

Chrome loses your preferences - gah.

http://saravananthirumuruganathan.wordpress.com/2010/05/10/how-to-solve-your-profile-could-not-be-opened-correctly-issue-in-chrome-or-chromium-without-losing-your-profile/

Restored from backup /Library/Application Support/Google/Chrome/Default/Preferences


Create a new browser user profile:

http://support.google.com/chrome/bin/answer.py?hl=en&answer=142059

(which I didn't do.)

Wednesday, February 15, 2012

bash history collector, without external scripts



# history_logger() side effects:
#   sets global variable '_last_history_number_logged'
#     $HISTCMD special variable should actually provide this,
#     But it appears unavailable in functions or at PROMPT_COMMAND eval time.
#
function history_logger() {
  local last_exit_code=$?   # must be the first command we run in this function
  local last_history_line=$(history 1)
  local _match_me="^ ?([0-9]+)"

  # Only log if we are not root:
  if [ "$(id -u)" -ne 0 ]; then
    # only log if history number changes:
    if [[ ${last_history_line} =~ ${_match_me} ]] &&
         [[ ${BASH_REMATCH[1]} != $_last_history_number_logged ]] ; then
      _last_history_number_logged=${BASH_REMATCH[1]} ;
      echo "$(date)] ${HOSTNAME%%.*}[$$:S${WINDOW}:${last_exit_code}] ${PWD/~/\~} ${last_history_line}" >> ~/.shell.log;
    fi ;
  fi
}

# the plumbing that makes it work:
export PROMPT_COMMAND='history_logger'


A few explanatory comments, as inline comments aren't available:
• HISTCMD does not appear to be available at function call or PROMPT_COMMAND time,
   so we use the [[ history =~ regex && BASH_REMATCH ]]  to hack it
• the assignment to ${_match_me} is because regex matching doesn't work correctly otherwise.
• the shell out to $(date) seems unavoidable.
• gnu screen is setting $WINDOW
• ${PWD/~/\~} is an exercise left to the reader.


I've seen other folks try to do this –– the best I found folks doing involved calling other bash scripts from the PROMPT_COMMAND.

I hit the same problem (inside a PROMPT_COMMAND, $HISTNUM is always == 1).
My solution uses a regex to capture the last history number, and doesn't require calling a separate script or set of scripts.

Comments welcome.

Wednesday, January 18, 2012

X11/xterm bliss in OSX


I was frustrated that selection buffer in Mac's OSX X11/XQuartz(2.7.0) xterm
and the aqua clipboard doesn't sync without manual use of the Edit/Copy menu.


I have menu shortcuts turned off in XQuartz so that Command becomes my xterm Meta key.



I found:
http://gigo.com/archives/blog/apples-x11app-and-xterm-copypa.html
which led me to setup my preferences and .Xresources file thusly:


My X11/XQuartz preferences:
Input tab:
• Enable "Emulate 3 button mouse "
• Disable "Follow system keyboard"
• Disable "Enable key equivalents under X11"
• Enable "Option keys send Alt_L and Alt_R"
Pasteboard tab:
• All are enabled.


~/.Xresources file:
xterm*metaSendsEscape:   true

XTerm*VT100.Translations: #override \
Shift <KeyPress> Help: insert-selection(CLIPBOARD,PRIMARY,CUT_BUFFER0) \n\
<KeyPress> Help: select-set(CLIPBOARD,PRIMARY,CUT_BUFFER0) \n\
<BtnUp>: select-end(CLIPBOARD,PRIMARY,CUT_BUFFER0)\n

+ my personal preferences:
xterm*loginShell:               true
xterm*cursorColor:              pink

xterm.vt100.reverseVideo:       false
!xterm.vt100.foreground:         yellow
!xterm.vt100.background:         black
xterm.vt100.saveLines:          1023
xterm.vt100.scrollBar:          false
xterm.vt100.deleteIsDEL:        true
xterm.vt100.visualBell:         true
xterm.vt100.popOnBell:          true

Tuesday, January 10, 2012

remote IP camera

list of applications for "DidICloseIt":
http://didicloseit.com/?page_id=129

vnc type apps
https://market.android.com/details?id=net.xdevelop.rm Remote web desktop
• https://market.android.com/details?id=net.xdevelop.rc Remote control
• https://market.android.com/details?id=org.onaips.vnc  VNC server


adb shell /data/data/org.onaips.vnc/files/androidvncserver

Color Calibration

Nirvana or not?

[ howto printer color calibration ]
http://www.rpimaging.com/calibrate-printer.html

http://www.kenrockwell.com/tech/color-management/is-for-wimps.htm

http://www.normankoren.com/printer_calibration.html

http://www.inkjetart.com/custom/

Aperture + color profiles:  http://support.apple.com/kb/ta38346

Xrite - Workflows - Using Profiles with Third-Party Applications

printing in photoshop cs5 to epson:
http://www.gballard.net/photoshop/epson/cs5/

test images:

no color adjustment workflow:

calibrating your printer with displaymate;

Sharpening?

http://www.reallyjapan.com/blog/tutorials/how-to-sharpen-photos-in-photoshop/

Using ImageMagick

Extracting EXIF fun:

file:///opt/local/share/doc/ImageMagick//www/identify.html

and functions in FX:

file:///opt/local/share/doc/ImageMagick//www/fx.html

#RSFtalks with Edward Snowden

What an intelligent, thoughtful individual. I find it difficult to forgive 44 for failing to pardon this patriot and instead pursuing him ...

Other Popular Posts: