Skip to content

Instantly share code, notes, and snippets.

@codexss
codexss / pixivDylib.xm
Created June 26, 2019 14:13
hook pixiv ad-banner
#import <UIKit/UIViewController.h>
@interface _TtC5pixiv26AdContainingViewController : UIViewController
@property(nonatomic) __weak UIView *adContainerView;
@end
%hook _TtC5pixiv26AdContainingViewController
- (void)viewDidLayoutSubviews{
[self.adContainerView removeFromSuperview];
}
@codexss
codexss / view-source.js
Created May 20, 2018 09:52
for Safari on iOS
javascript:(function()%7Bvar%20a=window.open('about:blank').document;a.write('%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3Ctitle%3ESource%20of%20'+location.href+'%3C/title%3E%3Cmeta%20name=%22viewport%22%20content=%22width=device-width%22%20/%3E%3C/head%3E%3Cbody%3E%3C/body%3E%3C/html%3E');a.close();var%20b=a.body.appendChild(a.createElement('pre'));b.style.overflow='auto';b.style.whiteSpace='pre-wrap';b.style.wordWrap="break-word";b.appendChild(a.createTextNode(document.documentElement.innerHTML))%7D)();
adb shell appops set com.tencent.mm OP_READ_PHONE_STATE ignore
adb shell appops set com.tencent.mm COARSE_LOCATION ignore
adb shell appops set com.tencent.mm FINE_LOCATION ignore
adb shell appops set com.tencent.mm RUN_IN_BACKGROUND ignore
@codexss
codexss / iptables.txt
Created November 2, 2017 03:16
PORT FORWARD
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8388
iptables -t nat -A PREROUTING -p udp -m udp --dport 80 -j REDIRECT --to-ports 8388
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8388
iptables -t nat -A PREROUTING -p udp -m udp --dport 443 -j REDIRECT --to-ports 8388
@codexss
codexss / Caddyfile
Created October 18, 2017 13:01 — forked from bendo01/Caddyfile
Caddy Web Server As Service on Centos 7
#cd /etc/caddy/Caddyfile
example.com {
root /usr/share/nginx/html
gzip
log /var/log/caddy/access.log
#fastcgi / unix:/var/run/php-fpm/php-fpm.sock php # Fast CGI php interpreter
#fastcgi / fastcgi / 127.0.0.1:9000 php # Fast CGI php interpreter
#using with laravel
fastcgi / unix:/var/run/php-fpm/php-fpm.sock php {
index index.php

backend

curl -fsSL get.docker.com -o get-docker.sh 
sh get-docker.sh  
docker run -d -p 127.0.0.1:3001:20080  --restart=always lentin/elgoog 

frontend

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.3/linux-image-4.13.3-041303-generic_4.13.3-041303.201709200606_amd64.deb && dpkg -i linux-image-*.deb && rm linux-image-*.deb
sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
echo "net.core.default_qdisc = fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control = bbr" >> /etc/sysctl.conf
sysctl -p
echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
apt update
@codexss
codexss / bash.sh
Created September 22, 2017 04:56
Build H@H on Debian8
apt update && apt install default-jdk unzip -y
adduser hath
login hath
wget https://repo.e-hentai.org/hath/HentaiAtHome_1.4.1.zip
unzip HentaiAtHome_1.4.1.zip -d hath/
exit
wget https://github.com/Yukariin/hath-scripts/raw/master/hentaiathome -O /etc/init.d/hentaiathome
wget https://github.com/Yukariin/hath-scripts/blob/master/systemd.service -O /etc/systemd/system/hentaiathome.service
chmod 755 /etc/init.d/hentaiathome
/etc/init.d/hentaiathome start
#smartproxy config file
#字符’#’用于注释
#参数每行一条,参数名称和值之间用空格分隔,使用”name value1 value2 … valueN”格式。
#同一参数名称可以在多行出现,系统会将其值自动合并成一个数组。
#TAG:session_name
#设置VPN连接会话名称。默认值:无。非必须。
session_name smartproxy
#TAG:welcome_info
#设置VPN连接后的欢迎信息。默认值:无。非必须。
welcome_info Welcome to smartproxy!
#进入缓存目录
cd $OPENSHIFT_TMP_DIR
#下载需要的源码
wget http://nginx.org/download/nginx-1.11.4.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
wget https://www.openssl.org/source/openssl-1.1.0a.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
git clone https://github.com/cuber/ngx_http_google_filter_module
git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module