Skip to content

Instantly share code, notes, and snippets.

@willejs
willejs / README.md
Last active January 4, 2023 09:39
Moving Concourse Pipelines

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 / gist:043ffaeec61c4501760e
Created February 12, 2015 21:46
haproxy 1.5 logstash grok filter - working!
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})?))?\"
### 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 / hello.yaml
Last active July 6, 2016 15:57
Example kubernetes deployment and service
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: hello
spec:
replicas: 1
template:
metadata:
labels:
app: hello
@willejs
willejs / gist:7201687
Created October 28, 2013 18:09
logstash elasticsearch template
{
"order": 0,
"template": "logstash-*",
"settings": {
"index.store.compress.stored": "true",
"index.number_of_shards": "20"
},
"mappings": {
"_default_": {
"properties": {
@willejs
willejs / gist:7101360
Created October 22, 2013 14:05
enable RPS ec2
### 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 October 10, 2013 12:42
get cpu percent per core for a pid usage: ./pid.py <pid-no-here>
#!/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())
@willejs
willejs / gist:6906675
Created October 9, 2013 19:19
logstash template
{ "template" : "logstash*",
"settings" : {
"number_of_shards" : 20,
"index.store.compress.stored" : true
},
"mappings" : {
"_default_" : {
"_all" : {"enabled" : false},
"properties" : {
"@fields" : {
@willejs
willejs / gist:6061500
Created July 23, 2013 10:46
example wrapper cookbook
#
# Cookbook Name:: spaceape_logstash
# Recipe:: default
#
# Copyright 2013, Space Ape Games
#
# All rights reserved - Do Not Redistribute
#
node.override['logstash']['agent']['xms'] = '128M'
@willejs
willejs / gist:5873147
Created June 27, 2013 00:50
check_ntp.py checks ntp time
#!/usr/bin/python
import re
import sys
import os
import getopt
def help():
print ''
print 'Usage: check_ntp.py -b ntpq_binary'