Skip to content

Instantly share code, notes, and snippets.

View artizirk's full-sized avatar

Arti Zirk artizirk

View GitHub Profile
@KaarelP2rtel
KaarelP2rtel / id-kaart-ssh.md
Last active September 4, 2022 18:59
SSH sisselogimine ID Kaardiga - muljeid aastast 2019

SSH autentimine ID Kaardiga - muljeid aastast 2019

(English version below)

Juhiseid, kuidas ID-Kaardiga logida SSH kaudu sisse on kirjutatud juba 2011 aastast. Kirjutan natuke oma tähelepanekutest 2019 aastal ning ka sellest, kuidas kasutada ID Kaarti Windowsis Puttyga.

Smartcardi kasutamine võimaldab SSH ligipääsu erinevatest masinatest nii, et ei pea hakkama igas masinas võtmeid genereerima või masinate vahel võtmeid kopeerima. ID Kaart peaks olema enamustel Eestlastel olemas olema, seega hea võimalus on seda ära kasutada.

Linux (Ubuntu 19.10+)

1. Vajalik tarkvara

openssh-client versioon 8+

@danderson
danderson / nat64.md
Created October 7, 2019 01:16
NAT64 all in kernel mode

I'm writing this up as a gist, because I'm not sure I'll pursue any of it, but it seems worth writing down.

A basic problem with IPv6-only LANs at the moment is that you still need support for legacy protocol servers, which implies you doing some kind of DNS64 and NAT64 (IPv6-to-IPv4 stateful translation).

Currently, NAT64 only exists outside the kernel, as userspace software. This is not ideal because it limits available performance (since you have to keep bouncing between user space and kernel space),

@AmazingTurtle
AmazingTurtle / how-to-restore.md
Last active April 1, 2024 17:47
restore access to unifi controller

Restore access to a unifi controller

When you are unable to login to the unifi controller or forgot admin password, you can restore access using SSH and manipulating mongodb directly.

Warning

Do not uninstall unifi controller - most of the data is not stored in mongodb. In case you thought a mongodb backup would be sufficient, you may have fucked up already, just like me. However I managed to write this "tutorial" for anyone to not run into the same trap.

Apparently this guide no longer works with recent unifi controller versions (starting nov/dec 2022). Since I no longer use unifi hardware in my home system, I can not update the guide myself. In case you've gotten here to recover your data, you're likely doomed. But giving it a try won't hurt anyway, therefore: good luck.

@teadur
teadur / awp_5.3.0.16.04.130_amd64.deb.postinst
Created December 6, 2018 18:24
awp_5.3.0.16.04.130_amd64.deb.postinst
#!/bin/bash
NSSDB=$HOME/.pki/nssdb
MODUTIL="/usr/bin/modutil -force -dbdir sql:$NSSDB"
CERTUTIL="/usr/bin/certutil -d sql:$NSSDB"
LIBFILE=/usr/local/AWP/lib/libOcsPKCS11Wrapper.so
if [ -n "`which apt-get`" ];
then
sudo apt-get -y install libnss3-tools 2>/dev/null
@binaryoverload
binaryoverload / AuthyToOtherAuthenticator.js
Last active September 20, 2022 21:31 — forked from JacobJohansen/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
/* base32 */
/*
Copyright (c) 2011, Chris Umbel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@mikroskeem
mikroskeem / compile_bf.py
Last active March 3, 2019 16:46
Quick, dirty and sort of safe brainfuck compiler
#!/usr/bin/env python3
import sys
import pprint
GENERATED_CODE_BASE = """/*
* Code generated using compile_bf.py
*/
#include <stdlib.h>
#include <stdio.h>
#!/usr/bin/env bash
mountSnapshots () {
mkdir -p "/mnt/$ZFSSNAPSHOTNAME"
mount -t zfs "$ZFSSNAPSHOTBASE@$ZFSSNAPSHOTNAME" "/mnt/$ZFSSNAPSHOTNAME"
while read -r line
do
MOUNTPATH=$(echo "$line" | sed "s/$ESCAPEDZFSSNAPSHOTBASE\///" | sed "s/@$ZFSSNAPSHOTNAME//")
#!/usr/bin/env bash
if [ $# -eq 2 ]
then
BASENAME=$(basename $1)
RUNNAME=rclone-$BASENAME
ZFSSNAPSHOTBASE=$(zfs list | grep "$BASENAME" | grep -v "$BASENAME/" | awk '{print $1}')
PIDFILE=/var/lock/$RUNNAME.pid
ISOTIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
YEAR=$(date -u +"%Y")
ZFSSNAPSHOTNAME="rclone"
@Hermanio
Hermanio / .thermal-daemon.sh
Last active July 6, 2021 03:24
Quick and dirty early throttling script using bash and intel p-state driver toggling. USE AT YOUR OWN RISK.
#!/bin/bash
targettemp=90
clockpct=70
while true
do
currenttemp=$(sensors -u | awk '/temp1_input/ {print $2; exit}' )
compare=$(echo $currenttemp'>'$targettemp | bc -l)
turbo=`cat /sys/devices/system/cpu/intel_pstate/no_turbo`
if [ "$turbo" -eq 0 ]
@Spirotot
Spirotot / record.sh
Last active October 17, 2020 00:28
Sway WM screen + audio recorder
#!/bin/bash
# Sway WM screen + audio recorder
# Usage: ./record -d [display] -a [audio_device] -o [project_output_name]
#
# Displays can be listed with `swaymsg -t get_outputs`.
# Audio devices can be listed with `arecord -l`.
# Probably best not to put spaces in the "-o" argument, sorry...
#
# Dependencies: ffmpeg, alsamixer
#