Skip to content

Instantly share code, notes, and snippets.

View mrunkel's full-sized avatar

Marc Runkel mrunkel

  • plusForta, GmbH
  • Düsseldorf, Germany
View GitHub Profile
@mrunkel
mrunkel / gitcheats.txt
Created April 2, 2020 15:29 — forked from chrismccoy/gitcheats.txt
git cheats
# shortform git commands
alias g='git'
# change author of all git repos
git filter-branch -f --env-filter "GIT_AUTHOR_NAME='yourname'; GIT_AUTHOR_EMAIL='youremail@example.com'; GIT_COMMITTER_NAME='yourname'; GIT_COMMITTER_EMAIL='youremail@example.com';" HEAD;
# stage only deleted files
git ls-files --deleted | xargs git add
# scan repo for dangerous Amazon Web Service IDs
@mrunkel
mrunkel / cloning repos to gitea.md
Last active April 2, 2020 15:25
I mirror my Github repositories to Gitea, stolen from Jan-Piet Mens (because his site is down)

After backing up all my gists and cloning all my starred repositories there is one more thing I want to accomplish: backup my Github repositories, and by that I really mean the ones I manage and have commit rights to. I could do this by cloning and periodically pulling (as we discussed here), but you might have noticed that I explicitly exclude my own repositories in that script by checking for repo.owner.login. The reason is: I want to mirror them into Gitea.

Why Gitea? Untypically, I’d like a Web UI onto these repositories in addition to the files in the file system. It could have been Gitlab, but I think Gitea is probably the option with the lowest resource requirements.

When I add a repository to Gitea and specify I want it to be mirrored, Gitea will take charge of periodically querying the source repository and pulling changes in it. I’ve mentioned Gitea previously, and I find it’s improving as it matures.

@mrunkel
mrunkel / Jenkinsfile
Created March 30, 2020 11:54 — forked from jasonk/Jenkinsfile
Docker credential helper for authenticating from environment variables
pipeline {
environment {
DOCKER_REGISTRY = 'https://my-docker-registry.example.com'
DOCKER_CREDS = credentials( 'my-docker-credentials' )
}
}
@mrunkel
mrunkel / make_config.sh
Created March 11, 2020 00:08
OpenVPN Client Config Builder (for easyrsa v3)
#!/bin/bash
set -e
# First argument: Client identifier
if [ "$#" -ne 1 ] ; then
echo "Must pass exactly 1 parameter, not ${#}"
exit 2
fi
@mrunkel
mrunkel / pr.md
Created November 28, 2019 06:54 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

Keybase proof

I hereby claim:

  • I am mrunkel on github.
  • I am mrunkel (https://keybase.io/mrunkel) on keybase.
  • I have a public key ASDpSWc5Su892qfjBF4jtgO45A5DWhphOEMhgQ22G9hLvgo

To claim this, I am signing this object:

@mrunkel
mrunkel / zfs_cheatsheet.md
Last active March 10, 2024 20:23
My ZFS cheatsheet

ZFS commands cheatsheet

Devices and Pools

List all devices in the server

lsblk -S

List all pools

zpool list

@mrunkel
mrunkel / docker-compose.yml
Created May 10, 2019 09:52
Local PHP dev env
version: '3.1'
services:
memcached:
image: memcached:alpine
container_name: kirby-memcached
mailhog:
image: mailhog/mailhog:latest
@mrunkel
mrunkel / branches.md
Last active April 30, 2019 09:57
Some tricks around managing git branches

delete branches according to a pattern

Use: git branch | grep '<somepattern>'

To select the branches you want to delete. <somepattern> can be a regex or just a text match.

Once you have the list you want, you can use xargs to execute the git command to remove those branches.

Example: Remove all of my branches from the origin: