Skip to content

Instantly share code, notes, and snippets.

View isjerryxiao's full-sized avatar
⛑️
moving bricks

Jerry Xiao isjerryxiao

⛑️
moving bricks
View GitHub Profile
#!/usr/bin/env bash
#encoding=utf8
rootpath="/root"
openwrtpath=$rootpath"/files/openwrt/OpenWrt-SDK-15.05.1-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/"
cd $rootpath
date
function Updatemotd(){
apt update 2>&1 | sed -n '$p' > /etc/motd
RESULT=`certbot renew | grep "No renewals were attempted."`
if [ "$RESULT" == "No renewals were attempted." ]
@isjerryxiao
isjerryxiao / rateat
Created December 20, 2016 09:38 — forked from reee/rateat
Redirect All Traffic Except Asia Traffic
#!/bin/sh
#create a new chain named SHADOWSOCKS
iptables -t nat -N SHADOWSOCKS
# Ignore your shadowsocks server's addresses
# It's very IMPORTANT, just be careful.
iptables -t nat -A SHADOWSOCKS -d 163.44.132.189/32 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
#!/usr/bin/env bash
#xrandr
#cvt 1366 768
sudo xrandr --newmode "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
xrandr --addmode VGA1 "1368x768_60.00"
xrandr --output VGA1 --mode "1368x768_60.00" --rate 60
sudo xrandr --newmode "1368x768_50.00" 69.25 1368 1424 1560 1752 768 771 781 793 -hsync +vsync
@isjerryxiao
isjerryxiao / dnspod.sh
Last active February 3, 2017 08:52
重要:已经放弃更新,请使用 https://github.com/SYHGroup/easy_shell/blob/master/ddns/dnspod-ddns.sh ---------------------dnspod.cn服务器ip更新脚本(使用dnspod ddns api,可更改ttl),需要bash,curl,grep,sed,不建议在openwrt使用。使用时修改以下信息:TokenID、Token、ddnspod your domain.com.----------rm dnspod.sh && wget --no-cache https://gist.githubusercontent.com/Jerry981028/215df9be2b513962c4aedf7d…
#!/usr/bin/env bash
#encoding=utf8
function logecho(){
#若不需要记录日志注销下行。
echo "$*" >> ${logfile}
echo "$*"
}
function ddnspod(){
# Usage: ddnspod [subdomain] [domain]
if [ $# == 2 ]
@isjerryxiao
isjerryxiao / exponential-backoff-while.sh
Last active July 9, 2017 10:09
Exponential backoff
#!/usr/bin/env bash
test_if_network_is_reachable(){
false
}
i=2
max=86400
while ((i<=${max})) ; do
test_if_network_is_reachable && break
sleep ${i}
((i=${i}*2))
@isjerryxiao
isjerryxiao / player.py
Last active September 28, 2017 13:40
Play a series of converted images on a single max7219 8x8 led matrix. https://github.com/rm-hull/luma.led_matrix
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, sys, time, threading
from luma.core.interface.serial import spi, noop
from luma.led_matrix.device import max7219
from PIL import Image
interval=1/30
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<!-- Old <project name="TheScarastic/proprietary_vendor_xiaomi" path="vendor/xiaomi" remote="github" revision="lineage-15.1"/> -->
<project name="HighwayStar/proprietary_vendor_xiaomi_mido" path="vendor/xiaomi" remote="github" revision="lineage-15.1"/>
<project name="HighwayStar/android_device_xiaomi_mido" path="device/xiaomi/mido" remote="github" revision="lineage-15.1"/>
<project name="TheScarastic/android_kernel_xiaomi_msm8953" path="kernel/xiaomi/msm8953" remote="github" revision="lineage-15.1-treble"/>
<!-- Dulplicate <project name="LineageOS/android_device_qcom_common" path="device/qcom/common" remote="github"/> -->
</manifest>
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/xiaomi/mido" name="device_xiaomi_mido" remote="pixel-devices" revision="oreo-mr1" />
<project path="vendor/xiaomi" name="HighwayStar/proprietary_vendor_xiaomi_mido" remote="github" revision="lineage-15.1" />
<project path="kernel/xiaomi/msm8953" name="Android-Jerry/android_kernel_xiaomi_msm8953-pe1" remote="github" revision="oreo" />
<remove-project name="LineageOS/android_hardware_qcom_audio" />
<project path="hardware/qcom/audio-caf/apq8084" name="LineageOS/android_hardware_qcom_audio" remote="github" revision="staging/lineage-15.1-caf-8084" />
<project path="hardware/qcom/audio-caf/msm8916" name="LineageOS/android_hardware_qcom_audio" remote="github" revision="staging/lineage-15.1-caf-8916" />
@isjerryxiao
isjerryxiao / readme.md
Last active July 19, 2018 05:08
Magisk for a few Xiaomi devices(treble)

Keybase proof

I hereby claim:

  • I am isjerryxiao on github.
  • I am jerryxiao (https://keybase.io/jerryxiao) on keybase.
  • I have a public key whose fingerprint is 1862 4220 4A2E C704 38E9 CE3B 9D9C E436 50FF 2BAA

To claim this, I am signing this object: