Some notes and tools for reverse engineering / deobfuscating / unminifying obfuscated web app code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Got a bunch of .ckpt files to convert? | |
| # Here's a handy script to take care of all that for you! | |
| # Original .ckpt files are not touched! | |
| # Make sure you have enough disk space! You are going to DOUBLE the size of your models folder! | |
| # | |
| # First, run: | |
| # pip install torch torchsde==0.2.5 safetensors==0.2.5 | |
| # | |
| # Place this file in the **SAME DIRECTORY** as all of your .ckpt files, open a command prompt for that folder, and run: | |
| # python convert_to_safe.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Original Source Code | |
| var video = document.querySelector("div.video-player video"); | |
| if (video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === "function") { | |
| video.webkitSetPresentationMode(video.webkitPresentationMode === "picture-in-picture" ? "inline" : "picture-in-picture"); | |
| } | |
| // paste below line to as your bookmark in safari | |
| // javascript:(function()%7Bvar%20video%20%3D%20document.querySelector(%22div.video-player%20video%22)%3Bif%20(video.webkitSupportsPresentationMode%20%26%26%20typeof%20video.webkitSetPresentationMode%20%3D%3D%3D%20%22function%22)%20%7Bvideo.webkitSetPresentationMode(video.webkitPresentationMode%20%3D%3D%3D%20%22picture-in-picture%22%20%3F%20%22inline%22%20%3A%20%22picture-in-picture%22)%3B%7D%7D)() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var SecTrustEvaluate_handle = | |
| Module.findExportByName('Security', 'SecTrustEvaluate'); | |
| var SecTrustEvaluateWithError_handle = | |
| Module.findExportByName('Security', 'SecTrustEvaluateWithError'); | |
| var SSL_CTX_set_custom_verify_handle = | |
| Module.findExportByName('libboringssl.dylib', 'SSL_CTX_set_custom_verify'); | |
| var SSL_get_psk_identity_handle = | |
| Module.findExportByName('libboringssl.dylib', 'SSL_get_psk_identity'); | |
| var boringssl_context_set_verify_mode_handle = Module.findExportByName( | |
| 'libboringssl.dylib', 'boringssl_context_set_verify_mode'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def top_k_top_p_filtering(logits, top_k=0, top_p=0.0, filter_value=-float('Inf')): | |
| """ Filter a distribution of logits using top-k and/or nucleus (top-p) filtering | |
| Args: | |
| logits: logits distribution shape (vocabulary size) | |
| top_k >0: keep only top k tokens with highest probability (top-k filtering). | |
| top_p >0.0: keep the top tokens with cumulative probability >= top_p (nucleus filtering). | |
| Nucleus filtering is described in Holtzman et al. (http://arxiv.org/abs/1904.09751) | |
| """ | |
| assert logits.dim() == 1 # batch size 1 for now - could be updated for more but the code would be less clear | |
| top_k = min(top_k, logits.size(-1)) # Safety check |
- Base instance to launch
- https://console.aws.amazon.com/ec2/home?region=us-west-2#launchAmi=ami-e1b93481
- p2.xlarge
- 32GB EBS mount
- Configure security group to allow access to all for ports 22 and 8888
- References
ssh -i ~/.ssh/udacity-carnd.pem [email protected]
In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
Wand==0.3.7, Python 3.4.3, OSX EI Capitan 10.11
when run from wand.image import Image it throw errors:
ImportError: MagickWand shared library not found. You probably had not installed ImageMagick library. Try to install: brew install freetype imagemagick
ok, first I try this:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
NewerOlder