Skip to content

Instantly share code, notes, and snippets.

View sheeeng's full-sized avatar
🌊
It's Monday! \(〇_o)/

Leonard Sheng Sheng Lee sheeeng

🌊
It's Monday! \(〇_o)/
View GitHub Profile
########################################################################
# File : UpdateJom.ps1
# Version : 1.0.1
# Purpose : Downloads and updates jom tool.
# Synopsis: http://qt-project.org/wiki/jom
# Usage : .\UpdateJom.ps1
# Author: Leonard Lee <sheeeng@gmail.com>
########################################################################
# References:
# Manage BITS (Background Intelligent Transfer Service) with Windows PowerShell
########################################################################
# File : ListGUIDs.ps1
# Version : 1.0.0
# Purpose : List globally unique identifier (GUID) of programs installed.
# Synopsis:
# Usage : .\ListGUIDs.ps1
# Author: Leonard Lee <sheeeng@gmail.com>
########################################################################
# References:
# Filtering and Formatting Data
alias opentextedit="open -a TextEdit"
alias opentextmate="open -a TextMate"
alias updatetime="sudo ntpdate -uv $(systemsetup -getnetworktimeserver | awk '{print $4}')"
Set-ExecutionPolicy Unrestricted -scope CurrentUser
Set-ExecutionPolicy Unrestricted -scope CurrentUser
########################################################################
# File : GetDependencyWalker.ps1
# Version : 1.0.0
# Purpose : Downloads the Dependency Walker tool.
# Synopsis: http://www.dependencywalker.com/
# Usage : .\GetDependencyWalker.ps1 ("x86","x64","ia64","32","64")
# Author: Leonard Lee <sheeeng@gmail.com>
########################################################################
# References:
# Manage BITS (Background Intelligent Transfer Service) with Windows PowerShell
# ParamTest.ps1 - Show some parameter features
# Param statement must be first non-comment, non-blank line in the script
Param(
[ValidateSet("x86","x64","ia64","32","64")]
[parameter(Mandatory=$true, Position=1)]
[alias("persekitaran")]
$EnvironmentName,
[ValidateRange(16,64)]
[parameter(Mandatory=$true, Position=2)]
[alias("destinasi")]
@sheeeng
sheeeng / gitpull.sh
Created November 4, 2013 09:50
Git pull for each first level child directory which is a Git repository.
for i in $(find . -maxdepth 1 -type d)
do
echo Found "$i" child directory.
cd $i
echo \$PWD is $PWD
if [ -d .git ]; then
echo "Git repository found."
git pull --verbose
else
@sheeeng
sheeeng / etc_initd_icecc.patch
Last active December 27, 2015 16:09
Enable the most verbose output for the iceccd and icecc-scheduler daemon. Use sudo patch -p0 < ~/etc_initd_icecc.patch && sudo /etc/init.d/icecc restart commands. https://github.com/icecc/icecream http://linux.die.net/man/1/iceccd http://linux.die.net/man/1/icecc-scheduler
--- /etc/init.d/icecc 2013-11-07 12:24:09.536095988 +0100
+++ /etc/init.d/icecc 2013-11-07 12:45:57.712130301 +0100
@@ -60,7 +60,7 @@
fi
start-stop-daemon --start --quiet --exec $DAEMON -- \
- -d $logfile $nice $scheduler $netname -u icecc $basedir $maxjobs $noremote
+ --daemonize -vvv $logfile $nice $scheduler $netname -u icecc $basedir $maxjobs $noremote
}
if [ $# -gt 0 ]; then
echo "Your command line contains $# arguments."
else
echo "Your command line contains no arguments."
fi
if [ "$1" != "" ]; then
echo "Positional parameter 1 contains something."
else
echo "Positional parameter 1 is empty."