Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Valfridsson dvalfrid

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

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

View Let's Encrypt with Unifi Cloud Key.md

Let's Encrypt for UniFi Cloud Key G2+

Install acme

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

  • acme.sh --upgrade --auto-upgrade --accountemail "your@email.com"

Configure acme Let's Encrypt

@dvalfrid
dvalfrid / publickey.pgp
Created Jan 9, 2017
Public PGP key for daniel@valfridsson.net
View publickey.pgp
-----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 Jan 20, 2021
Bash script for updating DNS server at joker.com
View joker.sh
#!/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
View keybase.md

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:

View EnumLookupMap
// 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();