Skip to content

Instantly share code, notes, and snippets.

View iBug's full-sized avatar
👓
Prolonging life span

iBug

👓
Prolonging life span
View GitHub Profile
@iBug
iBug / twrp-install.sh
Created May 2, 2022 17:23
Shell script to manually install TWRP to A/B partition devices
#!/system/bin/sh
e_info() {
echo -e "\033[36;1m[INFO]\033[0m $*" >&2
}
e_warning() {
echo -e "\033[33;1m[WARNING]\033[0m $*" >&2
}
@iBug
iBug / main.cpp
Last active March 22, 2024 20:14
Even more advanced 24 game solver. https://ibug.io/p/51
#include <algorithm>
#include <cctype>
#include <cmath>
#include <iostream>
#include <random>
#include <sstream>
#include <string>
#include <unordered_set>
#include <vector>
@iBug
iBug / wlt.vbs
Created June 7, 2022 04:05
USTC 网络通脚本 for Windows
Dim Http, Username, Password
Username = "username"
Password = "password"
Set Http = CreateObject("MSXML2.XMLHTTP.3.0")
Http.Open "GET", "http://wlt.ustc.edu.cn/cgi-bin/ip?cmd=set&type=0&exp=21600&name=" & Username & "&password=" & Password, False
Http.Send
MsgBox "Status: " & Http.Status, 65, "WLT"
@iBug
iBug / main.go
Created January 22, 2024 17:13
Visually test your NGINX rate limiting rules
package main
import (
"errors"
"flag"
"fmt"
"io"
"net/http"
"os"
"sync"
@iBug
iBug / README.md
Created March 4, 2020 16:30
摩尔庄园「米饭」自动签到脚本

使用方法:在 def main() 里面写上你的米米号和密码,找个服务器配置好定时任务(建议一天试 2 ~ 3 次),然后你就可以坐享各种活动的参与奖励了。

@iBug
iBug / Makefile
Last active April 12, 2023 13:25
Find Docker containers with autogenerated names
main: main.go names-generator.go
go build -o $@ $^
names-generator.go:
wget -O $@ https://github.com/moby/moby/raw/master/pkg/namesgenerator/names-generator.go
sed -i '/^package /c\package main' $@
@iBug
iBug / convert.rb
Created August 15, 2020 17:01
Shadowsocks JSON 格式订阅链接转换为 ss:// 剪贴板格式(Ruby)
require 'json'
require 'net/http'
require 'base64'
require 'cgi'
subscription_url = 'YOUR_URL_HERE'
config = JSON.parse Net::HTTP.get URI(subscription_url)
config['configs'].each do |item|
s = 'ss://'
@iBug
iBug / ControlMyMonitor.hta
Created January 30, 2023 16:34
Simple GUI for ControlMyMonitor
<!DOCTYPE html>
<html>
<head>
<title>ControlMyMonitor</title>
<meta http-equiv="X-UA-Compatible" content="IE=9">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
<hta:application id="ControlMyMonitor" maximizebutton="no" scroll="no" border="dialog" />
<script type="text/vbscript">
Dim Shell : Set Shell = CreateObject("WScript.Shell")
@iBug
iBug / makecookie.c
Last active November 23, 2022 10:31
CS:APP makecookie source code (reveng'd from binary)
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
int hash(const char *s) {
int ret = 0;
for (; *s; s++) {
ret = 103 * ret + *s;
}
return ret;
@iBug
iBug / run.sh
Created October 4, 2022 19:29
Gather JSON logs from Lambda functions from CloudWatch
#!/bin/sh
if [ -z "$1" ]; then
exit 1
fi
now=$(date +%s)
function_name="$1"
query_id=$(aws logs start-query \