Skip to content

Instantly share code, notes, and snippets.

@kisom
kisom / mydaemon
Created April 28, 2013 06:10
Sample Upstart and sysvinit script for Go daemons.
#! /bin/sh
### BEGIN INIT INFO
# Provides: mydaemon
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mydaemon does stuff
# Description: this is an actual executable script, and should be saved in
# /etc/init.d/mydaemon.
@ChimeraCoder
ChimeraCoder / gist:8395008
Created January 13, 2014 05:00
Sample systemd script
[Unit]
Description=A phpbb-like bulletin board in Go
[Service]
ExecStart=/home/stevenleeg/go/bin/gobb
Restart=on-abort
[Install]
WantedBy=multi-user.target
@davidwindell
davidwindell / wercker.yml
Last active February 10, 2016 00:25
Build, test, cache and deploy docker images with wercker, quay.io and Elastic Beanstalk
box: wercker-labs/docker
build:
steps:
- script:
name: fix timestamps
code: |
sudo wget https://gist.githubusercontent.com/davidwindell/fbfef588c6295666c6a1/raw/c2870b13a50a7aeb4aed1e6eb4daec3a905a7fc0/git-timestamp.sh -O /usr/local/bin/git-timestamp
sudo chmod +x /usr/local/bin/git-timestamp
git-timestamp composer.json
git-timestamp composer.lock

Codesys RPI HOWTO

This describes how you could configure your Raspberry PI to work, hopefully, better with Codesys.

Instructions

  • Based on raspbian image
@xogeny
xogeny / append2_test.go
Created January 27, 2015 18:12
A different append benchmark for Golang
package copy_vs_append
import (
"testing"
)
func buildArray(n int64) []int64 {
ret := make([]int64, n, n)
var i int64
for i = 0; i < n; i++ {
@arkka
arkka / upgrade.py
Last active November 17, 2020 21:39
Upgrade service via Rancher API using python
import os
import requests
import json
import time
environmentName = 'some-env'
serviceName = 'some-service'
newImage = 'docker:arkka/some-image:tag'
# Find stack based on their name
@asarkar
asarkar / csd-wrapper.sh
Last active October 26, 2022 07:13 — forked from l0ki000/csd-wrapper.sh
Cisco Anyconnect CSD wrapper for OpenConnect macOS client
#!/bin/bash
# Enter your vpn host here
CSD_HOSTNAME=
if [[ -z ${CSD_HOSTNAME} ]]
then
echo "Define CSD_HOSTNAME with vpn-host in script text. Exiting."
exit 1
fi
@shr00mie
shr00mie / letsencrypt_esxi.sh
Last active June 13, 2024 22:32
Let's Encrypt SSL for ESXi
#!/bin/bash
#
## -----------------------------=[ WARNING ]=-------------------------------- ##
#
# This script is now woefully out of date due to which accounts ESXi allows to
# ssh into the box as well as sticky folders/file flags.
# I've since ported the whole thing to python with a lot of bells and whistles
# and if i get around to making it public, i'll put a link here.
#
## -------------------------------=[ Info ]=--------------------------------- ##
@superseb
superseb / enable-debug-logs-rancher2.sh
Created May 29, 2018 14:54
Oneliners to enable debug logging on Rancher 2.0
#!/bin/bash
KUBECONFIG=./kube_config_rancher-cluster.yml
kubectl --kubeconfig $KUBECONFIG exec -n cattle-system $(kubectl --kubeconfig $KUBECONFIG get pods -n cattle-system -o json | jq -r '.items[] | select(.spec.containers[].name=="cattle-server") | .metadata.name') -- loglevel --set debug
kubectl --kubeconfig $KUBECONFIG logs -n cattle-system -f $(kubectl --kubeconfig $KUBECONFIG get pods -n cattle-system -o json | jq -r '.items[] | select(.spec.containers[].name="cattle-server") | .metadata.name')
@superseb
superseb / nodelocal-rancher.md
Created December 4, 2018 11:35
Run nodelocal DNS on Rancher 2 custom cluster (RKE)

Run nodelocal DNS on Rancher 2 custom cluster (RKE)

WARNING: Nodelocal DNS is currently in alpha and these steps are for testing purposes only!

Due to issues with conntrack and DNS (See https://www.weave.works/blog/racy-conntrack-and-dns-lookup-timeouts and kubernetes/kubernetes#56903) K8s 1.13 added the nodelocal DNS option to avoid this condition. This steps help you install this nodelocal DNS option onto Rancher 2 custom cluster (RKE).

Setup kubectl or use embedded kubectl in UI

Make sure kubectl is installed and pointing to the cluster you want to change or use the embedded kubectl in the UI for your cluster.