Skip to content

Instantly share code, notes, and snippets.

View apisznasdin's full-sized avatar

Hafidz Nasruddin apisznasdin

View GitHub Profile
file_1 = open("input.txt", "r")
file_2 = open("output.txt","r+")
mylist = sorted(file_1.read().split(','), key=str.lower)
for line in mylist:
file_2.write(","+line)
file_1.close()
file_2.close()
@apisznasdin
apisznasdin / gist:9318693
Created March 3, 2014 05:01
Configure Linux to used Windows Proxy
# Refer http://www.w3schools.com/tags/ref_urlencode.asp for URL-encoding for ASCII Character if used in password eg
# %23 = #
# %40 = @
# %5C = /
#
# example http://putrajaya/apisznasdin:password@proxysvr:8080
export http_proxy=http://domain%5Cusername:password@proxysvr:8080
export https_proxy=http://domain%5Cusername:password@proxysvr:8080
export ftp_proxy=http://domain%5Cusername:password@proxysvr:8080
@apisznasdin
apisznasdin / locale
Created March 14, 2014 04:37
/etc/default/locale
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8

Keybase proof

I hereby claim:

  • I am apisznasdin on github.
  • I am hafidz (https://keybase.io/hafidz) on keybase.
  • I have a public key whose fingerprint is 2CF2 4A73 9FE5 F1A1 30C0 6705 3CE8 82E5 BD99 64B8

To claim this, I am signing this object:

@apisznasdin
apisznasdin / auto_master
Created January 21, 2015 09:46
OSX Yosemite Automount NAS Share settings
# /etc/auto_master
#
# Automounter master map
#
+auto_master # Use directory service
/net -hosts -nobrowse,hidefromfinder,nosuid
/home auto_home -nobrowse,hidefromfinder
/Network/Servers -fstab
/Users/username/Documents/Shares auto_resources
/- -static
@apisznasdin
apisznasdin / apache2
Created July 13, 2015 04:21
Apache2 rc init script
APACHE_HOME=/usr/local/apache2
CONF_FILE=${APACHE_HOME}/conf/httpd.conf
RUNDIR=/var/run/apache2
PIDFILE=${RUNDIR}/httpd.pid
if [ ! -f ${CONF_FILE} ]; then
exit 0
fi
if [ ! -d ${RUNDIR} ]; then
@apisznasdin
apisznasdin / apache
Created July 13, 2015 04:28
Apache rc init script
#!/sbin/sh
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use subject to license terms.
#
#ident "@(#)apache.sh 1.6 08/04/04 SMI"
APACHE_HOME=/usr/apache
CONF_FILE=/etc/apache/httpd.conf
RUNDIR=/var/run/apache
@apisznasdin
apisznasdin / PL2303 driver
Created July 15, 2015 20:35
PL2303 driver
air:~ hafidz$ ls /dev/cu.*
/dev/cu.Bluetooth-Incoming-Port
/dev/cu.usbserial
@apisznasdin
apisznasdin / check duplicate on ext_name field
Last active December 25, 2015 03:59
select statement to find duplicates on ext_name in ew_process_instance table
select ext_name, count(*)
from ew_process_instance
group by ext_name
having count(*) > 1;
@apisznasdin
apisznasdin / delete .svn
Created October 11, 2013 04:11
Recursively Delete .svn Directories
find . -type d -name .svn -exec rm -rf {} \;