Skip to content

Instantly share code, notes, and snippets.

ghost in the machine

DungSaga dungsaga

ghost in the machine
View GitHub Profile
dungsaga /
Created May 7, 2020
set committer date to author date for the latest git commit
# set committer date to author date for the latest git commit
env GIT_COMMITTER_DATE=$(git log -1 HEAD | grep Date: | cut -d' ' -f2-) git commit --amend --no-edit --date=$GIT_COMMITTER_DATE
# fish shell use (...) instead of $(...)
env GIT_COMMITTER_DATE=(git log -1 HEAD | grep Date: | cut -d' ' -f2-) git commit --amend --no-edit --date=$GIT_COMMITTER_DATE
View calculate-nir.js
// use the web page at
// when you input the data, it will calculate the check digits (Clé de contrôle)
// ref:
// run this in console to get the NIR string:
v=ids=>ids.split(',').map(id=>(e=document.getElementById(id),e.value||e.textContent)).join(' ');
// or, patch function CalculerCleNir in
// line 149: cle.innerHTML=calculCle;
dungsaga /
Last active Jan 14, 2020
Access remote host via a specific network interface
# SSH can access a remote host using a specified network interface
# just use -b with local address of that network interface
ssh -b root@
# add a route to a remote host via a specified network interface
sudo ip route add via dev wlp2s0
# delete a route in the routing table
sudo ip route delete
dungsaga /
Created Jun 24, 2019
sync local clock in bash without NTP
# I want to sync the local clock but don't have access to any NTP server.
# I can see my time offset at and adjust the local clock accordingly.
# But then I recall that a HTTP response contains a date header which is often the current date & time.
# I'll use it to set the system clock with the precision of 1 or 2 seconds.
# in Linux
sudo date -us "$(curl -Is | grep "^Date: " | cut -d" " -f3-)"
# in MacOS
dungsaga /
Last active Mar 18, 2019
Line chart with tag cloud
dungsaga /
Created Mar 17, 2019
Candlestick chart demo
View Rationale_for_using_CPL_as_an_installer_format.txt
** Rationale for using CPL as an installer format **
An issue with EXE installers is that they are likely to pick up bogus DLLs
from the directory they execute from, which, from security perspective, must
be assumed to be polluted with malicious stuff of all kinds. This holds even
for installers which carefully avoid DLL dependencies to the possible extent,
because the various DLL injection mechanisms built into Windows may introduce
additional dependencies which practically go beyond anyone's control. provides some
View latest free version of

latest free version of Synergy

  • You can use Barrier which is almost similar to Synergy 1.9. It's actively maintained (receiving bug fixes) as an open source project. But it doesn't have digital certificates on binary releases.
  • You can use Synergy 1.9.0-rc3 or 1.8.8 from some github repository. It's not maintained as Symless is working on Synergy 2.x.


dungsaga / deobfuscate-odttf-in-xps.js
Last active Nov 7, 2019
deobfuscate odttf file (extracted from M$ XPS file)
View deobfuscate-odttf-in-xps.js
const purpose = "Purpose: deobfuscate odttf file (extracted from M$ XPS file)"
const usage = "Usage: node deobfuscate-odttf-in-xps.js <guid-obfuscated-font-file.odttf> [<output-file.ttf>]"
const obfuscatedStartOffset = 0 //start of obfuscated bytes in font file
const obfuscatedEndOffset = 32 //start of obfuscated bytes in font file
const guidSize = 32 // length of GUID string (only hex characters included)
const fs = require('fs')
const path = require('path')
View ios-8-web-app.html
<!doctype html>
<!-- -->
<title>iOS 8 web app</title>
You can’t perform that action at this time.