Skip to content

Instantly share code, notes, and snippets.

View sepulworld's full-sized avatar
🤘

Zane Williamson sepulworld

🤘
View GitHub Profile
@sepulworld
sepulworld / tcpserverdeluxe.rb
Last active August 29, 2015 13:56
TCPServerDeluxe, simple tcp socket server that responds to http requests for an executable
class TcpServerDeluxe
require 'socket'
"""
Ruby 2.1.0
Description:
TCP Server, runs from command line or upstart. Requires two agruments.
Argument #1 is server port, Argument #2 is executable path
200 will return stdout of executable (cgi)
@sepulworld
sepulworld / keyword_filter.py
Created February 21, 2014 05:37
keyword_filter action
import csv
import itertools
def base_file(name):
with open(name, 'rU') as csvfile:
spamreader = csv.reader(csvfile, delimiter=',', dialect=csv.excel_tab)
for row in spamreader:
yield row
def keyword_data(filename, keyword):
@sepulworld
sepulworld / ruby_script.rb
Created January 17, 2015 23:22
Ruby Script Starter
#!/usr/bin/ruby
require 'optparse'
options = {}
parser = OptionParser.new do |opts|
opts.banner = "Usage: <script_name> [options]"
options[:firstoption] = 20
@sepulworld
sepulworld / aptly-api.conf
Created February 22, 2015 21:00
Aptly API upstart
description "Stat HTTP server with aptly REST API"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
respawn
umask 022
chdir /
setuid root
setgid root
console log # log stdout/stderr to /var/log/upstart/
@sepulworld
sepulworld / warm_urls.js
Last active August 29, 2015 14:19
warm_urls.js
#!/usr/bin/env node
YAML = require('yamljs');
getURLs = YAML.load('url-list.yaml');
var http = require('http');
getURLs[':urls'].forEach(function (element) {
http.get(element, function(res) {
console.log("http get... " + element);
@sepulworld
sepulworld / exampe_json_array_to_aptly_api
Last active October 15, 2021 20:08
httparty post json array to Aptly
#!/bin/ruby
include HTTParty
fields = []
fields << {"Name" => "rocksoftware22", "Component" => "precise4"}
fields << {"Name" => "rocksoftware", "Component" => "precise5"}
params_hash ={}
params_hash[:Sources] = fields
var http = require('http');
exports.handler = function(event, context) {
var responses = {},
count = 0;
for (var key in event ) {
console.log('start request to ' + event[key]);
http.get(event[key], function(res) {
console.log("Got response: " + res.statusCode);
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings
bind right:alt resize +10% +0
bind left:alt resize -10% +0
@sepulworld
sepulworld / aptly_publish.txt
Last active September 2, 2016 00:00
So basic Aptly publish steps
# build fpm
fpm-cook clean
fpm-cook
# upload deb file
aptly-cli file_upload --upload ./nginx-dbg_1.9.6-1-trusty_amd64.deb --directory /nginx
# import uploaded deb into repo (example repo is named stable-repo in Aptly server)
aptly-cli repo_upload --name stable-repo --dir nginx
@sepulworld
sepulworld / update_bamboo_w_mono_nunit_sharp.sh
Created November 1, 2015 21:35
update_bamboo_w_mono_nunit_sharp
#!/bin/bash
# Prep steps
# docker pull atlassian/bamboo-java-agent
# sudo docker run --name="tmp-atlassian-java-agent-<VERSION>" -e HOME=/root/ -i -t atlassian/bamboo-java-agent:latest /bin/bash
# run following insde containter and exit
# docker login
# docker commit tmp-name sepulworld/georiot_bamboo:<new_version>
# docker push sepulworld/georiot_bamboo:<new_version>