This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const raw = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n') | |
let line | |
while (line = raw.shift()) { | |
console.log(line) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04 | |
fallocate -l ${SWAP_SIZE:-8G} /swapfile | |
chmod 600 /swapfile | |
swapon /swapfile | |
echo '/swapfile none swap sw 0 0' >> /etc/fstab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt update | |
apt install -y vim lrzsz python3 python3-dev python3-pip python3-venv | |
curl -SL# git.io/tvimrc -o ~/.vimrc | |
curl -sSL git.io/jovial | bash | |
# curl -sSL git.io/sslaunch | bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport | |
airport -I | awk -F': ' '/ SSID/ {print $2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<style> | |
#root, | |
body, | |
html { | |
width: 100%; | |
height: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const os = require('os'); | |
const path = require('path'); | |
const exec = require('child_process').exec; | |
const axios = require('axios') | |
const dayjs = require('dayjs') | |
const getJobInfo = async job => { |
OlderNewer