Skip to content

Instantly share code, notes, and snippets.

View imlonghao's full-sized avatar
🐒

imlonghao imlonghao

🐒
View GitHub Profile
@xen0bit
xen0bit / Dockerfile
Created October 11, 2023 04:19
CVE-2023-38545
FROM debian:latest
RUN apt-get update && apt-get install -y \
git \
build-essential \
wget \
python3
WORKDIR /build
@timothyandrew
timothyandrew / dns.go
Created July 29, 2022 14:46
Barebones Recursive DNS Resolver
package main
import (
"fmt"
"math/rand"
"os"
"github.com/miekg/dns"
)
@kradalby
kradalby / cloudinit.yaml
Created February 12, 2022 08:23
Oracle Linux 8.5 to NixOS with ESP resizing
#cloud-config
# vim: syntax=yaml
disable_root: false
ssh_authorized_keys: []
write_files:
- path: "/etc/ssh/sshd_config.d/permit_root"
owner: "root:root"
permissions: "0644"
content: |
@anthonydiiorio
anthonydiiorio / wsjt_cloudlog.py
Last active March 17, 2024 10:21 — forked from Cadair/wsjt_cloudlog.py
Upload QSOs from WSJT-X/JTDX to Cloudlog
#!/bin/env python3
"""
WSJT-X to Cloudlog QSO uploader.
This script reads QSO events from the WSJT UDP server and uploads the ADIF records to Cloudlog.
No non-standard library packages are required to run this.
usage: wsjt_cloudlog.py [-h] [--wsjt-port WSJT_PORT] [--wsjt-host WSJT_HOST] [--verbose] url api_key station_id
positional arguments:
# Origin whitelist
map $http_origin $allowed_origin {
default "false";
"~*\.?test\.com" "true";
"~*\.?example\.com" "true";
}
# Methods
map $request_method $cors {
@mhart
mhart / index.js
Created July 24, 2019 21:04
Log errors to Sentry from a Cloudflare Worker
// Get the key from the "DSN" at: https://sentry.io/settings/<org>/projects/<project>/keys/
// The "DSN" will be in the form: https://<SENTRY_KEY>@sentry.io/<SENTRY_PROJECT_ID>
// eg, https://0000aaaa1111bbbb2222cccc3333dddd@sentry.io/123456
const SENTRY_PROJECT_ID = '123456'
const SENTRY_KEY = '0000aaaa1111bbbb2222cccc3333dddd'
// Useful if you have multiple apps within a project – not necessary, only used in TAGS and SERVER_NAME below
const APP = 'my-app'
// https://docs.sentry.io/error-reporting/configuration/?platform=javascript#environment
@nmurthy
nmurthy / getTotps.js
Created January 30, 2019 20:56
export authy totp codes
/* 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:
#!/usr/bin/env python
# Based on https://www.openwall.com/lists/oss-security/2018/08/16/1
# untested CVE-2018-10933
import sys, paramiko
import logging
username = sys.argv[1]
hostname = sys.argv[2]
command = sys.argv[3]
@krisnod
krisnod / gist:56ff894f400cce7c742fb11fb2fde9cf
Last active April 6, 2022 18:46
RancherOS on Hetzner using software RAID (RAID 1)
Install:
----------
* Activate Hetzner Rescue System (Debian)
* Connect to Hetzner Rescue System using SSH and live boot RancherOS
(thanks goes to William Fleurant for showing how this can be done: https://github.com/wfleurant/boot-rancheros-hetzner/)
* apt-get update
* apt-get install kexec-tools aria2