Skip to content

Instantly share code, notes, and snippets.

View oasisfeng's full-sized avatar
🏠
Working from home

oasisfeng oasisfeng

🏠
Working from home
View GitHub Profile
@oasisfeng
oasisfeng / verify_google_ips.sh
Created April 28, 2023 16:29
Shell script to verify connectable Google IPs
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 <IP>[/subnet]"
exit 1
fi
for ip in $(nmap -sL $1 | awk '/Nmap scan report/{print $NF}'); do {
ip=$(echo $ip | tr -d '()')
output=$(curl --connect-to :443:$ip:443 --connect-timeout 5 --verbose --head https://www.google.com.hk 2>&1)
@oasisfeng
oasisfeng / increase-audio-playback.user.js
Last active September 7, 2021 16:42 — forked from SeanMcP/increase-audio-playback.user.js
🎧 Increase the playback speed of audio elements around the web
// ==UserScript==
// @name Increase audio playback
// @namespace https://seanmcp.com
// @version 0.1
// @description Increase the playback speed of audio elements around the web
// @author Sean McPherson, forked by Oasis Feng
// @match *://*/*
// @require https://cdn.jsdelivr.net/gh/CoeJoder/waitForKeyElements.js@v1.2/waitForKeyElements.js
// @grant GM_addStyle
// ==/UserScript==
// ==UserScript==
// @name Baidu Netdisk Mobile Tweaks
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Some tweaks to Baidu Netdisk Mobile Web.
// @author Oasis Feng
// @match https://pan.baidu.com/disk/home*
// @grant none
// ==/UserScript==
#!Space::CenterActiveWindow() ; Win+Alt+Space
CenterActiveWindow()
{
winHandle := WinExist("A")
VarSetCapacity(monitorInfo, 40)
NumPut(40, monitorInfo)
monitorHandle := DllCall("MonitorFromWindow", "uint", winHandle, "uint", 0x2)
@oasisfeng
oasisfeng / AidlService.java
Created May 26, 2016 13:46
Service framework for friendly and efficient AIDL service binding in Android app.
package com.oasisfeng.android.service;
import android.annotation.SuppressLint;
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.support.annotation.Nullable;
import android.util.Log;
@oasisfeng
oasisfeng / Hack.java
Last active April 6, 2023 04:54
Reflection helper for hacking non-public APIs.
package com.oasisfeng.hack;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import java.io.IOException;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Constructor;
@oasisfeng
oasisfeng / master-key-patch.java
Last active December 19, 2015 17:39
Xposed module to patch Master-Key security vulnerability.
package com.oasisfeng.security.masterkeypatch;
import java.lang.reflect.Field;
import java.util.LinkedHashMap;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import android.util.Log;
import de.robv.android.xposed.IXposedHookLoadPackage;