Skip to content

Instantly share code, notes, and snippets.

View splitice's full-sized avatar

Mathew Heard splitice

View GitHub Profile
@echo off
set path=%1
set folder=%date:~4,2%-%date:~7,2%-%date:~10,4%
For %%A in ("%path%") do (
Set Name=%%~nA
)
cd "C:\Program Files (x86)\WinSCP"
# WinSCP script for uploading a single file
# see http://winscp.net/eng/docs/scripting for documentation on WinSCP scripting
# Automatically abort script on errors
option batch continue
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect to server (change this to match your connection settings)
server {
listen 80;
server_name img.x4b.org;
root /var/www/image/;
}
ifconfig | grep "inet" | awk '{print $2}' | grep "64." | awk '{print "arping -A -c 1 -I eth0 " substr($1,6)}' | bash
#!/bin/bash
#Built during an OVH outage for https://www.x4b.net
#Absolutely NO warranty implied
#Do not even think of blaming me if something goes wrong
#Use at own risk
#Requires: curl, prips, openssl, jq
#FILL OUT!
AK=""
AS=""
// hashexample.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <vector>
#include <stdint.h>
#include "MurmurHash3.h"
#define TABLE_SIZE 30240
uint16_t table_size_used = 1000;
// hashexample.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <vector>
#include <stdint.h>
#include "MurmurHash3.h"
#define TABLE_SIZE 6024000
uint16_t table_size_used;
ip addr show eth0 | grep inet | awk '{print "timeout 2s arping -U "substr($2, 0, length($2)-3)}'
@splitice
splitice / deploy
Last active December 18, 2015 05:49
A deployment script for sites
#!/bin/bash
## EDIT HERE
DOMAIN="domain.com"
## NO NEED TO EDIT BELOW THIS LINE ##
# Copy to backup
cp dev.$DOMAIN ${DOMAIN}_c -R --preserve
#chmod 777 ${DOMAIN}_c -R
@splitice
splitice / pipe-redis-logs.php
Created January 19, 2014 12:25
unix fifo pipe -> redis
<?php
$fifo = '/rsyslog/pipe';
$max_length = 1024*8;
$redis_list_name = 'log_entries';
$redis_host = '127.0.0.1';
$redis_port = 6379;
$multi_bulk = 25;
$redis = new Redis();
$redis->connect($redis_host, $redis_port);