Linux

Start/Stop script for a prosess run as another user

#!/bin/sh # rc.flexlm – Init.d start/stop script for the FlexLM License Manager # Variables: LM_DIR=”/usr/local/matlab71/etc” LM_BIN=”lmgrd” PROG_BIN=”$LM_DIR/glnx86/$LM_BIN” LICENSE_FILE=”$LM_DIR/license.dat” RUN_AS=flexlm LOG_FILE=”/var/log/flexlm.log” PROG_ARGS=”-c $LICENSE_FILE -l $LOG_FILE” # Sleep time for restart. SLEEP=1 start() { echo -n “Starting FlexLM License Manager ($LM_BIN): ” # already running? PID=$(pidof -s $PROG_BIN) if [ -z $PID ]; then # Initialize log […]

Read More
Photo etc

Nikon and capture image function from remote PC

I just figured out another nifty feature! The D70 has two USB connection modes, “mass storage” where the camera pretends to be an external hard drive, and PTP, which is an industry standard camera-computer USB protocol. Using PTP, it does not seem possible to download the camera contents with gphoto2, as I had with my […]

Read More
Windows

dcraw examples

dcraw is a linux/Windows command line tool. It can convert RAW-files and that does also include Nikons NEF-files. Raw photo decoder “dcraw” v8.73 by Dave Coffin, dcoffin a cybercom o net Usage: dcraw [OPTION]… [FILE]… -v Print verbose messages -c Write image data to standard output -e Extract embedded thumbnail image -i Identify files without […]

Read More
Scripting

Emerge new system from old World file

A slick script or method to compile the apps listed in the world file, from an existing system to the new system, all together at once, rather that typing in all of those application names into one giant emerge command. emerge -av $(cat /path/to/oldworld)

Read More
Scripting

Compare Two Flat E-mail Lists with PHP

So here’s how I parsed to flat files with e-mail addresses (nothing special about it) approved_emails.txt has the following emails in it: email1@email.com email2@email.com check_emails.txt is composed of: email1@email.com email3@email.com email4@email.com My php file that I’m actually running from a command prompt is check_email_addresses.php < ? $approved_emails = file(“approved_emails.txt”); $check_emails = file(“check_emails.txt”); foreach ($check_emails as […]

Read More