Skip to content

Instantly share code, notes, and snippets.

View shroukkhan's full-sized avatar

Shrouk Hasan Khan shroukkhan

  • Softverk / Fingi / Thai-Fi
  • Bangkok
View GitHub Profile
@shroukkhan
shroukkhan / loginShellWithIptables
Created February 14, 2013 07:41
#this script will log you in and then add your publip ip to the allowed list in iptables. #necessary because http is blocked by iptables for security reason
#!/bin/bash
login="root"
pass="PASSWORD"
ip="MY_IP_ADDRESS"
publicip=$(wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//')
sshpass -p $pass ssh $login@$ip "iptables -I INPUT -j ACCEPT -s $publicip"
sshpass -p $pass ssh $login@$ip
#this script will log you in and then add your publip ip to the allowed list in iptables.
#necessary because http is blocked by iptables for security reason
@shroukkhan
shroukkhan / renameCSipSimple
Created February 15, 2013 14:11
renaming csip simple package
mkdir src/com/fingi
mv src/com.fingi.csipsimple.src/com/fingi/
find src/ -type f -print0 | xargs -0 sed -i 's/com.csipsimple./com.fingi.csipsimple./g' *.java
find res/ -type f -print0 | xargs -0 sed -i 's/com.csipsimple./com.fingi.csipsimple./g' *.xml
@shroukkhan
shroukkhan / renameAndBuild.sh
Last active April 13, 2016 06:58
this script will rename csipsimple and build fingi usage is simple, call it the same way you call build.sh no change is needed to your existing code. the script will automatically download csipsimple and actionbarsherlock if not found. put this scripp in your app (android_app ) folder ( same directory as build.sh) and call it like this: ./rename…
#!/bin/bash
############ check arguments #################
if [ -z "$1" ]
then
echo "No argument supplied, please provide product name and build type. such as: ./renameAndBuild.sh aloft debug "
exit
fi
############ setting paths #################
@shroukkhan
shroukkhan / boostFixtureTestSuite
Last active December 13, 2015 22:09
boost test template eclipse ( test fixture )
${filecomment}
${includes}
#include <boost/test/unit_test.hpp>
using namespace std;
${namespace_begin}
@shroukkhan
shroukkhan / zend query string
Created March 3, 2013 15:17
zend debug query string to make sure it doesnt always stop at line 1 of each file it debugs from cli
remove
debug_stop=1
from the query string
@shroukkhan
shroukkhan / debugging php cli remote
Created March 16, 2013 11:08
debugging remote cli using phpstorm
http://www.rtuin.nl/2013/01/php-cli-remote-debugging-with-phpstorm-zend-debugger/
---------------------------------------------------------------------------------------------------------
This post aims to give an overview of how to get remote cli debugging working with PhpStorm and Zend Debugger. You can find more detailed information under the links in this article.
Some time ago i wanted to debug a PHPUnit test in PhpStorm, debugging PHP scripts using the cli sapi turned out to require some extra effort.
The situation is that my project files reside in a virtualbox, and open the project files -via a mounted directory- in PhpStorm. This means that, for normal web debugging, you have to specify some server settings, including the path mapping.
Since you work on the server directly, you have to set up a remote debugging connection to your IDE. In his blog post, Kevin Schroeder explains how to do this.
@shroukkhan
shroukkhan / .config
Last active December 15, 2015 10:09
carambola config
#
# Automatically generated make config: don't edit
# OpenWrt version: Barrier Breaker (r33735)
# Tue Dec 10 21:29:36 2013
#
CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_TARGET_ppc40x is not set
# CONFIG_TARGET_ppc44x is not set
# CONFIG_TARGET_realview is not set
# CONFIG_TARGET_atheros is not set
@shroukkhan
shroukkhan / instruction
Created April 2, 2013 14:59
changing eclipse automatically selected text background
Window-->preference-->General-->Editors-->Text Editors-->Annotations--->C++ Occurances
@shroukkhan
shroukkhan / propertyPortalFileManager.php
Created July 9, 2013 01:28
php create class instance
/*******************************************************/
protected static $instance = null;
protected function __construct()
{
//Thou shalt not construct that which is unconstructable!
}
protected function __clone()
{
@shroukkhan
shroukkhan / dual display
Last active August 29, 2015 14:04
Dual Display - Ubuntu
xrandr --output DVI-I-0 --right-of DVI-I-1