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
@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
@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
@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?

@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.
@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()
@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