Skip to content

Instantly share code, notes, and snippets.


Hydra ox0spy

View GitHub Profile

If you created your key pair using AWS, you can use the OpenSSL tools to generate a fingerprint as follows:

$ openssl pkcs8 -in path_to_private_key -inform PEM -outform DER -topk8 -nocrypt | openssl sha1 -c

If you created a key pair using a third-party tool and uploaded the public key to AWS, you can use the OpenSSL tools to generate the fingerprint as follows:

$ openssl rsa -in path_to_private_key -pubout -outform DER | openssl md5 -c
ox0spy /
Last active Dec 18, 2020
Arch Linux Tips


install wpa_supplicant and dhcpcd

sudo pacman -S wpa_supplicant dhcpcd

get wireless network interface

ox0spy / main.go
Last active Dec 8, 2020
remove duplicate files
View main.go
// remove duplicate files
// if file content with same sha256, they are same
// usage: go run remove-duplicate-files.go <your-directory> [your-dir1 you-dir2 ...]
// run with `-dryrun` if you just want to find the duplicate files
package main
import (

NGINX to reverse proxy websockets

主要看 location 中的,注意:

  • proxy_read_timeout,默认是 60s,如果不设置长一点,会看到 websocket server 收到大量请求;然后从浏览器看,前端每分钟都在创建新的 websocket 连接;详见:
  • 如果用 uvicorn,nginx 不能开启 keepalive ,否则 websocket server 会报 WARNING: Invalid HTTP request received.
map $http_upgrade $connection_upgrade {
    default upgrade;

extend virtualbox disk

shutdown guest OS

show disk info

VBoxManage showhdinfo ~/VirtualBox\ VMs/Ubuntu/Ubuntu.vdi
ox0spy / apt-fast
Created Nov 18, 2020 — forked from voyeg3r/apt-fast
apt-fast with aria2c
View apt-fast
# Last Change: 2011/10/06
# apt-fast v0.02 by Matt Parnell, this thing is fully open-source
# if you do anything cool with it, let me know so I can publish or host it for you
# contact me at
# Special thanks to Travis/travisn000 from the PCLinux Forums for making improvements that allow
# for more complex apt-get commands. See the thread:,66385.0.html
# adicionar suporte aos metalinks no aria2:
# veja também apt-metalink:

crop image

import os

from PIL import Image

def crop_image(filename, w_h_ratio=0.75):
    img =

journal disk usage

check journal disk usage

journalctl --disk-usage

reduce journal size