Skip to content

Instantly share code, notes, and snippets.

View bastelfreak's full-sized avatar
🏠
Working from home

Tim Meusel bastelfreak

🏠
Working from home
View GitHub Profile
@nh2
nh2 / git-signoff-rebase.gitconfig
Last active April 13, 2018 18:04
How to sign off a whole branch in git
[alias]
# Usage: git signoff-rebase [base-commit]
signoff-rebase = "!EDITOR='sed -i -re s/^pick/e/' sh -c 'git rebase -i $1 && while test -f .git/rebase-merge/interactive; do git commit --amend --signoff --no-edit && git rebase --continue; done' -"
# Ideally we would use GIT_SEQUENCE_EDITOR in the above instead of EDITOR but that's not supported for git < 1.7.8.
@caarlos0
caarlos0 / clone-all-org-repos.rb
Created November 26, 2015 18:48
Clone all repositories in any given organization.
# clone-all-org-repos.rb
#
# Clone all repositories in any given organization.
#
# Dependencies:
# - octokit
# - celluloid
#
# Usage:
# TOKEN="your-token" ruby clone-all-org-repos.rb TheOrganizationName
@dhollinger
dhollinger / voxpupuli.list
Created March 10, 2020 22:23
Voxpupuli repo files
deb [trusted=yes] https://apt.fury.io/voxpupuli/ /
@pschyska
pschyska / 0_pw_hash.rb
Last active July 6, 2021 12:30
PW hashing with puppet parser function
# lib/puppet/parser/functions/pw_hash.rb
module Puppet::Parser::Functions
newfunction(:pw_hash, type: :rvalue) do |args|
raise Puppet::ParseError, "pw_hash takes exactly two arguments, #{args.length} provided" if args.length != 2
# SHA512 ($6), default number of rounds (5000)
# rounds could be specified by prepending rounds=<n>$ parameter before the salt, i.e.
# args[0].crypt("$6$rounds=50000$#{args[1]}")
args[0].crypt("$6$#{args[1]}")
end
@mrueg
mrueg / kernel-config-check.py
Last active December 2, 2021 08:08
Kernel config checker
#!/usr/bin/env python
# Checking installed packages using linux-info.eclass
# for necessary kernel options
import portage
vartree = portage.db[portage.root]['vartree']
all_cpvs = vartree.dbapi.cpv_all()
settings = portage.config()
@raphink
raphink / Talk_Subjects.md
Last active May 16, 2022 10:08
Talk Subjects to be used for CFPs

General and Concepts

  • Declarative Deployments & why it matters

Over the last 30 years, the Configuration Management community has learned that using a declarative approach to resource management is beneficial for both stability and change management. How does this apply to the new paradigm of Kubernetes deployments?

YAML has become the de-facto standard to express resources in many fields linked to DevOps practices. What are YAML's strengths and weaknesses, and what are the other options going forward?

@jkotchoff
jkotchoff / generate_twitter_bearer_token.rb
Last active April 27, 2023 23:10
Send Tweets to the Twitter API with an OAuth1 token
# Generate and use an oauth2 bearer token for the Twitter API in Ruby
#
# For Application-Only authentication to the twitter API, a 'bearer token'
# is required to authenticate agains their endpoints for rate limiting
# purposes.
#
# This script generates a bearer token by posting to twitter and then it
# uses that token to poll their API.
#
# Note, the base 64 encoded consumer credentials for the bearer token needs

Docker Macvlan and Ipvlan Experimental Driver Examples

  • The build will be vendored into github.com/docker/docker in the next few days. In the meantime here is the binary that will be getting vendored. docker-1.11.0-dev.zip
  • Ipvlan L2 mode network with multiple subnets without a parent specified
  • For a long test that will create 54 networks and 120+ containers, then delete them all and recreate them again try ipvlan-macvlan-it.sh Instructions here Docker Macvlan and Ipvlan Manual IT Test
  • FYI Note: When the parent is empty or the --internal flag is used, a linux type dummy interface is dynamically created by Libnetwork to act as the parent. This network is completely isolated and is the equivalent to a --internal flag. This is a good mode for demoing.
  • The first test requires an interface
@natemccurdy
natemccurdy / PE_API_Reference.md
Last active October 9, 2023 20:25
PE API Reference and Notes
@johnbianchi
johnbianchi / pfctl-cheatsheet.txt
Last active November 29, 2023 22:10
pfctl cheat sheet
#### General PFCTL Commands ####
$ pfctl -d disable # packet-filtering
$ pfctl -e enable # packet-filtering
$ pfctl -q # run quiet
$ pfctl -v -v # run even more verbose
#### Loading PF Rules ####
$ pfctl -f /etc/pf.conf # load /etc/pf.conf
$ pfctl -n -f /etc/pf.conf # parse /etc/pf.conf, but dont load it
$ pfctl -R -f /etc/pf.conf # load only the FILTER rules
$ pfctl -N -f /etc/pf.conf # load only the NAT rules