Skip to content

Instantly share code, notes, and snippets.

@janglapuk
janglapuk / gist_io_example.md
Created April 8, 2014 08:21
Just an example for gist.io

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

If you peek at it with a web inspector, you'll see that it is a second-level heading. You can use first level headings, but they'll look just like the second level ones, and the gods of the HTML5 outlining algorithm will frown upon you.

@janglapuk
janglapuk / nginx-pagespeed-tweaks
Last active March 30, 2018 22:47
A note to tweaks page speed with Nginx
- Rebuild Nginx with PageSpeed module
https://www.digitalocean.com/community/tutorials/how-to-add-ngx_pagespeed-to-nginx-on-debian-8
- Enable GZIP
#---------------------------------------------------------------#
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
@janglapuk
janglapuk / adfly-skipper.user.js
Last active July 2, 2021 14:58
GreaseMonkey/TamperMonkey script for automating adf.ly 'Skip' button
// ==UserScript==
// @name adf.ly Auto Skip Ad
// @namespace http://github.com/janglapuk
// @version 0.5
// @description Let you ignore the bunch of ads :] (simple and optimized rev)
// @author janglapuk
// @match http://adf.ly/*
// @require http://code.jquery.com/jquery-3.2.1.slim.min.js
// @require https://gist.githubusercontent.com/raw/2625891/waitForKeyElements.js
// @updateURL https://gist.github.com/janglapuk/790470741a39a0f2301b27d234e6a9cc/raw/adfly-skipper.user.js
@janglapuk
janglapuk / tcp_serial_redirect.py
Created September 21, 2016 06:23
Taken from https://github.com/pyserial/pyserial/tree/master/examples with a little modification to fit with OS X environment
#!/usr/bin/env python
#
# Redirect data from a TCP/IP connection to a serial port and vice versa.
#
# (C) 2002-2016 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import sys
import socket
@janglapuk
janglapuk / jbme.html
Created December 19, 2016 06:32
@qwertyoruiopz's remote jailbreak for iOS 9.3.3 64-bit
<!--
This is licensed under the Anyone But Stefan Esser license.
---
PLZ NO RCE.
sorry 4 indentation but i was using nano lmao
@janglapuk
janglapuk / ipcam-clock-set.pl
Created December 26, 2016 09:59 — forked from 667bdrm/ipcam-clock-set.pl
Simple clock synchronization for some chinese DVRs supporting CMS with json-like protocol. Includes some other API commands.
#!/usr/bin/perl
#
# Simple clock synchronization for some chinese HiSilicon based DVRs supporting CMS (Sofia software) with json-like protocol. Tested with:
#
# HJCCTV HJ-H4808BW (XiongMai, Hi3520, MBD6304T)
# http://www.aliexpress.com/item/Hybird-NVR-8chs-H-264DVR-8chs-onvif-2-3-Economical-DVR-8ch-Video-4-AUDIO-AND/1918734952.html
#
#
@janglapuk
janglapuk / keybase.md
Created August 9, 2017 13:53
Just my Keybase proof

Keybase proof

I hereby claim:

  • I am janglapuk on github.
  • I am janglapuk (https://keybase.io/janglapuk) on keybase.
  • I have a public key ASDItTCf9BTuHgIpHT2ay4mBdzQ6P5lXM9U8Glwsp2l7QQo

To claim this, I am signing this object:

var MD5 = function(string) {
function RotateLeft(lValue, iShiftBits) {
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
}
function AddUnsigned(lX, lY) {
var lX4, lY4, lX8, lY8, lResult;
lX8 = (lX & 0x80000000);
lY8 = (lY & 0x80000000);
lX4 = (lX & 0x40000000);
@janglapuk
janglapuk / autoreload.py
Created September 18, 2018 03:44
Simple Python autoreload script
import os, sys, subprocess, signal, binascii, time
"""
Usage:
$ python autoreload.py app.py
"""
last_crc32 = 0
terminate = False
@janglapuk
janglapuk / vzdump-gdrive-backup.sh
Last active January 9, 2019 07:09
vzdump backup script to Google Drive
#!/bin/bash
if [ $# -ne 1 ];
then
echo "Usage: $0 <VMID>"
exit 1
fi
BACKUPDIR="/var/lib/vz/dump"