Skip to content

Instantly share code, notes, and snippets.

Haisum Mussawir haisum

Block or report user

Report or block haisum

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
@haisum
haisum / UploadedFile.class.php
Created Jul 23, 2019
PHP verify uploaded file class
View UploadedFile.class.php
<?php
/**
* CUploadedFile class file.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright 2008-2013 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
@haisum
haisum / Db.class.php
Created Jul 23, 2019
mysql master/slave db connection class php
View Db.class.php
<?php
/**
* Class for executing and logging queries on Tradebanq.com database
* @author Haisum <haisumbhatti@gmail.com>
*/
class TradeBanqDb {
/**
* stores link returned from mysql_connect from master
* on execution of first DML query
* @var mysql
@haisum
haisum / Html.class.php
Created Jul 23, 2019
Modified Non Yii Html class
View Html.class.php
<?php
/**
* Html class file.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright 2008-2013 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
@haisum
haisum / yumdownload.sh
Created Jun 28, 2018
yum download all dependencies
View yumdownload.sh
#install downloadonly yum plugin
sudo yum --enablerepo=mariadb install --installroot=`pwd` --releasever=/ --downloadonly --downloaddir=./ MariaDB-client
@haisum
haisum / ldap_tshark.sh
Created May 18, 2018
Capture ldap packets with tshark
View ldap_tshark.sh
tshark -i any -2 -R ldap.filter -f "dst port 389" -O ldap -V
@haisum
haisum / pprof.go
Created Nov 6, 2017
Go memory/cpu analysis
View pprof.go
//run two servers:
go func() {
err := proxy.Start(viper.GetString("PROXY_URL"),
viper.GetString("PROXY_SUFFIX"),
viper.GetString("DATA_DIR"),
viper.GetString("HTTP_HOST"),
viper.GetInt("HTTP_PORT"))
if err != nil {
log.WithError(err).Fatal("Error happened in starting proxy server.")
@haisum
haisum / equiv-binary-go-tour.go
Created Aug 28, 2017
equivalent binary trees
View equiv-binary-go-tour.go
package main
import (
"golang.org/x/tour/tree"
"fmt"
"time"
)
// Walk walks the tree t sending all values
// from the tree to the channel ch.
@haisum
haisum / redirects.js
Created Aug 10, 2017
Phantomjs redirects handling
View redirects.js
function renderPage(url) {
var page = require('webpage').create();
var redirectURL = null;
page.onResourceReceived = function(resource) {
if (url == resource.url && resource.redirectURL) {
redirectURL = resource.redirectURL;
}
};
@haisum
haisum / .bashrc
Created Jul 31, 2017
Bash History sharing
View .bashrc
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
export HISTSIZE=100000 # big big history
export HISTFILESIZE=100000 # big big history
shopt -s histappend # append to history, don't overwrite it
# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
View gist:bb2136e83489edaaf3e83e0fca968979
ssh -N -T -L *:8001:localhost:8000 dockerhost.local
You can’t perform that action at this time.