Skip to content

Instantly share code, notes, and snippets.

View zthxxx's full-sized avatar
🐾
Nyaa~

zthxxx zthxxx

🐾
Nyaa~
View GitHub Profile
@zthxxx
zthxxx / deb-install-nvidia-docker.sh
Last active May 8, 2018 13:21
install nvidia-docker on Debian/Ubuntu, and run tensorflow
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
apt purge -y nvidia-docker
# Add the package repositories
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
tee /etc/apt/sources.list.d/nvidia-docker.list
apt update
const raw = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
let line
while (line = raw.shift()) {
console.log(line)
}
@zthxxx
zthxxx / crack-with-navicat-keygen.sh
Last active November 17, 2024 14:52
crack navicat premuim 12.04 with navicat-keygen
# make sure exist a keychain identity preference named "crack-for-navicat"
# ref: https://github.com/DoubleLabyrinth/navicat-keygen/tree/mac
# to gen a identity,
# https://github.com/DoubleLabyrinth/navicat-keygen/issues/50#issuecomment-416824334
# set the Name: crack-for-navicat
# set the Certificates Type: Code Signing
# after created, you need always trust this identity,
# then you can use this commad under to check:
# security find-identity -vp codesigning
@zthxxx
zthxxx / bundle.bat
Created April 17, 2018 12:22
bundle python package to win exe (support pandas)
@echo off
if not exist venv/ call init.bat
call venv\Scripts\activate.bat
pyinstaller -F main.py --hidden-import=pandas._libs.tslibs.timedeltas
call venv\Scripts\deactivate.bat
rd /s/q build
@zthxxx
zthxxx / mongo-docker-init.sh
Last active December 30, 2019 13:48
mongodb docker init operate
# mongo docker init operate
mongo_data="/var/lib/mongo/db"
sudo mkdir -p "$mongo_data"
sudo chown -R $USER "$mongo_data"
docker run --rm -v "$mongo_data":/data/db mongo:3.6 init-db.js
docker run -d --rm -v "$mongo_data":/data/db -p 127.0.0.1:23333:27017 --name mongo -h mongodb mongo:3.6 --auth
docker logs -f mongo
@zthxxx
zthxxx / deb-install-docker.sh
Last active May 9, 2018 17:59
install docker with DEB package on debian / ubuntu
#!/usr/bin/env bash
# curl -sL https://gist.githubusercontent.com/zthxxx/772178f5393b07c1e1bb7536c5f95c3d/raw/deb-install-docker.sh | bash
specify_user="${1:-root}"
apt update
apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
apt remove -y docker docker-engine docker.io
LSB=`lsb_release -is | tr '[:upper:]' '[:lower:]'`
curl -fsSL https://download.docker.com/linux/${LSB:-debian}/gpg | apt-key add -
@zthxxx
zthxxx / install-EFB.sh
Last active July 21, 2020 04:58
install ehForwarderBot 2.0
apt install -y python3-pip libopus0 ffmpeg libmagic1
pip3 install setuptools ehforwarderbot efb-telegram-master efb-wechat-slave
EFB_DATA_PATH="${HOME}/.ehforwarderbot"
EFB_PROFILE="${EFB_DATA_PATH}/profiles/default"
mkdir -p ${EFB_PROFILE}/blueset.telegram
cat > ${EFB_PROFILE}/config.yaml <<-EOF
master_channel: blueset.telegram
slave_channels:
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 3, 2025 16:07
crack activate Office on mac with license file
@zthxxx
zthxxx / win-kms.bat
Last active January 31, 2024 05:32
win-kms
:: active win10 VL
:: ensure you are run as Administrator
cmd /c "slmgr /skms kms.03k.org && slmgr /ato"
:: active office VL
:: in Microsoft Office installed folder
:: office2016 64bit default in C:\Program Files\Microsoft Office\Office16
cd "C:\Program Files\Microsoft Office\Office16"
cscript ospp.vbs /sethst:kms.03k.org && cscript ospp.vbs /act
@zthxxx
zthxxx / PoW-CTFjs
Created March 27, 2018 04:59
Proof of work in CTF-wirteup
cosnt crypto = require('crypto')
const md5sum = str => crypto.createHash('md5').update(str).digest('hex')
function PoW(target, start, end) {
while (true) {
let rand = Math.random().toString(36)
let hash = md5sum(rand).slice(start, end)
if (hash === target) return rand
}
}