Skip to content

Instantly share code, notes, and snippets.

@ceesco53
ceesco53 / haproxy-bosh-manifest.yml
Created July 26, 2023 17:03
HA Proxy BOSH deploy yaml for version 12.1.0+2.7.7
addons:
- jobs:
- name: bpm
release: bpm
name: bpm
instance_groups:
- azs:
- az1
instances: 1
jobs:
curl -XPOST -D- 'http://localhost:5601/api/saved_objects/index-pattern' \
-H 'Content-Type: application/json' \
-H 'kbn-version: 7.14.0' \
-u elastic:<changeme> \
-d '{"attributes":{"title":"logstash-*","timeFieldName":"@timestamp"}}'
@ceesco53
ceesco53 / patterns.grok
Created August 12, 2021 18:18
GROK PATTERNS
# crashd log analysis
# I0802 01:01:28.711691 1 server.go:618] external host was not specified, using 10.252.43.236
(?<severity>.{1})%{MONTHNUM:month}%{MONTHDAY:day}%{SPACE}%{TIME:time}%{SPACE}%{NUMBER:number}%{SPACE}(?<filename>\b\w+\.?\w*):%{NUMBER:linenum}]%{SPACE}%{GREEDYDATA:message}
sudo apt-get install zsh -y
git clone git://github.com/robbyrussell/oh-my-zsh.git /home/vagrant/.oh-my-zsh
cp /home/vagrant/.oh-my-zsh/templates/zshrc.zsh-template /home/vagrant/.zshrc
sudo chsh -s /usr/bin/zsh vagrant
sed -i 's/robbyrussell/agnoster/g' /home/vagrant/.zshrc
@ceesco53
ceesco53 / backup.sh
Last active November 8, 2019 01:50 — forked from zmb3/backup.sh
Backup/Restore Concourse DB
# from Concourse DB VM:
# /var/vcap/packages/postgres-9.6.8/bin/psql -U vcap -d atc
# \l
# backup
cd /var/vcap/packages/postgres-9.6.8/bin
./pg_dump -U vcap -d atc --format=c --schema-only --file=concourse-schema.sql
./pg_dump -U vcap -d atc --format=c --data-only --file=concourse-data.sql
# restore
{
"client_id": "sso-temp-cf-client",
"client_secret": "'${CF_CLI_CLIENT_SECRET}'",
"authorized_grant_types": ["client_credentials"],
"authorities": ["cloud_controller.admin"],
"access_token_validity": 1209600,
"refresh_token_validity": 1209600
}

@ceesco53
ceesco53 / bloat sql
Created September 27, 2019 13:52
bloat checker
WITH constants AS (
SELECT current_setting('block_size')::numeric AS bs, 23 AS hdr, 4 AS ma
), bloat_info AS (
SELECT
ma,bs,schemaname,tablename,
(datawidth+(hdr+ma-(case when hdr%ma=0 THEN ma ELSE hdr%ma END)))::numeric AS datahdr,
(maxfracsum*(nullhdr+ma-(case when nullhdr%ma=0 THEN ma ELSE nullhdr%ma END))) AS nullhdr2
FROM (
SELECT
schemaname, tablename, hdr, ma, bs,
@ceesco53
ceesco53 / jmeter-tornado-mode.yml
Last active June 24, 2019 20:29
jmeter-tornado.yml
---
name: jmeter-tornado
releases:
- name: jmeter-tornado
version: 2.1.1
url: git+https://github.com/jamlo/jmeter-bosh-release
stemcells:
- alias: default
Hash: 347cee980a7f9c95a72a
Version: webpack 2.2.1
Time: 3977ms
Asset Size Chunks Chunk Names
bundle.js 1.62 MB 0 [emitted] [big] main
bundle.js.map 2.05 MB 0 [emitted] main
assets/icons.svg 3.34 kB [emitted]
[5] ./~/react/react.js 56 bytes {0} [built]
[6] ./lib/utils/plugins.js 9.34 kB {0} [built]
[18] ./lib/rpc.js 57 bytes {0} [built]
/system scheduler
add disabled=no interval=6h name=log_reg_table on-event=log_client start-time=startup
/system script
add name=log_client policy=ftp,reboot,read,write,policy,test,password,sniff source=":foreach i in=[ /int wir reg find ap=no] do={\r\
\n:log info (\"Mikrotik \" . [/system identity get name] . \" AP: \" . [int wir reg get \$i interface] . \" MAC: \" . [int wir reg get \$i mac-address ] . \" Last IP:\
\" . [int wir reg get \$i last-ip] . \" RX: \" . [int wir reg get \$i rx-rate] . \" TX: \" . [int wir reg get \$i tx-rate] . \" Uptime: \" . [int wir reg get \$i upti\
me] . \" LastACT: \" . [int wir reg get \$i last-activity] . \" SignalStrength: \" . [int wir reg get \$i signal-strength] . \" SNR: \" . [int wir reg get \$i signal-t\
o-noise] . \" TX/RX-CCQ: \" . [int wir reg get \$i tx-ccq] . \" / \" . [int wir reg get \$i rx-ccq] . \" PThroughput: \" . [int wir reg get \$i p-throughput] )\r\
\n}"