Skip to content

Instantly share code, notes, and snippets.

ghost in the machine

DungSaga dungsaga

ghost in the machine
Block or report user

Report or block dungsaga

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
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 Jul 5, 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>
View chrome-bug-530121.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Chrome bug 530121</title>
<meta name="viewport" content="initial-scale=1">
<div style="transform:scaleX(1); box-shadow:0 0 75px rgba(0,0,0,0.65);" >
<div style="overflow:scroll; height:300px;" >
dungsaga / math.sql
Last active Dec 28, 2015
obfuscated sql queries
View math.sql
select abs(ceil(round(sin(6)*sin(4)*sin(2)*sin(0)))) = abs(ceil(round(sin(7)*sin(5)*sin(3)*sin(1))))
select right(left(right(left(right(left('select',6),5),4),3),2),1)
select right(left(right(left(right(left(right(left(right(left(right(left(right(left(right(left(right(left(right(left('select',20),19),18),17),16),15),14),13),12),11),10),9),8),7),6),5),4),3),2),1)
dungsaga / document.cookie-is-empty.js
Last active Feb 5, 2016
reproduce bug "document.cookie is empty if any cookie has non-ASCII characters" (
View document.cookie-is-empty.js
You can’t perform that action at this time.