Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
int main() {
int optind = 99, optreset = 98;
#if defined __GLIBC__
/* glibc needs to have optind set to 0 instead of the "traditional
value" of 1 */
optind = 0;
#else
/* 1 is the value that optind should be initialized to according to
package main
import (
"fmt"
"log"
"unsafe"
sophia "github.com/pzhin/go-sophia"
)
@satta
satta / rand-rule.lua
Last active February 8, 2017 13:49
Script to create 'worst case' rules with long random patterns, to stress Suricata's AC-based MPM engine.
#!/usr/bin/env lua
math.randomseed(os.time())
function string.random(length)
local t = {}
for i = 1,length do
table.insert(t, math.random(97,122))
end
return string.char(unpack(t))
@satta
satta / test.nf
Created January 6, 2016 09:56
Test workflow for single quote problem
process test {
output:
file '*.out' into outfiles
"""
touch "test'file.out"
touch testfile2.out
"""
}
Oct-10 09:48:10.629 [main] DEBUG nextflow.cli.Launcher - Setting http proxy: [wwwcache.sanger.ac.uk, 3128]
Oct-10 09:48:10.759 [main] DEBUG nextflow.cli.Launcher - Setting https proxy: [wwwcache.sanger.ac.uk, 3128]
Oct-10 09:48:10.760 [main] DEBUG nextflow.cli.Launcher - $> /nfs/users/nfs_s/ss34//nextflow -c /nfs/users/nfs_s/ss34/annot-nf/loc_we
b.config -c /www/ss34/annot-web/public/jobs/cb1584075907314fa80d0419/config run /nfs/users/nfs_s/ss34/annot-nf/annot.nf -resume --di
st_dir /www/ss34/annot-web/public/jobs/cb1584075907314fa80d0419
Oct-10 09:48:10.760 [main] INFO nextflow.cli.CmdRun - N E X T F L O W ~ version 0.15.3
Oct-10 09:48:10.760 [main] INFO nextflow.cli.CmdRun - Launching /nfs/users/nfs_s/ss34/annot-nf/annot.nf
Oct-10 09:48:10.780 [main] DEBUG nextflow.config.ConfigBuilder - Found config base: /nfs/users/nfs_s/ss34/annot-nf/nextflow.config
Oct-10 09:48:10.783 [main] DEBUG nextflow.config.ConfigBuilder - User config file: /nfs/users/nfs_s/ss34/annot-nf/loc_web.config
Oct-10 09:48:10.783 [mai
@satta
satta / Vagrantfile
Last active December 15, 2015 22:13
Vagrantfile for AEGeAn debugging
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "debian/jessie64"
config.vm.box_check_update = false
config.vbguest.auto_update = false
# Create a public network, which generally matched to bridged network.
#!/usr/bin/env gt
function usage()
io.stderr:write("Adds a given parent attribute to all child features.\n")
io.stderr:write(string.format("Usage: %s <attribute> < <GFF>\n" , arg[0]))
os.exit(1)
end
if #arg < 1 then
usage()
@satta
satta / add_mrna.lua
Created June 1, 2015 20:48
add_mrna.lua
#!/usr/bin/env gt
function usage()
io.stderr:write(string.format("Usage: %s <GFF annotation>\n" , arg[0]))
os.exit(1)
end
if #arg < 1 then
usage()
end
#!/usr/bin/env ruby
if ARGV.length != 2 then
STDERR.puts "Usage: #{$0} <pfamfile> <directory>"
exit 1
end
file = File.open(ARGV[0]).read
seen_accs = {}
@satta
satta / gff3_to_json.lua
Last active August 29, 2015 14:06
GFF3 to JSON converter
#!/usr/bin/env gt
function usage()
io.stderr:write(string.format("Usage: %s <GFF file>\n" , arg[0]))
os.exit(1)
end
if #arg < 1 then
usage()
os.exit(1)