Skip to content

Instantly share code, notes, and snippets.

View pansapiens's full-sized avatar

Andrew Perry pansapiens

  • Melbourne, Australia
View GitHub Profile
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@darktable
darktable / minijsonjsdemo.js
Created August 30, 2012 21:54
Unity3D: Example of using MiniJSON in UnityScript (JavaScript).
#pragma strict
import MiniJSON;
import System.Collections.Generic;
function Start () {
var jsonString = "{ \"array\": [1.44,2,3], " +
"\"object\": {\"key1\":\"value1\", \"key2\":256}, " +
"\"string\": \"The quick brown fox \\\"jumps\\\" over the lazy dog \", " +
"\"unicode\": \"\\u3041 Men\\u00fa sesi\\u00f3n\", " +
"\"int\": 65536, " +
@vibragiel
vibragiel / duptools-gdrive.sh
Last active August 25, 2017 21:46 — forked from tsileo/duptools.sh
An example on how to use duplicity to perform encrypted incremental backups on Google Drive. Changes over tileo's original script: Google Drive instead of S3 as backend storage. Zenity dialogs to ask for credentials. IGNORE variable to exclude a list of directories from the backup. Verbosity raised to level 8. Activated asynchronous uploads.
#!/bin/bash
# directories to be included, space separated
SOURCE="/home/chewie /etc"
# directories to be excluded, space separated
IGNORE="/home/chewie/Downloads /home/chewie/Steam"
DRIVE_FOLDER="duplicity-backup"
LOGFILE=/home/chewie/duplicity.log
# set email to receive a backup report
EMAIL=""
@techtonik
techtonik / hashdeep.py
Created March 16, 2013 10:45
Python - hashdeep.py - recursive hash of directory tree files in hashdeep format
"""
Build recursive hash of files in directory tree in hashdeep format.
Hashdeep format description:
http://md5deep.sourceforge.net/start-hashdeep.html
hashdeep.py differences from original hashdeep:
- if called without arguments, automatically starts to build
@proudlygeek
proudlygeek / nfs-tunnel.md
Last active February 13, 2024 17:00
Mount NFS Folder via SSH Tunnel

1. Install NFS on Server

Install the required packages (Ubuntu 12.04):

apt-get install nfs-kernel-server portmap

2. Share NFS Folder

Open the exports file:

vim /etc/exports
@robertpyke
robertpyke / _instructions.md
Last active March 10, 2021 06:41
Interfacing with Nectar's Object Store (swift - Nectar's S3 equivalent)
@mlgill
mlgill / rmerge.py
Last active March 8, 2023 18:19
A modified version of pandas merge command that will replace overlapping columns not associated with the join rather than appending a suffix.
import pandas as pa
def rmerge(left,right,**kwargs):
"""Perform a merge using pandas with optional removal of overlapping
column names not associated with the join.
Though I suspect this does not adhere to the spirit of pandas merge
command, I find it useful because re-executing IPython notebook cells
containing a merge command does not result in the replacement of existing
columns if the name of the resulting DataFrame is the same as one of the
@moonwatcher
moonwatcher / bcl2fastq_setup.sh
Last active January 6, 2018 20:29
bcl2fastq setup protocol
#!/bin/sh
# Protocol for setting up an environemnt for bcl2fastq 1.8.4
# See: http://seqanswers.com/forums/showpost.php?p=141026&postcount=29
# lior.galanti@nyu.edu
# for bcl2fastq2 see http://backwardincompatible.com/post/169360794395/compiling-illumina-bcl2fastq-220-on-ubuntu-with
# On Ubuntu
sudo apt-get install \
libexpat1-dev \
libexpat1 \
@gladiatr72
gladiatr72 / 99-salt-minion-init.py
Last active February 26, 2020 20:12
IPython - saltstack profile initializers
# similar initializer for minion-side testing
import salt.config
import salt.client
import salt.loader
import salt.utils.minion as Minion_Util
import salt.config
import pprint
pp_ = pprint.PrettyPrinter(indent=4, depth=20)
pp = pp_.pprint
@cjdd3b
cjdd3b / fingerprint.py
Created February 22, 2015 14:17
Python implementation of Google Refine fingerprinting algorithms here: https://github.com/OpenRefine/OpenRefine/wiki/Clustering-In-Depth
# -*- coding: utf-8 -*-
import re, string
from unidecode import unidecode
PUNCTUATION = re.compile('[%s]' % re.escape(string.punctuation))
class Fingerprinter(object):
'''
Python implementation of Google Refine fingerprinting algorithm described here: