Skip to content

Instantly share code, notes, and snippets.

View wankdanker's full-sized avatar

Dan VerWeire wankdanker

View GitHub Profile
@wankdanker
wankdanker / SimpleHTTPServer.js
Created November 18, 2011 16:13
A simple static file server for node
var http = require('http'),
fs = require('fs'),
cwd = process.cwd();
http.createServer()
.on('request', function (request, response) {
var url = unescape(request.url);
var path = cwd + url;
console.log(request.socket.remoteAddress, path);
@wankdanker
wankdanker / README.md
Last active December 14, 2015 16:38
Generate a mac address based on FQDN

Install

curl https://gist.githubusercontent.com/wankdanker/2f676cc85f52fd471567/raw -o /usr/local/bin/gen-mac; chmod 755 /usr/local/bin/gen-mac
@NickWoodhams
NickWoodhams / zebraprint.sh
Created January 29, 2013 22:07
Print a UPS Label GIF on a Zebra 2844 @203 PPI
#!/bin/sh
filename=$1
echo "Begin processing file:" $filename
dimensions=$(identify -format '%w %h' $filename)
IFS=' ' read -a array <<< "$dimensions"
width=${array[0]}
height=${array[1]}
@nickman
nickman / install.sh
Created May 20, 2011 13:16
Graphite Server Install Script for Ubuntu
#!/bin/bash
#######################################
# Graphite Install
# Run with sudo for best results
#
#######################################
if [[ "$(/usr/bin/whoami)" != "root" ]]; then
echo "This script must be run as root or using sudo.Script aborted."
exit 1
@gionn
gionn / lxc_mount_bind.md
Created November 21, 2013 16:49
How to enable bind mount inside lxc container

How to enable bind mount inside lxc container

When mount is returning:

STDERR: mount: block device /srv/database-data/postgres is write-protected, mounting read-only
mount: cannot mount block device /srv/database-data/postgres read-only

and dmesg shows:

@DavidWittman
DavidWittman / http-get.nse
Created April 6, 2012 06:19
Nmap HTTP GET request script
description = [[
Issues an arbitrary HTTP GET request
]]
---
-- @usage
-- nmap --script http-get [--script-args http-get.path=/status] -p <port> <host>
-- @args http-get.path The path to request (defaults to /)
-- http-get.match String to match in the HTTP response (incl. headers)
-- @output
@mwise
mwise / README.md
Last active July 14, 2023 14:11
Git hook to prevent merging staging branch into master branch

To use this hook:

  • add the prepare-commit-msg file at .git/hooks/prepare-commit-msg and edit as needed
  • make it executable: chmod +x .git/hooks/prepare-commit-msg
  • disable fast-forward merges: git config branch.master.mergeoptions "--no-ff"
  • that's it!

NOTE: after a failed merge from a forbidden branch, the working tree will still be in a MERGING state. To discard the local working copy state, run: git reset --merge

@niravmehta
niravmehta / kue_cleanup.js
Created July 30, 2013 11:57
Cleanup script for Kue job queueing system in Node.js. Deletes failed, active and completed jobs after specified time. Can run on command line directly with "node kue_cleanup". Requires Kue installed :-)
var kue = require('kue'),
jobs = kue.createQueue(),
util = require('util'),
noop = function() {};
jobs.CLEANUP_MAX_FAILED_TIME = 30 * 24 * 60 * 60 * 1000; // 30 days
jobs.CLEANUP_MAX_ACTIVE_TIME = 1 * 24 * 60 * 60 * 1000; // 1 day
jobs.CLEANUP_MAX_COMPLETE_TIME = 5 * 24 * 60 * 60 * 1000; // 5 days
jobs.CLEANUP_INTERVAL = 5 * 60 * 1000; // 5 minutes
@bl4ck5un
bl4ck5un / responsive-semantic-ui.css
Created May 12, 2017 03:20
Responsive helpers (mobile-only etc.) for semantic-ui
/* Semantic UI has these classes, however they're only applicable to*/
/* grids, containers, rows and columns.*/
/* plus, there isn't any `mobile hidden`, `X hidden` class.*/
/* this snippet is using the same class names and same approach*/
/* plus a bit more but to all elements.*/
/* see https://github.com/Semantic-Org/Semantic-UI/issues/1114*/
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
@rwenz3l
rwenz3l / proxmox_lxc_nfs_server.md
Last active April 12, 2024 19:49
Install a NFS Server inside a LXC Container on Proxmox 5.1

Installing NFS inside LXC Container on Proxmox 5.1

Host Setup:

Create LXC Container as usual, but do not start it yet.

# Install NFS-Kernel on Host
apt install nfs-kernel-server