Skip to content

Instantly share code, notes, and snippets.

View BirknerAlex's full-sized avatar
✌️
Hej!

Alexander Birkner BirknerAlex

✌️
Hej!
View GitHub Profile
@BirknerAlex
BirknerAlex / FontAwesome.ts
Last active April 18, 2025 18:07
Payload CMS Font Awesome Select Field
import { Field } from 'payload';
export const FontAwesomeField: Field = {
name: 'fontAwesomeIcon',
label: 'Icon',
type: 'text',
validate: (value) => {
if (!value) {
return 'Please select an icon';
}
#!/bin/bash
if [[ -d "/home/ubuntu/.ssh/" ]]; then
mv -v /home/ubuntu/.ssh/ /root/
chown -R root:root /root/.ssh/ && chmod 700 /root/.ssh/ && chmod 600 /root/.ssh/*
sed -ie 's/#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
systemctl reload ssh
pkill -u ubuntu && userdel -r ubuntu
fi
@BirknerAlex
BirknerAlex / qemu-img-format.go
Last active July 20, 2020 15:59
QEMU Image Format detection (golang)
package qemu
import (
"bytes"
"io"
)
type Format string
const (
@BirknerAlex
BirknerAlex / go_example_websocket_novnc
Created May 6, 2020 09:17 — forked from bit4bit/go_example_websocket_novnc
Example: Go Websocket binary proxy noVnc
package main
import (
"flag"
"golang.org/x/net/websocket"
"io"
"log"
"net"
"net/http"
"os"
@BirknerAlex
BirknerAlex / gpg-info.py
Created June 12, 2019 15:58
Yubikey GPG info script
import subprocess
import re
import sys
class GPGInfo:
@staticmethod
def get_id():
output = subprocess.check_output("/usr/bin/gpg2 --card-status --batch", shell=True)
results = re.search('^Signature key.*: ([A-Z0-9 ]+)', output.decode(), re.MULTILINE)
@BirknerAlex
BirknerAlex / replace_raid_disk.md
Created October 12, 2018 17:14
Replace RAID Disk

1. Lookup RAID Information

mdadm --detail /dev/md127 

Sample Output:

/dev/md127:
           Version : 1.2
@BirknerAlex
BirknerAlex / wifi_on_ice_checker.sh
Last active August 24, 2018 19:11
Checking DB Wifi on ICE connection. If the traffic limit of 200MB has been exceeded, doing some magic stuff.
#!/bin/bash
echo "-------------------------"
echo "DB WiFi Online Checker"
echo "Version 1.0"
echo "-------------------------"
if [[ `whoami` != 'root' ]]
then
echo "`date`: Please run this script as root! Try again with \"sudo bash $0\"."
@BirknerAlex
BirknerAlex / routes.sh
Last active May 17, 2016 11:19
Mac OS X: PPTP VPN - Add single ips to routes
#!/bin/bash
if [[ `whoami` != "root" ]]
then
echo "Please run this script as root"
exit 1
fi
ifname="ppp0"
mtu="1400"