Skip to content

Instantly share code, notes, and snippets.

View krzysztofantczak's full-sized avatar

Krzysztof Antczak krzysztofantczak

View GitHub Profile
import numpy as np
import scipy, scipy.signal
def fftconvolve(in1, in2, mode="full"):
"""Convolve two N-dimensional arrays using FFT.
Convolve `in1` and `in2` using the fast Fourier transform method, with
the output size determined by the `mode` argument.
This is generally much faster than `convolve` for large arrays (n > ~500),
but can be slower when only a few output values are needed, and can only
output float arrays (int or object array inputs will be cast to float).
# basic pfctl control
# ==
# Related: http://www.OpenBSD.org
# Last update: Tue Dec 28, 2004
# ==
# Note:
# this document is only provided as a basic overview
# for some common pfctl commands and is by no means
# a replacement for the pfctl and pf manual pages.
@krzysztofantczak
krzysztofantczak / prosody-setup.lua
Created October 27, 2015 12:02 — forked from legastero/prosody-setup.lua
Set up a Prosody server to work with stanza.io/otalk (with websockets, mam, etc)
-- 1. apt-get install prosody-trunk
-- 2. Checkout prosody-modules on Google Code
-- 3. Move all modules to /usr/lib/prosody/modules
-- 4. Move the mod_smacks module to mod_smacks2 and copy it to mod_smacks3
-- 5. Move the files in mod_smacks* to match the new names
-- 6. In mod_smacks3/mod_smacks3.lua s/urn:xmpp:sm:2/urn:xmpp:sm:3/g
-- 7. Set the Prosody configuration to:
admins = { "ADMIN@HOST" }
daemonize = true
@krzysztofantczak
krzysztofantczak / gist:282f76a10aa0da18125c
Last active August 29, 2015 14:27 — forked from wofeiwo/gist:3634357
Golang daemonize
/* ivan(a.t)mysqlab.net */
package main
import (
"syscall"
"os"
"log"
)
func daemon(nochdir, noclose int) int {
@krzysztofantczak
krzysztofantczak / .gitignore
Last active August 29, 2015 14:27 — forked from brianm/.gitignore
Go net/rpc over ssh+netcat and unix domain sockets It would be nice if ssh.Session implemented io.ReaderWriter
local_client
server
client
ext
/* bling.js */
window.$ = document.querySelectorAll.bind(document)
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn)
}
NodeList.prototype.__proto__ = Array.prototype
@krzysztofantczak
krzysztofantczak / launcher
Last active August 29, 2015 14:11 — forked from jas-/launcher
#!/bin/bash
# VM launcher
# Jason Gerfen <jason.gerfen@gmail.com>
# Create new if asked
if [ "$1" == "install" ]; then
if [ -f "$3" ]; then
dd if=/dev/zero of=vm/$2 bs=516096 seek=9182 count=0
qemu-system-x86_64 -m 2048 -boot d -cdrom $3 vm/$2 -net nic -net user
@krzysztofantczak
krzysztofantczak / readme.md
Last active August 29, 2015 14:11 — forked from jas-/readme.md

802.1Q networking, LAMP stack, TFPT & MySQL user permissions

Details on the current configuration of tyr.example.com can be found below. 10/11/2012

Kernel

Raid

Details for the raid1 configuration are as follows:

fdisk

@krzysztofantczak
krzysztofantczak / readme.md
Last active August 29, 2015 14:11 — forked from jas-/readme.md

myprint.scl.utah.edu

The myprint service handles wireless printing for the MLIB PC labs. FreeBSD is the operating system that was chosen for this service primarily for its security features.

Details on the current configuration of myprint.scl.utah.edu can be found below. 07/12/2013

Host OS configuration

This first section details the various configuration options applied to the kernel, NAT & traffic passing to jailed (non routable net) env, usage of IPFW service to filter incoming & outgoing traffic to specific subnets & or targets, OS, Jail & TCP stack hardening options

@krzysztofantczak
krzysztofantczak / main.go
Last active August 29, 2015 14:10 — forked from 0xcaff/main.go
package main
import (
"encoding/json"
"net/http"
"net/url"
"fmt"
"io"
"regexp"