Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# 4633c8a2a16a8e0428d253baafb76bbc18f29562390c84d1c85ba98865531a2b
CRYPTER="base64 -b 78"
HEADER="----BEGIN PGP MESSAGE----"
FOOTER="-----END PGP MESSAGE-----"
do_encryption() {
local plain="$1"
@jasonbrooks
jasonbrooks / kube-setenforce-1.md
Last active January 5, 2017 20:38
kubernetes ansible setenforce 1

I use these ansible scripts (see also) to bring up kubernetes clusters, on centos and fedora. The scripts are awesome, but they put selinux into permissive mode, because, "tokens and selinux don't work together."

That's unfortunate, because one of the main things I'm doing when I turn up a kubernetes cluster is bug-hunting, and selinux can be a source of bugs.

I commented out the bit that put selinux into permissive mode:

#- name: Set selinux permissive because tokens and selinux don't work together
#  selinux: state=permissive policy={{ ansible_selinux.type }}
# when: ansible_selinux is defined and ansible_selinux.status == "enabled"
@devsr
devsr / PKGBUILD-mail-notification-5.4-10.patch
Created June 3, 2014 13:29
PKGBUILD patch for AUR mail-notification-5.4-10
--- PKGBUILD.orig 2012-10-27 12:55:25.000000000 -0400
+++ PKGBUILD 2014-06-03 09:19:20.109161553 -0400
@@ -27,7 +27,8 @@
mail-notification-5.4-gtk3-support.patch
mail-notification-5.4-add-fallback-icon.patch
mail-notification-5.4-gmime.patch
- mail-notification-5.4-libx11.patch)
+ mail-notification-5.4-libx11.patch
+ mail-notification-dont-link-against-bsd-compat.patch )
md5sums=('c8dc33a61251acb5474e56eab6b18f43'
@dominicsayers
dominicsayers / elasticsearch.md
Last active March 2, 2024 15:52
Configuring ElasticSearch to use less memory

What I actually did

/etc/security/limits.conf

elasticsearch hard memlock 100000

/etc/default/elasticsearch

@jordoh
jordoh / entity.lua
Last active May 22, 2022 22:08
Starbound lua API
--- Stubs for entity.* callbacks defined in C++.
--
-- DO NOT INCLUDE this file in your scripts, it is for documentation purposes only.
--
-- Entity callbacks query and mutate the specific entity that is running the
-- lua script. They can be called from a _different_ entity using
-- world.callScriptedEntity(targetEntityId, "entity.*"), replacing "*" with the
-- name of a function defined below.
--
-- Specific types of entities (e.g. NPCs, Objects) define different sets of
@djcp
djcp / Debian Jessie
Last active July 3, 2022 18:03
ubuntu / debian /etc/os-release files - and there was much gnashing of teeth and rending of flesh. . .
PRETTY_NAME="Debian GNU/Linux jessie/sid"
NAME="Debian GNU/Linux"
ID=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="http://bugs.debian.org/"
@offlinehacker
offlinehacker / README.rst
Last active January 8, 2022 18:21
Script that learns openvpn hostnames from cert CN filed

ovpn-learnaddress

openvpn learn-address script to manage a hosts-like file

  • intended to allow dnsmasq to resolve openvpn clients
  • written for openwrt (busybox), but should work most anywhere

How it works?

@dmytro
dmytro / ssh-multi.sh
Created October 31, 2012 03:46
Start multiple synchronized SSH connections with Tmux
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then
@ndarville
ndarville / secret-key-gen.py
Created August 24, 2012 17:01
Generating a properly secure SECRET_KEY in Django
"""
Two things are wrong with Django's default `SECRET_KEY` system:
1. It is not random but pseudo-random
2. It saves and displays the SECRET_KEY in `settings.py`
This snippet
1. uses `SystemRandom()` instead to generate a random key
2. saves a local `secret.txt`
@btoone
btoone / curl.md
Last active May 11, 2024 05:35
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin