Skip to content

Instantly share code, notes, and snippets.

View xlanor's full-sized avatar
❄️
Freezing

jingkai. xlanor

❄️
Freezing
  • praying for retirement before layoffs.
  • London, United Kingdom
  • 22:37 (UTC)
View GitHub Profile
@qdm12
qdm12 / main.go
Last active February 12, 2024 01:17
DNS over HTTPS server resolver under 300 lines of clean Go code
package main
import (
"bytes"
"context"
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"log"
@tbkr
tbkr / parts-list-lily58pro.md
Last active October 19, 2024 13:29
Lily58 Pro parts list

Build a custom Lily58L (Germany)

Shameless Plug of: https://gist.github.com/steven-lang/5d06ab6877926945ecbd77764e96b864 (kudos anyway)

Features

  • Lily58L is the improved version of the Lily58. New features are:
    • Rotary encoder on each half (optionally possible)
    • 12 leds can be installed for background glow
    • SK6812 Mini-E leds for per key glow (12 additional leds need to be soldered additionally)
@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active June 6, 2025 15:29
Ubuntu and Debian Cloud images in Proxmox
@vinnymac
vinnymac / README.md
Last active October 13, 2020 00:25
Guide to Hackintosh (specifically for Z390i/9900K/Vega64 build)
@Ryanb58
Ryanb58 / install.md
Last active July 23, 2025 14:27
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@sthomp
sthomp / kibana_nginx.conf
Last active June 6, 2025 19:32
nginx config to proxy connections to kibana on aws
worker_processes 1;
events {
worker_connections 1024;
}
http{
server {
listen 80;
server_name localhost;
@tswaters
tswaters / git-subdirectory-tracking.md
Last active July 23, 2025 13:50
Adding subdirectory of a remote repo to a subdirectory in local repo

This is way more complicated than it should be. The following conditions need to be met :

  1. need to be able to track and merge in upstream changes
  2. don't want remote commit messages in master
  3. only interested in sub-directory of another repo
  4. needs to go in a subdirectory in my repo.

In this particular case, I'm interested in bringing in the 'default' template of jsdoc as a sub-directory in my project so I could potentially make changes to the markup it genereates while also being able to update from upstream if there are changes. Ideally their template should be a separate repo added to jsdoc via a submodule -- this way I could fork it and things would be much easier.... but, it is what it is.

After much struggling with git, subtree and git-subtree, I ended up finding this http://archive.h2ik.co/2011/03/having-fun-with-git-subtree/ -- it basically sets up separate branches from tracking remote, the particular sub-directory, and uses git subtree contrib module to pull it all togther. Following are

@JProffitt71
JProffitt71 / s3cmdclearfiles
Created February 17, 2014 04:29
Uses s3cmd to manually remove files older than specified date (##d|m|y) in a specified bucket
#!/bin/bash
# Usage: ./s3cmdclearfiles "bucketname" "30d"
s3cmd ls s3://$1 | grep " DIR " -v | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -j -f "%Y-%m-%d %H:%M" "$createDate" +%s`
olderThan=`date -j -v-$2 +%s`
if [[ $createDate -lt $olderThan ]]
@swinton
swinton / AESCipher.py
Last active November 8, 2024 18:31
Encrypt & Decrypt using PyCrypto AES 256 From http://stackoverflow.com/a/12525165/119849
#!/usr/bin/env python
import base64
from Crypto import Random
from Crypto.Cipher import AES
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]