Skip to content

Instantly share code, notes, and snippets.

View janhoffmann's full-sized avatar

Jan Hoffmann janhoffmann

View GitHub Profile
@janhoffmann
janhoffmann / addbr0ubunmcli.md
Created June 2, 2023 22:43 — forked from plembo/addbr0ubunmcli.md
Add br0 to Ubuntu desktop using nmcli

Add a bridge interface to Ubuntu desktop using nmcli

Had to do this for some advanced networking with KVM, and couldn't figure out how to do it using the Nework Manager gui. Did find an article later that showed how to do it with nmtui, but it's so much easier to record what you did when using the cli.

To see what everything looks like before starting:

$ nmcli con show
@janhoffmann
janhoffmann / gpg_git_signing.md
Created May 16, 2018 18:42 — forked from alopresto/gpg_git_signing.md
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@janhoffmann
janhoffmann / postcode_germany_ruby.rb
Created December 18, 2017 08:12
Ruby Array/Hash mit Postleitzahlen nach Bundesländer mit ISO Code. Idee von: https://gist.github.com/westberliner/8c527f7390621bafa01f
postcodes = [
{from: 1001, till: 1936, region: 'Sachsen', isocode: 'de-sn'},
{from: 1001, till: 1936, region: 'Sachsen', isocode: 'de-sn'},
{from: 1941, till: 1998, region: 'Brandenburg', isocode: 'de-bb'},
{from: 2601, till: 2999, region: 'Sachsen', isocode: 'de-sn'},
{from: 3001, till: 3253, region: 'Brandenburg', isocode: 'de-bb'},
{from: 4001, till: 4579, region: 'Sachsen', isocode: 'de-sn'},
{from: 4581, till: 4639, region: 'Thüringen', isocode: 'de-th'},
{from: 4641, till: 4889, region: 'Sachsen', isocode: 'de-sn'},
{from: 4891, till: 4938, region: 'Brandenburg', isocode: 'de-bb'},
@janhoffmann
janhoffmann / 0_reuse_code.js
Created June 23, 2016 21:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Keybase proof

I hereby claim:

  • I am janhoffmann on github.
  • I am janhoffmann (https://keybase.io/janhoffmann) on keybase.
  • I have a public key whose fingerprint is 698D 0F01 2101 EE30 3F47 4F57 3CFA 3C96 D7CD 4B1F

To claim this, I am signing this object: