Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Hydra ox0spy

🎯
Focusing
Block or report user

Report or block ox0spy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ox0spy
ox0spy / README.md
Created Jan 11, 2020 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)
View README.md

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 https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

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

@ox0spy
ox0spy / mysql-load-data-local-infile.md
Last active Dec 11, 2019
[MySQL] load data local infile
View mysql-load-data-local-infile.md

错误信息

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

解决

修改 MySQL 配置文件

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

@ox0spy
ox0spy / disable.sh
Created Nov 22, 2019 — forked from pwnsdx/disable.sh
Disable bunch of #$!@ in Catalina
View disable.sh
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
@ox0spy
ox0spy / migrate-markdown-link-from-bitbucket-to-github.py
Created Nov 2, 2019
修复从 bitbucket 导入到 github wiki 中的 markdown link
View migrate-markdown-link-from-bitbucket-to-github.py
View java-reverse-engineering.md

Java 逆向工程

Java反编译

注:反编译后的 java 代码只能阅读来查看代码逻辑,不能保障能再通过 javac 编译会 class

View sentry-disk-cleanup.md

释放 Sentry 部署机器的磁盘空间,准确的说应该是释放 PostgreSQL 服务的磁盘空间。(安装Sentry时选用PostgreSQL作为数据库)

删除 issue

如果某个接口错误,有可能频繁的产生大量的 issue,删除这些误报的 issue。

< 10000 可以手动 在Web页面 删除,更多的可以命令行调用 curl 删除 /api/0/organizations/sentry/issues/?query=is%3Aunresolved&project={project-id},具体命令可以从 Chrome DevTool 中拷贝。

只保留指定天数的 issue

View Docker-Tips.md

设置 docker container 时区

我觉得将 host 的 /etc/timezone、/etc/localtime 挂载到 docker container 是不好的,应该为 docker container 单独设置 timezone

下面是 Ubuntu 系统的设置,其它系统类似只是安装包的命令不同。

ENV TZ "Etc/UTC"
RUN echo $TZ > /etc/timezone && \
apt-get -y update && \
apt-get install -y tzdata && \
@ox0spy
ox0spy / bash-script-tips.md
Last active May 23, 2019
Bash script tips
View bash-script-tips.md
@ox0spy
ox0spy / mac-enable-nfs-server.md
Created May 15, 2019
Mac OSX enable NFS Server
View mac-enable-nfs-server.md

创建 nfs 目录

$ mkdir /data/nfs-data

配置 nfs

$ cat /etc/exports
/data/nfs-data -maproot=root -alldirs -rw

启动 nfs

You can’t perform that action at this time.