Skip to content

Instantly share code, notes, and snippets.

Avatar
🥪

Will Salt willejs

🥪
View GitHub Profile
@willejs
willejs / README.md
Last active Sep 16, 2020
Moving Concourse Pipelines
View README.md

Moving Concourse Pipelines

Currently concourse does not support moving pipelines between teams via fly CLI. There is an issue for that here

The only way to do this is to make a few changes in the DB.

If you run the statement below you will see that 6 tables have the team_id column.

concourse=> select table_name                                                                                                                                                                                                                                                                                                                                                       from INFORMATION_SCHEMA.COLUMNS                                                                                                                                                                                                                                                                            
@willejs
willejs / hello.yaml
Last active Jul 6, 2016
Example kubernetes deployment and service
View hello.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: hello
spec:
replicas: 1
template:
metadata:
labels:
app: hello
View gist:4093f4ee70803d102bf4e4a7463e0d63
### Keybase proof
I hereby claim:
* I am willejs on github.
* I am willejs (https://keybase.io/willejs) on keybase.
* I have a public key whose fingerprint is E3E2 C6EE 4EAF 484D B409 8740 DDF7 7F0E B08F 6896
To claim this, I am signing this object:
@willejs
willejs / gist:347ec18cd4683bbab5a3
Last active Aug 29, 2015
sprout-wrap-bootstrap
View gist:347ec18cd4683bbab5a3
#!/bin/bash
set -e
# Read SPROUTREPO from environment or use default crowdsurge repo
: ${SPROUTREPO:="https://github.com/crowdsurge/sprout-wrap.git"}
### Define some helper functions ###
usage() {
cat << _EOF_
Usage: "$0" [options]
View gist:992ffe5565e60f89f620
package[uchiwa] (uchiwa::repo line 56) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
---- Begin output of apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
STDERR: E: Version '0.4.1-1' for 'uchiwa' was not found
---- End output of apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 ----
Ran apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 returned 100
@willejs
willejs / gist:043ffaeec61c4501760e
Created Feb 12, 2015
haproxy 1.5 logstash grok filter - working!
View gist:043ffaeec61c4501760e
HAPROXYTIME (?!<[0-9])%{HOUR}:%{MINUTE}(?::%{SECOND})(?![0-9])
HAPROXYDATE %{MONTHDAY}/%{MONTH}/%{YEAR}:%{HAPROXYTIME}.%{INT}
HAPROXYHTTP <%{BASE10NUM}>%{SYSLOGTIMESTAMP} %{SYSLOGPROG}: %{IP:client}:%{INT:port} \[%{HAPROXYDATE:accept_date}\] %{NOTSPACE:frontend_name} %{NOTSPACE:backend_name}/%{NOTSPACE:server_name} %{INT:time_request}/%{INT:time_queue}/%{INT:time_backend_connect}/%{INT:time_backend_response}/%{NOTSPACE:time_duration} %{INT:http_status_code} %{NOTSPACE:bytes_read} %{DATA:captured_request_cookie} %{DATA:captured_response_cookie} %{NOTSPACE:termination_state} %{INT:actconn}/%{INT:feconn}/%{INT:beconn}/%{INT:srvconn}/%{NOTSPACE:retries} %{INT:srv_queue}/%{INT:backend_queue} \"(<BADREQ>|(%{WORD:http_verb} (%{URIPROTO:http_proto}://)?(?:%{USER:http_user}(?::[^@]*)?@)?(?:%{URIHOST:http_host})?(?:%{URIPATHPARAM:http_request})?( HTTP/%{NUMBER:http_version})?))?\"
View gist:e06e9812d663668fb3fb
log_format logstash_json '{ "@timestamp": "$time_iso8601", '
'"remote_addr": "$remote_addr", '
'"remote_user": "$remote_user", '
'"body_bytes_sent": "$body_bytes_sent", '
'"request_time": "$request_time", '
'"status": "$status", '
'"request": "$request", '
'"request_method": "$request_method", '
'"http_referrer": "$http_referer", '
'"http_cookie": "$http_cookie", '
@willejs
willejs / gist:7201687
Created Oct 28, 2013
logstash elasticsearch template
View gist:7201687
{
"order": 0,
"template": "logstash-*",
"settings": {
"index.store.compress.stored": "true",
"index.number_of_shards": "20"
},
"mappings": {
"_default_": {
"properties": {
View gist:7101360
### bind different buffers to different cores using multi queue networking
### http://engineering.pinterest.com/post/53467339970/building-pinterest-in-the-cloud
### reduces effects of irq affinity on EC2/Xen
execute "rps_cpu" do
command "echo f > /sys/class/net/eth0/queues/rx-0/rps_cpus"
user "root"
group "root"
not_if "grep 1 /sys/class/net/eth0/queues/rx-0/rps_cpus"
action :run
@willejs
willejs / gist:6917721
Created Oct 10, 2013
get cpu percent per core for a pid usage: ./pid.py <pid-no-here>
View gist:6917721
#!/usr/bin/python
import os
import sys
core = { 0:float(0.0), 1:float(0.0), 2:float(0.0), 3:float(0.0), 4:float(0.0), 5:float(0.0), 6:float(0.0), 7:float(0.0) }
output = []
for i in os.popen('ps -p {} -L -o pid,tid,psr,pcpu'.format(str(sys.argv[1]))):
output.append(i.rstrip('\n').split())