This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'optparse' | |
options = {} | |
parser = OptionParser.new do |opts| | |
opts.banner = "Usage: <script_name> [options]" | |
options[:firstoption] = 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ruby | |
include HTTParty | |
fields = [] | |
fields << {"Name" => "rocksoftware22", "Component" => "precise4"} | |
fields << {"Name" => "rocksoftware", "Component" => "precise5"} | |
params_hash ={} | |
params_hash[:Sources] = fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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> |
OlderNewer