Skip to content

Instantly share code, notes, and snippets.

@janeczku
janeczku / notify-slack.sh
Created August 28, 2015 01:15
Slack notifications via Curl
#!/bin/bash
function post_to_slack () {
# format message as a code block ```${msg}```
SLACK_MESSAGE="\`\`\`$1\`\`\`"
SLACK_URL=https://hooks.slack.com/services/your-service-identifier-part-here
case "$2" in
INFO)
SLACK_ICON=':slack:'
@janeczku
janeczku / resolvers-test.conf
Last active October 19, 2015 19:12
Haproxy 1.6 DNS client issue - Configuration file
global
#stats socket /var/run/admin.sock mode 660 level admin
#stats timeout 30s
defaults
mode http
timeout http-keep-alive 10000
timeout http-request 6s
timeout connect 7s
timeout client 10s
@janeczku
janeczku / haproxy-issue-report.md
Last active August 31, 2015 16:54
Haproxy 1.6-dev DNS client issue report
@janeczku
janeczku / deploy.sh
Created November 4, 2015 18:34
Shipyard on armv7 platform
#!/bin/bash
if [ "$1" != "" ] && [ "$1" = "-h" ]; then
echo "Shipyard Deploy uses the following environment variables:"
echo " ACTION: this is the action to use (deploy, upgrade, node, remove)"
echo " DISCOVERY: discovery system used by Swarm (only if using 'node' action)"
echo " IMAGE: this overrides the default Shipyard image"
echo " PREFIX: prefix for container names"
echo " SHIPYARD_ARGS: these are passed to the Shipyard controller container as controller args"
echo " TLS_CERT_PATH: path to certs to enable TLS for Shipyard"
@janeczku
janeczku / sysctl.conf
Created November 15, 2015 16:43
Scaleway C1 sysctl network performance tweaks
#Performance Tweak
net.core.rmem_max=12582912
net.core.wmem_max=12582912
net.core.rmem_default=87380
net.core.wmem_default=87380
net.ipv4.tcp_mem='12582912 12582912 12582912'
net.ipv4.tcp_rmem= 10240 87380 12582912
net.ipv4.tcp_wmem= 10240 87380 12582912
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
@janeczku
janeczku / user-data.sh
Last active November 18, 2017 02:32
OVH Public Cloud - Cloud-Init bootstrap Failover IP + Docker
#!/bin/sh
cat > /etc/network/interfaces.d/eth0-0.cfg <<EOF
auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
address 178.32.XXX.XXX
netmask 255.255.255.255
broadcast 178.32.XXX.XXX
post-up /sbin/ip route replace default via $(/sbin/ip route | awk '/default/ { print $3 }') dev eth0 src 178.32.XXX.XXX
@janeczku
janeczku / m3u8
Created April 13, 2016 14:43
m3u8
#EXTM3U
#EXT-X-MEDIA:TYPE=CLOSED-CAPTIONS,GROUP-ID="cc",NAME="English",LANGUAGE="en",AUTOSELECT=YES,INSTREAM-ID="CC1"
#EXT-X-STREAM-INF:BANDWIDTH=1008000,RESOLUTION=640x360,CODECS="avc1.77.30, mp4a.40.2",CLOSED-CAPTIONS="cc"
https://tvenbc-vh.akamaihd.net/i/prod/video/723/846/160404_3013143_Dateline_04_10_mpx_,1696,1296,896,696,496,306,240,150,64,.mp4.csmil/index_2_av.m3u8?null=0&id=AgCi2lo5uFTzazpZDlcJYe7hlX3F0uV1JEB8txyBqjf1KjsWF2wgbJ73YSBSAZ8radpGZ7HVm1Lrtw%3d%3d
@janeczku
janeczku / rancher-cloud.yaml
Last active June 1, 2016 15:31
Rancher test
#cloud-config
hostname: rancher-1
rancher:
cloud_init:
datasources:
- configdrive:/media/config-2
@janeczku
janeczku / 0_reuse_code.js
Created June 8, 2016 23:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
io.cattle.platform.eventing.exception.EventExecutionException: 404 Client Error: Not Found ("No such container: 282338b7-807d-4bf8-91ba-1589c183d5bd")
at io.cattle.platform.eventing.exception.EventExecutionException.fromEvent(EventExecutionException.java:53)
at io.cattle.platform.agent.impl.RemoteAgentImpl.callSync(RemoteAgentImpl.java:87)
at io.cattle.platform.agent.impl.RemoteAgentImpl.callSync(RemoteAgentImpl.java:135)
at io.cattle.platform.process.common.handler.AgentBasedProcessHandler.callSync(AgentBasedProcessHandler.java:180)
at io.cattle.platform.process.common.handler.AgentBasedProcessHandler.handleEvent(AgentBasedProcessHandler.java:166)
at io.cattle.platform.process.common.handler.AgentBasedProcessHandler.handle(AgentBasedProcessHandler.java:104)
at io.cattle.platform.engine.process.impl.DefaultProcessInstanceImpl.runHandler(DefaultProcessInstanceImpl.java:424)
at io.cattle.platform.engine.process.impl.DefaultProcessInstanceImpl$4.execute(DefaultProcessInstanceImpl.java:375)
at io.cattle.