Skip to content

Instantly share code, notes, and snippets.

function fn_akamai() {};
fn_akamai.prototype.tmexpr = function() {
return "sid=`mist-session` && mist-source $sid -m calc.in | mist-decode -l";
};
function fn_count(s) { this.s = s; }
fn_count.prototype.tmexpr = function() {
return this.s.tmexpr() + " | " + " count-lines ";
};
@jeffhung
jeffhung / mysql-dump.sh
Created May 10, 2012 07:30
My script to backup mysql database as SQL as complete as possible. Note that this runs slowly.
#!/bin/sh
__exe_name__=`basename $0`;
__revision__=`echo '$Rev: 37 $' | cut -d' ' -f2`;
__rev_date__=`echo '$Date: 2007-12-25 00:32:28 +0800 (Tue, 25 Dec 2007) $' | cut -d' ' -f2`;
usage()
{
local ex=0;
if [ $# -gt 0 ]; then
MODULES =# list of sub modules
MODULES += src/common
MODULES += src/myspn-apiserver
MODULES += src/myspn-idp
MODULES += src/myspn-portal
MODULES += src/myspn-topcve
MODULES += src/spn-secured-defaults
MODULES += src/redis
MODULES += src/php-redis
#pragma pack(push, 1) // exact fit - no padding
union A
{
int a[3];
struct {
int x;
int y;
int z;
} s;
};
@jeffhung
jeffhung / SHELL
Last active November 14, 2016 07:07
Vagrantfile for Declaring Tax (2016)
$ VBoxManage list usbhost
Host USB Devices:
...
UUID: 248ee848-3d9e-47cc-96d7-779e54946e39
VendorId: 0x0bda (0BDA)
ProductId: 0x0169 (0169)
Revision: 97.35 (9735)
Port: 1
@jeffhung
jeffhung / xapp.md
Last active September 5, 2018 01:09
xapp.sh

xapp.sh

Select X display in dialog to pick where to render your X application.

You can add these lines to your ~/.login file to switch to this behavior:

if ( $?DISPLAY  ) then
	xapp.sh --register "$DISPLAY";
	setenv DISPLAY_ORI	"$DISPLAY"
struct TestC
{
std::shared_ptr<Test> GetIntance();
Test* GetRawPointer();
Test& GetReference();
std::unique_ptr<Test> GetUniqueInstance();
}
@jeffhung
jeffhung / .gitconfig
Created October 7, 2019 10:18
Customize Git Configurations by Folders
# See: https://git-scm.com/docs/git-config#_conditional_includes
[includeIf "gitdir:~/company/works/"]
path = ~/company/works/gitconfig
[includeIf "gitdir:~/personal/works/"]
path = ~/personal/works/gitconfig