Skip to content

Instantly share code, notes, and snippets.

View dvalfrid's full-sized avatar

Daniel Valfridsson dvalfrid

View GitHub Profile
@dvalfrid
dvalfrid / gist:72a203931a928dbc67e2da568b4c5547
Last active November 5, 2020 17:00
Control the POE fan with ubuntu

Rasparry PI - how to control your POE-fan in Ubuntu

Check if you have the POE-fan

cat /sys/class/thermal/cooling_device0/type

should give rpi-poe-fan

Create file

sudo vi /etc/udev/rules.d/50-rpi-fan.rules

Let's Encrypt for UniFi Cloud Key G2+

Install acme

  • curl https://get.acme.sh | sh

  • acme.sh --upgrade --auto-upgrade --accountemail "[email protected]"

Configure acme Let's Encrypt

-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org
mQGiBEAQ1DURBADhg5y3w9MlSySfh/rOyS5dEUEyKuNHOibOR4a3GdoHSXUIg2Ws
Y1StzN/kx2TB220rOTGFg1tiAEbrhls2zK1t93eqgfmodpx5/ZbVL6//dKFWKNwk
O+gQsTOH1NRqoBnJcsIbXlJghhZ2jcdOTCyf3E4xcvhdvGV+32oujBv5IwCgsvaD
6Wr9X0B3S0PkSB9R73w1heEEAJiTAEM7Muz9RIXqoKhX08eCEEgAeteGcrVzgnQF
bSmz828nsjVD38gRKha5OPWemhLo7vZuYYUCVKEDfcDUV6r6Bo/QelemC8+Ilxxc
rLZU/2Lu1wVI3vb4Gd2aB8LAwKvfui4jLEjQocwhjFNFTmPlG+Q4GtMHIdPoE6En
3HjmA/4r9cCOdax0DFSpfG9abytr3Fu4ze+FkxWMZ5hkGin6GOI/QI0ExVEjqoco
@dvalfrid
dvalfrid / joker.sh
Last active January 20, 2021 15:46
Bash script for updating DNS server at joker.com
#!/bin/bash
# Fetching IP adress from joker.com
# Format: <html><head><title>Current IP Check</title></head><body>Current IP Address: 88.80.167.132</body></html>
function fetchIP {
local _returnParam=$1
local _response=$(curl --silent https://svc.joker.com/nic/checkip)
local _exit_code=$?
if [ $_exit_code -ne 0 ]; then

Keybase proof

I hereby claim:

  • I am dvalfrid on github.
  • I am dvalfrid (https://keybase.io/dvalfrid) on keybase.
  • I have a public key whose fingerprint is A033 4D60 6110 AFB3 F3A4 AF56 1DD8 D28F E4C4 BE35

To claim this, I am signing this object:

@dvalfrid
dvalfrid / EnumLookupMap
Created January 10, 2014 07:13
Enum lookup Map
// Först behöver vi ett interface
package net.valfridsson;
public interface IdentityEnum<I, E extends Enum<E>> {
/**
* @return Hämtar ut {@link I} för {@link E}
*/
I getId();