Skip to content

Instantly share code, notes, and snippets.

Paul Harvey csirac2

Block or report user

Report or block csirac2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
csirac2 /
Last active Aug 29, 2015
a test to show that atimes are always updating on empty dirs in read-only snapshots which were subvol parents, unlike plain empty dirs, regardless of mounting with noatime
set -e
get_atime() {
ls -lad --time=atime --time-style='+%Y-%m-%dT%H:%M:%S%z' "$1" | tail -n+1 \
| cut -d ' ' -f6 -
test_atime_stable() {
csirac2 /
Last active Nov 5, 2015
Install VeraCrypt headless for scripted environments
# It's a little insane this installer cannot be run headless, perhaps for license
# agreement reasons. This will fetch, verify and extract the binary into
# /opt/veracrypt/bin. Perhaps one day I'll help make cryptsetup understand
# veracrypt instead
set -e
csirac2 / disable-partman-hack_preseed.cfg
Last active Jul 19, 2018
disable partman from debian preseed
View disable-partman-hack_preseed.cfg
# Thanks to for inspiration..
# But what a disgusting nasty hack! This prevents partman from running (and
# mounts /target, creates /target/etc/fstab). d-i just can't cope with
# installation to partitionless block device... which is disappointing,
# because partitions are pointless for pvlinux guests.
# The hack works by ... wait for it... spawning a little while/sleep 1 script,
# waits for the partman-base.postinst file to appear (the preseed/earl_command
# hook is too early, and the partman/early_command is too late). Once it
# appears we replace this with a bit more script which does what we wanted
#On Jessie this can now be:
. /lib/cryptsetup/cryptdisks.functions
FORCE_START=1 do_start
# `prepare_dir_tarball some_dir`
# Given a directory name in the pwd (with NO trailing slash), create or update
# `some_dir.tar.gz` only if the contents of the tarball would actually change.
# Although Dockerfiles allow you to ADD a directory, this isn't cacheable.
# Instead, maintain a tarball which allows you to ADD a host directory as a file
# which *is* cacheable. I.E.:
# Prior to running your container:
View linux-v3.8_fix_mmc_for_overo.diff
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index bc58078..5093ed5 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1021,6 +1021,15 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status)
struct mmc_data *data;
int end_cmd = 0, end_trans = 0;
+ if (!host->req_in_progress) {
+ do {
csirac2 /
Created Apr 11, 2013
build new kernel deb
CONCURRENCY_LEVEL=3 make-kpkg --rootcmd fakeroot --append-to-version=.3 --initrd kernel_image kernel_headers modules_image
csirac2 / unsw_ent_mung.vim
Last active Dec 15, 2015
SIAD UNSW_ENT import into ALA sandbox
View unsw_ent_mung.vim
# Original header:
# Name Country State or province Secondary subdivision Locality Latitude Longitude Elevation meters Coll. start date Coll. end date Collector UID USI Number of specimens Sex Type status DeterminationVB DetBy DetDate Host Family Host name Host authority Host det HerbID Depository Host photo Locality photo _end
# Becomes:
# scientificName country stateProvince county verbatimLocality decimalLatitude decimalLongitude minimumElevationInMeters Coll. start date eventDate recordedBy catalogNumber recordNumber individualCount lifeStage sex typeStatus DeterminationVB identifiedBy dateIdentified Host Family Host name Host authority Host det HerbID Depository Host photo Locality photo _end associatedTaxa eventDate associatedMedia
# Break up the life stage/sex column
# %s/^\(\(\([^\t]*\)\t\)\{14\}\)\([^\ ]*\) \([^\t]*\)/\1\4\t\5/g
csirac2 /
Created Apr 13, 2012
perltidy filter for Method::Signatures & friends
package main;
use strict;
use warnings;
use Perl::Tidy();
my $secret = '# __PERLTIDY_IGNORING ###';
my $secret_sub = '# __PERLTIDY_KEYWORD: ';
sub perltidy {
csirac2 / drop.js
Created Nov 8, 2011
drop matching databases
View drop.js
use webs{_id : /^ParentWeb/i}).forEach(function (thing) { db = db.getMongo().getDB(thing.hash); db.dropDatabase(); });
You can’t perform that action at this time.