Skip to content

Instantly share code, notes, and snippets.

View dh1tw's full-sized avatar

Tobias Wellnitz dh1tw

View GitHub Profile
@Jiab77
Jiab77 / raspberry-pi-2-3-and-4-wireless-bridge-ubuntu-server-18.04-arm+netplan.md
Last active February 26, 2024 17:42
Raspberry Pi 2/3B/B+/4B Wireless Bridge using Ubuntu Server 18.04 ARM Image and Netplan

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 April 23, 2023 11:13
How to do functional options in Golang

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 October 11, 2021 07:57
Install a Server Certificate For oVirt Manager UI

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 February 24, 2024 01:32
Systemd Service file for no-ip.com dynamic ip updater
# 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 March 31, 2016 22:32
Golang Makefile example
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 December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# 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 July 15, 2022 12:35 — forked from dideler/upgrade-postgres-9.3-to-9.4.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu

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 February 12, 2024 00:13
BIND - delegate a sub domain for a zone.

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 July 28, 2022 07:25
Install Parallels version 10/11/12/13 tools on Ubuntu server guest.

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.
@mattes
mattes / check.go
Last active April 4, 2024 22:40
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}