Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Wellnitz dh1tw

View GitHub Profile
@jm3
jm3 / hugo-giphy-shortcode.html
Last active May 30, 2020
Hugo embed for Giphy (responsive)
View hugo-giphy-shortcode.html
<!-- https://todayilearned.jm3.net/learnings/hugo-shortcode-for-giphy-embeds/ -->
<div style="width:100%;height:0;padding-bottom:40%;position:relative;">
<iframe src="https://giphy.com/embed/{{ (index .Params 0) }}"
width="100%" height="100%" style="position:absolute"
frameBorder="0" allowFullScreen></iframe></div>
@Jiab77
Jiab77 / raspberry-pi-2-3-and-4-wireless-bridge-ubuntu-server-18.04-arm+netplan.md
Last active Nov 20, 2021
Raspberry Pi 2/3B/B+/4B Wireless Bridge using Ubuntu Server 18.04 ARM Image and Netplan
View raspberry-pi-2-3-and-4-wireless-bridge-ubuntu-server-18.04-arm+netplan.md

Raspberry Pi 2/3B/B+/4B Wireless Bridge using Ubuntu Server 18.04 ARM Image and Netplan

The initial goal of this project is to use the raspberry pi in place of my Wireless Range Extender and then going from 3 wireless networks (2.4ghz, 2.4ghz extended, 5ghz) at home to only one (5ghz). This way I'm reducing the exposition to radio waves for the whole familly at home.

Let's go technical

Ok, enough drama for now, let's go technical. 😁

Setup

@travisjeffery
travisjeffery / functional-options.md
Last active Mar 6, 2021
How to do functional options in Golang
View functional-options.md

Here's the simplest example showing how to do functional options in Golang.

They're a great way to enable users to set options and ease adding new options later.

package main

import (
	"flag"
	"fmt"
@qrkourier
qrkourier / ovirt-private-ca.md
Last active Oct 11, 2021
Install a Server Certificate For oVirt Manager UI
View ovirt-private-ca.md

Install server certificates issued by a private CA in oVirt4 Manager and Host

  • generate a signing request on the system where oVirt Manager is running (the engine server)
openssl req -new -sha256 -key /etc/pki/ovirt-engine/keys/apache.key.nopass -out /tmp/engine.csr
  • Submit the CSR to the issuer and wait. Or, if you are the issuer and you happen to be using FreeIPA/IdM, you may issue the certificate with ipa-admintools. For example,
@NathanGiesbrecht
NathanGiesbrecht / noip2.service
Last active Nov 21, 2021
Systemd Service file for no-ip.com dynamic ip updater
View noip2.service
# Simple No-ip.com Dynamic DNS Updater
#
# By Nathan Giesbrecht (http://nathangiesbrecht.com)
#
# 1) Install binary as described in no-ip.com's source file (assuming results in /usr/local/bin)
# 2) Run sudo /usr/local/bin/noip2 -C to generate configuration file
# 3) Copy this file noip2.service to /etc/systemd/system/
# 4) Execute `sudo systemctl daemon-reload`
# 5) Execute `sudo systemctl enable noip2`
# 6) Execute `sudo systemctl start noip2`
@TheHippo
TheHippo / Makefile
Created Mar 31, 2016
Golang Makefile example
View Makefile
OUT := binariy-name
PKG := gitlab.com/group/project
VERSION := $(shell git describe --always --long --dirty)
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/)
all: run
server:
go build -i -v -o ${OUT} -ldflags="-X main.version=${VERSION}" ${PKG}
@spalladino
spalladino / mysql-docker.sh
Created Dec 22, 2015
Backup and restore a mysql database from a running Docker mysql container
View mysql-docker.sh
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@johanndt
johanndt / upgrade-postgres-9.3-to-9.5.md
Last active Jul 6, 2020 — forked from dideler/upgrade-postgres-9.3-to-9.4.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu
View upgrade-postgres-9.3-to-9.5.md

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
@magnetikonline
magnetikonline / README.md
Last active Sep 18, 2021
BIND - delegate a sub domain for a zone.
View README.md

BIND - delegate a sub domain for a zone

The scenario:

  • DNS zone myzone.com defined in BIND.
  • Authoritative name server at 123.16.123.1.
  • Subzone sub.myzone.com with an authoritative name server at 123.16.123.10.
  • Wishing to forward sub-zone to authoritative name server.

Config

@magnetikonline
magnetikonline / README.md
Last active Jan 31, 2020
Install Parallels version 10/11/12/13 tools on Ubuntu server guest.
View README.md

Install OSX Parallels version 10/11/12/13 tools on Ubuntu server guest

Have tested these instructions successfully under Ubuntu 16.04LTS and 14.04LTS.

  • Create Ubuntu server instance under Parallels (obviously).
  • Start VM, goto Actions - Install Parallels Tools... to mount the ISO image.
    • Note: if this fails, or updating tools for an existing guest you can do the following:
    • Goto Devices > CD/DVD 1 > Connect Image....
    • Select the following ISO image: /Applications/Parallels Desktop/Contents/Resources/Tools/prl-tools-lin.iso.
    • This will mount the tools CD image.
  • From the terminal, run the following commands: