Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/**
* 1 req per 30 ms.
*/
const express = require('express')
const app = express()
const resArray = new Array();
function rec(){
const firstInQueue = resArray.shift();
if (firstInQueue)
@adsurbum
adsurbum / gist:2671c3d135bcc20c471f
Created February 19, 2016 21:24
zsh git aliases
alias gl="echo '';git --no-pager log -2 --pretty=format:'%C(black)%ar %C(reset)%an %C(black)%h %n%C(yellow)%s%n' -3"
g() { git add --all; git commit -m "$*" }
gc() { git checkout "$*" }
gs() { git status; }
gll() { git pull; }
@adsurbum
adsurbum / "gson" injection
Created August 5, 2015 15:15
json injection with Gson
class User{
public String name;
private Boolean havePermissions;
};
public static void main(String[] args) {
String input = "{name:hacker, havePermissions:true}";
Gson gson = new Gson();
User user = gson.fromJson(JsonSanitizer.sanitize(input), User.class);
@adsurbum
adsurbum / ssh tunnel (proxy)
Last active January 22, 2017 12:09
ssh tunnel (proxy)
ssh -fN -L \*:27017:localhost:27017 remote
Forward from port 80 to 8081 (every request to port 80 will be transfered to 8081)
sudo ssh -L 80:localhost:8081 adsurbum@localhost
#!/usr/bin/perl -s
#
# solo v1.5
# Prevents multiple cron instances from running simultaneously.
#
# Copyright 2007-2010 Timothy Kay
# http://timkay.com/solo/
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@adsurbum
adsurbum / gist:7ee37b74f9d561b341c0
Created November 22, 2014 13:05
speed up pod install
pod --verbose install --no-repo-update
@adsurbum
adsurbum / gist:53bb35a8b2789ea90841
Created November 16, 2014 19:52
root on amazon ubuntu
sudo su
cp .ssh/authorized_key ~/.ssh/
@adsurbum
adsurbum / ios-push-certificates
Last active August 29, 2015 14:07
ios push notification certificates generation
export p12 from keychain access
openssl pkcs12 -clcerts -nokeys -out production-cert.pem -in production.p12
openssl pkcs12 -nocerts -out production-key.pem -in production.p12
openssl rsa -in production-key.pem -out production-key.pem
@adsurbum
adsurbum / ncdu
Created October 2, 2014 21:28
ncdu
ncdu