Skip to content

Instantly share code, notes, and snippets.

View itspig's full-sized avatar
😼
Focusing

Nick Zhu itspig

😼
Focusing
View GitHub Profile
@Hendrik44
Hendrik44 / activate_touchid_for_sudo.sh
Created December 7, 2018 09:37
Activate Touchid on OSX to use for sudo in terminal
set -e
if grep -xq "pam_tid.so" /etc/pam.d/sudo; then
echo "Option to use touchid for sudo already installed :)"
else
echo "Configure to use Touchid for sudo ..."
sudo chmod 644 /etc/pam.d/sudo # change permission to have write access
sudo cp /etc/pam.d/sudo /etc/pam.d/sudo.org # make a copy of original file
echo 'auth sufficient pam_tid.so' | cat - /etc/pam.d/sudo > sudo && mv sudo /etc/pam.d/sudo # append file
sudo chmod 444 /etc/pam.d/sudo # change permission back
echo "Touchid for sudo successfully configured. A copy of the original file you will find here: /etc/pam.d/sudo.org"
@ValdikSS
ValdikSS / huawei-e5885-backup.md
Last active October 27, 2023 18:32
How to backup current firmware on Huawei E5885

Huawei E5885 current firmware backup manual.

  1. Download modified usbloader, which will copy proper busybox into /system/busybox and enable telnetd on your device (will add additional line into /system/autorun.sh). Use it only on E5885, not on other device!
  2. Load it using balong-usbdload. Refer to this disassembling manual.
  3. After loading, wait about one minute, disconnect device from the computer and power off the device holding power button for ~15 seconds.
  4. Insert MicroSD card to the device and power it on.
  5. telnet 192.168.8.1 2323
/system/busybox sh
@gjedeer
gjedeer / hosts
Created September 8, 2017 13:36
MiBox 3 pro call home block list
127.0.0.1 111.94.62.42.in-addr.arpa
127.0.0.1 12.200.206.111.in-addr.arpa
127.0.0.1 171.176.77.52.in-addr.arpa
127.0.0.1 196.170.220.52.in-addr.arpa
127.0.0.1 48.183.251.54.in-addr.arpa
127.0.0.1 57.94.62.42.in-addr.arpa
127.0.0.1 78.204.243.124.in-addr.arpa
127.0.0.1 8.33.134.120.in-addr.arpa
127.0.0.1 a.netcheck.gallery.pandora.xiaomi.com
127.0.0.1 api.ad.xiaomi.com
@cosysn
cosysn / readfree.py
Created July 13, 2017 06:09
能够自动在readfree网站上签到的脚本
import requests
import logging
url='http://readfree.me/accounts/checkin'
cookie_str='' # 需要登录到readfree上获取当时的cookie值,然后直接使用该cookie值进行登录签到
logging.basicConfig(level=logging.INFO,
filename='/var/log/readfree_auto_sig.log',
filemode='a',
format='%(asctime)s - [line:%(lineno)d] - %(levelname)s: %(message)s')
@mariotaku
mariotaku / README.md
Last active December 18, 2020 05:01
Followers Cleaner Script

Usage

  1. Execute pip3 install -r requirements.txt to install dependencies
  2. Execute followers_clear.py and follow instructions.

Notes

Consumer keys can be found here. Use these keys instead of applying yourself can get rid of rate limit.

@alswl
alswl / hosts
Last active November 12, 2023 11:17
(deprecated, I bought xiaomi VIP)hosts for OpenWRT, for disable AD in xiaomi TV
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 ad1.xiaomi.com
127.0.0.1 adv.sec.miui.com
127.0.0.1 test.ad.xiaomi.com
127.0.0.1 new.api.ad.xiaomi.com
@mrkpatchaa
mrkpatchaa / README.md
Last active June 6, 2024 21:03
Bulk delete github repos

Use this trick to bulk delete your old repos or old forks

(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)

  1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories

  2. Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.

  3. Save that list to some path

  4. The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.

@jason5ng32
jason5ng32 / surge.conf
Last active April 7, 2024 13:04
Surge Configs ( for 2.x )
[General]
loglevel = notify
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29,223.5.5.5,114.114.115.115
# external-controller-access = PASSWORD@0.0.0.0:6155
# ipv6 = true
// REMEMBER TO CHANGE THE external-controller-access' PASSWORD