Skip to content

Instantly share code, notes, and snippets.

View pwlin's full-sized avatar
🎧
Listening to Africa by Toto

pwlin pwlin

🎧
Listening to Africa by Toto
View GitHub Profile
@pwlin
pwlin / gist:8a0d01e6428b7a96e2eb
Last active May 6, 2024 10:50
Android : add cert to system store
https://code.google.com/p/android/issues/detail?id=32696#c5
If you have a certificate that is not
trusted by Android, when you add it, it goes in the personal cert store.
When you add a cert in this personal cert store, the system requires a
higher security level to unlock the device. But if you manage to add your
cert to the system store then you don't have this requirement. Obviously,
root is required to add a certificate to the system store, but it is quiet
easy.
@pwlin
pwlin / pm2-app.json
Created January 1, 2016 22:50
PM2 config example
{
"apps" : [{
"name" : "worker-app",
"script" : "worker.js",
"args" : ["--toto=heya coco", "-d", "1"],
"watch" : true,
"node_args" : "--harmony",
"merge_logs" : true,
"cwd" : "/this/is/a/path/to/start/script",
"env": {
@pwlin
pwlin / gist:f0cd4255c658760a0890
Created May 12, 2015 20:50
WScript.Shell automation
set WshShell = WScript.CreateObject("WScript.Shell")
sub shell(cmd)
dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run(cmd)
Set objShell = Nothing
end sub
shell """C:\Program Files\Internet Explorer\iexplore.exe"" https://accounts.google.com/ServiceLogin?service=mail&passive=true&continue=https://mail.google.com/mail/h/html"
@pwlin
pwlin / gist:3730c329d04055e70e1e
Created April 3, 2015 11:42
CouchDB install/remove Windows Service Instance
@ECHO OFF
:: add service
"%~dp0erts-5.10.3\erlsrv.exe" add "CouchDB" -workdir "%~dp0bin" -onfail restart_always -args "-sasl errlog_type error -s couch +A 4 +W w" -comment "CouchDB Windows Service Instance"
:: remove service
"%~dp0erts-5.10.3\erlsrv.exe" remove "CouchDB"
wget https://freevps.us/downloads/bench.sh -O – -o /dev/null | bash
# -*- shell-script -*-
#
# Ferm example script
#
# Firewall configuration for a web server.
table filter {
chain INPUT {
policy DROP;
@pwlin
pwlin / gist:ee784e2c7548a9c9cc21
Created February 28, 2015 16:23
Registering a Protocol with Gnome
gconftool-2 -t string -s /desktop/gnome/url-handlers/foo/command 'foo "%s"'
gconftool-2 -s /desktop/gnome/url-handlers/foo/needs_terminal false -t bool
gconftool-2 -s /desktop/gnome/url-handlers/foo/enabled true -t bool
@pwlin
pwlin / gist:8a84ae0c66c87d7ae053
Created December 7, 2014 17:41
nodewebkit node-main
process.on('uncaughtException', function(err) {
console.log('Uncaught node.js Error: ', err);
});
@pwlin
pwlin / gist:5e1c756623b5685b6f8e
Last active August 29, 2015 14:08
windows 7 boot recovery/ grub 4 dos
bcdboot c:\windows /s c:
================
timeout 5
default 0
title Windows 7
rootnoverify (hd0,1)
chainloader +1
mount - /opt/mnt/dir1 -t cifs -o UNC=//192.168.1.2/dir1,username=usert1,password=pass1