Skip to content

Instantly share code, notes, and snippets.

View jvhaarst's full-sized avatar

Jan van Haarst jvhaarst

  • FB-IT, Wageningen University and Research
  • Wageningen, Netherlands
View GitHub Profile
@jvhaarst
jvhaarst / mijn.ing.nl.out.txt
Created February 23, 2011 09:23
sslscan and ssl_test mijn.ing.nl
sslscan --no-failed mijn.ing.nl
_
___ ___| |___ ___ __ _ _ __
/ __/ __| / __|/ __/ _` | '_ \
\__ \__ \ \__ \ (_| (_| | | | |
|___/___/_|___/\___\__,_|_| |_|
Version 1.8.2
http://www.titania.co.uk
Copyright Ian Ventura-Whiting 2009
@jvhaarst
jvhaarst / growlstate.bash
Created March 8, 2011 18:44
Scriptje om een Growl notify te krijgen bij openen (en sluiten) van de space
#!/bin/bash
# Scriptje om een Growl notify te krijgen bij openen (en sluiten) van de space
# jvhaarst, 13/2/2011 8h47
# Aangepast door Deckardt
# Aangepast jvhaarst 13/2/2011 15h03
# Aangepast jvhaarst 13/2/2011 21h20 (datum van statuswijziging toegevoegd)
# Aangepast jvhaarst 13/2/2011 21h50 (datum van statuswijziging uit state.time)
# Nodig:
# bash
# curl
@jvhaarst
jvhaarst / Results.tsv
Created April 28, 2011 09:57
Script to benchmark compression and decompression of a Velvet Sequences file
Compression Decompression
Type Setting Wall clock time System time User time CPU Wall clock time System time User time CPU Original size Uncompressed size Compressed sixe Percentage of original size
gz 1 3.41 1.4 63.53 1904% 6.5 1.49 8.61 155% 1382185155 1382185155 412365877 30%
gz 2 3.37 1.17 63.77 1921% 6.2 1.6 8.39 161% 1382185155 1382185155 396821613 29%
gz 3 5.19 1.4 96.58 1885% 5.78 1.41 7.74 158% 1382185155 1382185155 382874207 28%
gz 4 3.76 1.21 67.11 1812% 5.56 1.58 7.42 161% 1382185155 1382185155 372277033 27%
gz 5 7.48 1.65 141.5 1911% 5.35 1.76 7.13 166% 1382185155 1382185155 363078787 26%
gz 6 11.57 1.21 237.77 2063% 5.28 1.78 7.18 169% 1382185155 1382185155 352875787 26%
gz 7 21.74 1.32 453.06 2089% 5.3 1.4 7.34 164% 1382185155 1382185155 344893059 25%
gz 8 30.57 1.4 659.53 2161% 5.33 1.23 7.32 160% 1382185155 1382185155 343665387 25%
@jvhaarst
jvhaarst / fastq_min_max_qual.pl
Created March 22, 2012 16:51
What is the minimal and maximal quality score of fastq file
#!/usr/bin/perl
use warnings;
use strict;
use List::Util qw(max min);
# initiate
my @characters;
my @numbers;
my $l;
my $minimum=255;
@jvhaarst
jvhaarst / movedigiphotos.bash
Last active December 12, 2022 22:02
Bash script to move images, based on exif data and file timestamp
#!/bin/bash
# Reads EXIF creation date from all .JPG files in the
# current directory and moves them carefully under
#
# $BASEDIR/YYYY/YYYY-MM/YYYY-MM-DD/
#
# ...where 'carefully' means that it does not overwrite
# differing files if they already exist and will not delete
# the original file if copying fails for some reason.
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
function human_filesize($bytes, $decimals = 2) {
$sz = 'BKMGTP';
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];
}
@jvhaarst
jvhaarst / scp_cipher_speed.sh
Created September 1, 2013 13:32
Small script to test the different SSH cipher speeds, by copying a file through an SSH connection to localhost to /dev/null
#!/bin/bash
#openssl rand -out 1G.rnd -base64 $(( 2**30 * 3/4 ))
# File should not be too small, otherwise measuring differences becomes harder
# And not be too big, otherwise it just takes too long...
testfile=$1
# Print header
echo "cipher;time"
# First get the testfile into cache:
cat ${testfile} > /dev/null
cat ${testfile} > /dev/null
@jvhaarst
jvhaarst / sym2hard.py
Created January 21, 2014 12:20
Python script to convert symbolic links to hard links, if possible.
#!/usr/bin/env python
import os
import sys
import uuid
random_unique_name = str(uuid.uuid4()) + str(uuid.uuid1())
def find_mount_point(path): # http://stackoverflow.com/questions/4453602/how-to-find-the-mountpoint-a-file-resides-on
path = os.path.abspath(path)
#!/usr/bin/env python
'''
Automatically estimate insert size of the paired-end reads for a given SAM/BAM file.
Usage: getinsertsize.py <SAM file> or samtools view <BAM file> | getinsertsize.py -
Author: Wei Li
'''
from __future__ import print_function
import sys;
# bootstrap.yml
---
- hosts: newservers
vars:
- ubuntu_release: raring
- logwatch_email: <your email addy>
# crypted passwords, generated on a Linux box using:
# echo 'import crypt,getpass; print crypt.crypt(getpass.getpass(), "$6$YOURSALT")' | python -
- root_password: ''