Skip to content

Instantly share code, notes, and snippets.

View gdunstone's full-sized avatar

Gareth Dunstone gdunstone

View GitHub Profile
#!/bin/bash -xe
echo "USAGE ./generate_gigapan.sh </dir/to/images> <output_prefix> <#threads>"
tmp=/tmp/hugin_batch_script_$RANDOM
mkdir -p $tmp
initial_pto="$tmp/$RANDOM.pto"
cp_pto="$tmp/$RANDOM.pto"
#!/bin/bash
if [ $# -lt 1 ]
then
echo "USAGE: $0 <block device>"
exit 1
fi
read -p "about to format $1, Are you sure?" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
Command being timed: "bash -xe generate_gigapan.sh ./ test1 16"
User time (seconds): 1913.30
System time (seconds): 1.43
Percent of CPU this job got: 111%
Elapsed (wall clock) time (h:mm:ss or m:ss): 28:39.25
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 402464
WITH 16 CORES
Command being timed: "bash -xe generate_gigapan.sh ./ test1 16"
User time (seconds): 1913.30
System time (seconds): 1.43
Percent of CPU this job got: 111%
Elapsed (wall clock) time (h:mm:ss or m:ss): 28:39.25
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
#!/bin/bash
if [ $# -lt 1 ]
then
echo "USAGE: $0 <block device>"
exit 1
fi
devs=($1*)
#!/bin/bash
if [ $# -lt 1 ]
then
echo "USAGE: $0 <block device> $1 <name>"
exit 1
fi
tmp=/tmp/SPC-OS_rename-$RANDOM
mkdir -p $tmp/root
#!/bin/bash
if [ $# -lt 1 ]
then
echo "USAGE: $0 <block device>"
exit 1
fi
read -p "About to format $1, Are you sure (y/N)?" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
# Initialisation
sudo rsync -avhP ./etc/init/leapd.conf /etc/
# Device rules
sudo rsync -avhP ./lib/udev/rules.d/25-com-leapmotion-leap.rules /lib/udev/rules.d/
# Daemon
sudo rsync -ahvP ./usr/sbin/leapd /usr/sbin
# Executables
# extract package data
pattern="Leap-2.*x64.deb"
files=( $pattern )
ar vx ${files[0]}
tar -xf data.tar.xz
# Initialisation
sudo rsync -avhP ./etc/init/leapd.conf /etc/
# Device rules
@gdunstone
gdunstone / nginx_public_html
Created January 9, 2017 02:29
NGINX rule for public_html dir with basic auth
location ~* \~(.*)/(.*$) {
auth_basic "Restricted";
auth_basic_user_file /home/$1/public_html/.htpasswd;
alias /home/$1/public_html/$2;
}