Skip to content

Instantly share code, notes, and snippets.

View yifanlu's full-sized avatar

Yifan Lu yifanlu

View GitHub Profile
<!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.yifanlu.sshtunnel</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/ssh</string>
<string>-T</string>
<string>-D</string>
public class Stopwatch {
public static void main(String[] args){
long startingTime = System.currentTimeMillis();
long currentTime;
long deltaTime = 0;
long stopTime = 60 * 1000; // 60 seconds in miliseconds
while((currentTime = System.currentTimeMillis()) <= startingTime + stopTime){
deltaTime = currentTime - startingTime;
System.out.printf("%d miliseconds passed\n", deltaTime);
}
#!/usr/bin/env python
import codecs
import os
import re
import sys
from datetime import datetime, timedelta, tzinfo
from glob import glob
from urllib import urlretrieve
from urlparse import urljoin, urlparse
@yifanlu
yifanlu / promote.c
Created August 27, 2016 20:34
ScePromoter usage
#include "promoterutil.h"
int promote(const char *path)
{
int res;
int ret;
int state;
ret = sceSysmoduleLoadModuleInternal(SCE_SYSMODULE_PROMOTER_UTIL);
printf("sceSysmoduleLoadModuleInternal: 0x%x\n", ret);
@yifanlu
yifanlu / taihen-b3-release.md
Created November 8, 2016 05:13
taiHENkaku B3 Release Notes

大変革 Beta 3

The updated toolchain with support for plugin creation is almost done. Prebuilts for OSX/Windows/Linux should be up sometime this week, although I am not the main party in that project so don't hold me to this. In the meantime, those who are brave can try building the latest toolchain themselves from vitasdk/buildscripts. With the new toolchain, you can add the taiHEN files to your toolchain installation to use the taiHEN APIs.

If you are not interested in helping test the beta, we recommend that you stick with the old stable release at (https://henkaku.xyz/) instead. To update the beta, reboot and visit http://beta.henkaku.xyz/ from your Vita's browser. To remove the beta, delete molecularShell, reboot, and visit https://henkaku.xyz/ instead.

New Features

  • VitaShell 1.42 is updated such that HENkaku configuration works and package installation from safe homebrew works.
@yifanlu
yifanlu / taihenkaku-b2-release.md
Last active November 19, 2016 12:25
taiHENkaku B2 Release Notes

大変革 Beta 2

Sorry for the messy beta 1. I didn't want to break my promise of a 11/1 release so I had to cut many corners. Hopefully this should be a more stable beta, although there are still a lot more to do before it is production ready. Although it is still recommended only for developers, it is now ready for anyone to test and report issues. In filing your bug report, please be very specific in your setup (Vita/VitaTV, memory card?, what apps are used/installed, etc) and in triggering the bug (even if it is not possible to always reproduce it). Before filing any issues, make sure it is not listed below in the known issues section and read the other reported issues to make sure you are not submitting a duplicate ticket (submit a comment instead).

If you are not interested in helping test the beta, we recommend that you stick with the old stable release at (https://henkaku.xyz/) instead. To update the beta, reboot and visit http://beta.henkaku.xyz/ from your Vita's browser. To remove the

@yifanlu
yifanlu / gist:5d16e134332622d26944
Created June 9, 2015 19:02
USA 9.2.0-20U O3DS -> JAP 9.2.0-20U N3DS (region swapped) system transfer
This documentation is mostly for archival purposes. I will not provide support or clarifications because the process is complicated and others issues not noted in the steps will occur. The way I patched the requests/responses is set up Charles Proxy to forward all ECS/NUS/IVS requests (at ip:8888) to Nintendo's server (ClCert needed). Then I put a breakpoint on all requests/responses. Modifying requests will change what Nintendo sees. Modifying responses will change what the 3DS sees. Both are needed.
Prerequisites:
1) Both O3DS and N3DS are on 9.2.0-20U
2) N3DS has been formatted after region swap and no NNID linked
O3DS code.bin patches needed: https://gist.github.com/yifanlu/b59b6d83d11bdb244cbd
System Transfer:
@yifanlu
yifanlu / taihen-b4-release.md
Created November 14, 2016 01:21
taiHENkaku B4 Release Notes

大変革 Beta 4

Developers: Please make sure you are using the latest toolchain from (https://github.com/frangarcj/buildscripts/releases). We made a lot of changes so using an older toolchain to add taiHEN hooks will result in crashes! Also make sure to update your taiHEN development libraries to the latest version.

If you are not interested in helping test the beta, we recommend that you stick with the old stable release at (https://henkaku.xyz/) instead. To update the beta, reboot and visit http://beta.henkaku.xyz/ from your Vita's browser. To remove the beta, delete molecularShell, reboot, and visit https://henkaku.xyz/ instead.

New Features

  • Fixed many bugs that causes instability, memory leaks, and crashes with hooks. Full details here.
  • Fixed dynarec issue resulting in many emulators including PCSX and mGBA not working.
@yifanlu
yifanlu / taihen-b5-release.md
Created November 26, 2016 22:59
taiHENkaku B5 Release Notes

大変革 Beta 5

Developers: Please make sure you are using the latest toolchain from (https://github.com/frangarcj/buildscripts/releases) or (https://lolhax.org/bamboo/). We made a lot of changes so using an older toolchain to add taiHEN hooks will result in crashes! Also make sure to update your taiHEN development libraries to the latest version.

If you are not interested in helping test the beta, we recommend that you stick with the old stable release at (https://henkaku.xyz/) instead. To update the beta, reboot and visit http://beta.henkaku.xyz/ from your Vita's browser. To remove the beta, delete molecularShell, reboot, and visit https://henkaku.xyz/ instead.

New Features

  • Rewrote the kernel payload and installer. Installer should be more stable now.
  • Add ability to update HENkaku config and taiHEN config.txt without needing a reboot. VitaShell needs to be updated to use this feature though.
@yifanlu
yifanlu / taihen-b8-release.md
Last active December 24, 2016 06:08
taiHENkaku B8 Release Notes

大変革 Beta 8

"When is the actual release?!? Why is this still beta?" Good question. Here's a secret: I have been constantly pushing small updates every couple of days without changing the beta number. Think of these release notes as status reports rather then, well, release notes. The idea of beta.henkaku.xyz is that since molecule has very limited resources, we cannot test all the different configurations, homebrews, and use cases. However, when I push an update to the beta site, I know that if something breaks I would get notified through Twitter, reddit, IRC, etc (although the perferred way of reporting bugs has always been the issue tracker). So if you don't notice any problems, that's good! It means I was able to fix any major issues before you woke up. These problems are usually very surface level (a misconfiguration/typo on my part) and the underlying code has a lot less bugs than HENkaku R6. So do I recommend everyone use beta.henkaku.xyz? Yes.