Skip to content

Instantly share code, notes, and snippets.

View BirkhoffLee's full-sized avatar
🎓
Learning about CS

birkhoff BirkhoffLee

🎓
Learning about CS
View GitHub Profile
@BirkhoffLee
BirkhoffLee / steamguard.js
Last active June 28, 2019 04:42
Steamguard data & device id extractor
// yarn add binary-cookies bplist-parser
/*
To get the Steamguard file, you don't necessarily need to be jailbroken, but
if you're jailbroken: head to
/private/var/mobile/Containers/Data/Application/6BE5C937-51C0-4365-811D-F2717BAD1213/Documents
and you can get them. I'm not sure the UUID is same on all devices, but this is the actual path
on my device (iOS 12)
If you're non-jailbroken, you need to get an unencrypted backup using iTunes,
@BirkhoffLee
BirkhoffLee / config.cfg
Last active February 2, 2018 17:00
My edited CS:GO config.cfg based on C9 Shroud's original one
unbindall
bind "1" "slot1"
bind "2" "slot2"
bind "3" "slot3"
bind "4" "slot4"
bind "5" "slot5"
bind "9" "slot9"
bind "a" "+moveleft"
bind "b" "buymenu"
bind "c" "slot6"
@BirkhoffLee
BirkhoffLee / autoexec.cfg
Created February 2, 2018 16:56
My edited CS:GO autoexec.cfg based on C9 Shroud's original one
// repositions the gunmodel to mimic CSS more closely.
viewmodel_presetpos "0"
viewmodel_fov "68"
viewmodel_offset_x "2.5"
viewmodel_offset_y "1"
viewmodel_offset_z "-1.500000"
// removes the shifting of the arm when crouching down.
@BirkhoffLee
BirkhoffLee / docker.sh
Last active January 31, 2019 11:52
Install Docker and docker-compose on CentOS
#!/bin/sh
sudo yum install -y yum-utils device-mapper-persistent-data lvm2 net-tools
sudo yum-config-manager --add-repo -y https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce
sudo systemctl start docker
sudo usermod -aG docker $USER
sudo curl -L https://github.com/docker/compose/releases/download/1.17.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
echo "alias dc=docker-compose" >> ~/.bashrc
@BirkhoffLee
BirkhoffLee / install.sh
Last active November 9, 2017 11:55
Install magic-warmhole on CentOS 7
#!/bin/sh
sudo yum install -y python-pip libsodium-devel python-devel
sudo pip install --upgrade pip
sudo pip install magic-wormhole
#!/bin/bash
sudo yum update -y
sudo yum install tmux gcc wget htop epel-release fail2ban -y
wget -O vpnserver.tar.gz http://jp.softether-download.com/files/softether/v4.22-9634-beta-2016.11.27-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.22-9634-beta-2016.11.27-linux-x64-64bit.tar.gz
tar -zxvf vpnserver.tar.gz
cd vpnserver/
# printf '1\n1\n1\n' | ./.install.sh
let a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
const unflatten = (arrayToUnflatten, unflattenLength) => {
return Promise.all(new Array(Math.ceil(arrayToUnflatten.length / unflattenLength)).fill('').map((_, index) => new Promise(resolve => {
resolve(arrayToUnflatten.slice(index * unflattenLength, index * unflattenLength + unflattenLength))
})))
}
unflatten(a, 2).then(result => console.log(result))
@BirkhoffLee
BirkhoffLee / fast_edit_settings.md
Last active February 5, 2022 04:12
Quick optimize MC server

BungeeCord config.yml

sed -i "s/ip_forward: false/ip_forward: true/" config.yml

paper.yml

sed -i "s/optimize-explosions: false/optimize-explosions: true/" paper.yml
sudo apt-get update; sudo apt-get install default-jdk screen wget -y; screen -S minecraft; mkdir -p ~/minecraft/; cd ~/minecraft/; wget -O https://s3.amazonaws.com/Minecraft.Download/versions/1.11.2/minecraft_server.1.11.2.jar; echo "eula=true" > eula.txt; java -Xmx1G -Xms512M -jar minecraft_server.1.11.2.jar nogui
@BirkhoffLee
BirkhoffLee / dump.js
Created April 29, 2017 08:47
Dump all data of minecraft-ids.grahamedgecombe.com as JSON
items={}
$("table.items tr").each((i, tr) => {
item = {}
item.id = $("td.id", tr).html()
item.name = $("span.text-id", tr).html().slice(11).slice(0, -1).toUpperCase()
item.data = (item.id.indexOf(":") != null) ? item.id.split(":")[1] : "";
item.displayname = $("td.row-desc > span", tr).html()
items[item.id]=item
})
console.log(JSON.stringify(items))