Skip to content

Instantly share code, notes, and snippets.

View mattkasun's full-sized avatar

Matthew R Kasun mattkasun

View GitHub Profile
@mattkasun
mattkasun / mq_troubleshooting.md
Last active April 17, 2023 10:03
Netmaker v0.13.0 MQ Troubleshooting

not applicable post v0.16.1

Basic Troubleshooting/Cert Regeneration

Check docker-compose.yml

if MQ is proxied

- image: eclipse-mosquitto:2.0.14-opensssl
- expose
  - 8883"
@mattkasun
mattkasun / t3U.txt
Created February 16, 2022 01:36
TPLINK T3U wireless adapter
git clone https://github.com/cilynx/rtl88x2bu.git
cd rtl88x2bu
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf)
sudo rsync -rvhP ./ /usr/src/rtl88x2bu-${VER}
sudo dkms add -m rtl88x2bu -v ${VER}
sudo dkms build -m rtl88x2bu -v ${VER}
sudo dkms install -m rtl88x2bu -v ${VER}
sudo modprobe 88x2bu
@mattkasun
mattkasun / release_version
Created November 23, 2021 20:38
Get Version of Latest Github Release
curl -fsSLI -o /dev/null -w %{url_effective} https://github.com/mattkasun/timetrace-gui/releases/latest | awk -F/ '{print $8}'
@mattkasun
mattkasun / version.txt
Created October 28, 2021 13:21
Version info for app
Here's a simple example, hopefully it would clarify and help how to do it easily:
Create a directory for your application:
$ mkdir app && cd app
Create a sub directory config:
$ mkdir config
@mattkasun
mattkasun / gist:466c6714fb5d5406edd3f5356eef92f1
Created October 13, 2021 19:40
Generate Edit Template from Struct
package main
import (
"fmt"
"reflect"
"github.com/gravitl/netmaker/models"
)
func GenerateTemplate(a interface{}, action string) {
@mattkasun
mattkasun / motion.go
Last active March 16, 2021 14:45
Store mqtt motion detections in redis timeseries
package main
import (
"fmt"
"log"
"log/syslog"
"math"
"os"
"time"
#get connected monitors
xrandr -q | grep connected
#get brighness -- replace DP-1-2 with monitor name
xrandr --verbose --current |grep ^DP-1-2 -A5 | tail -n1
#set brightness
xrandr --output DP-1-1 --brightness 1.5
@mattkasun
mattkasun / wg-watchdog.sh
Created October 31, 2020 13:50
wireguard watchdog script
#!/bin/bash
tries=0
while [[ $tries -lt 3 ]]
do
if /bin/ping -c 1 10.200.200.1
then
# echo "wg working"
logger -n winterfell -i -t "wg-watchdog" -p user.notice "wireguard working"
exit 0
Re: Wine install Mint 19 Mate
Post by truesarang » Mon Jul 16, 2018 6:56 pm
1. sudo dpkg --add-architecture i386
2. wget -nc https://dl.winehq.org/wine-builds/Release.key
3. sudo apt-key add Release.key
4. sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
@mattkasun
mattkasun / cherry_pick.txt
Created February 22, 2018 14:09
Cherry Pick a commit
Let's say you want to apply some patches from someone else repository:
# Cloning our fork
$ git clone git clone git@github.com:ifad/rest-client.git
# Adding (as "endel") the repo from we want to cherry-pick
$ git remote add endel git://github.com/endel/rest-client.git
# Fetch their branches
$ git fetch endel