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 / 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 / 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 / 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 \
@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.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 / main.go
Last active May 23, 2022 05:59
Advanced 24 game solver
package main
import (
"flag"
"fmt"
"math"
"math/rand"
"sort"
"strconv"
"strings"
@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 / cpu-temp.py
Last active May 2, 2022 17:23
CPU Temperature Monitor
#!/usr/bin/python3
import sys
import time
import curses
class Config:
temp_source = "/sys/class/thermal/thermal_zone0/temp"
freq_source = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"