Skip to content

Instantly share code, notes, and snippets.

pwlin pwlin

Block or report user

Report or block pwlin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:ea7258ebaeea79d7f5b8d7350c73934f
iptables -t nat -A PREROUTING -p tcp --dport <origin-port-WAN> -j REDIRECT --to-port <destination-port-LAN>
service iptables save
service iptables restart
iptables -t nat --line-numbers -L
iptables -t nat -D PREROUTING <line-number>
@pwlin
pwlin / VirtualBox numlock weirdness
Last active May 17, 2017
virtualbox keyboard numlock problem
View VirtualBox numlock weirdness
https://martinvanbeurden.nl/blog/virtualbox-numlock-weirdness/
VBoxManage setextradata "<machine-name>" GUI/HidLedsSync "0"
for /f "tokens=*" %G in ('dir /b /a:d ".\*"') do (VBoxManage setextradata "%G" GUI/HidLedsSync "0")
@pwlin
pwlin / gist:2bdbee3d5d3cc0072495a4acaaf7414f
Created Nov 2, 2016
windows explorer drag and drop bug
View gist:2bdbee3d5d3cc0072495a4acaaf7414f
http://www.tenforums.com/general-support/6868-no-drag-drop-windows-explorer-other-oddities-post834171.html#post834171
Drag-drop in Explorer broke after I removed the Quick Access feature.
Found a fix today.... I think.
All under Registry HKEY_CLASSES_ROOT:
When I searched CLSID for "drag" I found this key: {4657278A-411B-11d2-839A-00C04FD918D0}
called "Shell Drag and Drop helper"
-- well that seems promising, no?
View gist:eaa7dd8dcd5989eb5a6d7c555070e695
<div style="width:100%;display:flex;flex-flow:wrap;">
<div style="flex:1 100%;overflow:hidden;text-overflow:ellipsis;"></div>
<div style="width:50%"></div>
<div style="width:50%"></div>
</div>
View gist:e3e51b2c68e1de7e96c9b2aff59f8b4f
"addon x" might slow firefox bar:
increase the value of browser.addon-watch.percentage-limit or browser.addon-watch.interval
@pwlin
pwlin / gist:8a0d01e6428b7a96e2eb
Created Mar 7, 2016
Android : add cert to system store
View gist:8a0d01e6428b7a96e2eb
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 Jan 1, 2016
PM2 config example
View pm2-app.json
{
"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
WScript.Shell automation
View gist:f0cd4255c658760a0890
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 Apr 3, 2015
CouchDB install/remove Windows Service Instance
View gist:3730c329d04055e70e1e
@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"
View gist:45e95e575331b8ad604f
wget https://freevps.us/downloads/bench.sh -O – -o /dev/null | bash
You can’t perform that action at this time.