Skip to content

Instantly share code, notes, and snippets.


Hydra ox0spy

View GitHub Profile

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




if [[ $UID -ne 0 ]]; then
    echo "please run this script with root"

use vi mode editing in psql


set editing-mode vi
ox0spy /
Created Apr 8, 2020 — forked from denji/
NGINX tuning for best performance

Moved to git repository:

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.


Fix rpmdb: Thread died in Berkeley DB library

error message

rpmdb: Thread/process 277623/140429100390144 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.verbose.cli.yumcompletets:Yum Error: Error: rpmdb open failed


Q: 通过 docker-compose 运行的 graylog 及 elasticsearch,如何进入 elasticsearch?


sudo docker-compose exec elasticsearch bash

ox0spy /
Created Jan 11, 2020 — forked from tombigel/
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in's Wayback Machine

Mac OS X

To check the current limits on your Mac OS X system, run:

ox0spy /
Last active Dec 11, 2019
[MySQL] load data local infile


ERROR 1148: The used command is not allowed with this MySQL version


修改 MySQL 配置文件

my.cnf 中的 [client][mysqld] 中增加 loose-local-infile=1

You can’t perform that action at this time.