Skip to content

Instantly share code, notes, and snippets.

View haisum's full-sized avatar

Haisum Mussawir haisum

View GitHub Profile
haisum /
Created July 20, 2020 15:30 — forked from hopeseekr/
Putting Docker on its own pseudo filesystem

Docker on BTRFS is very buggy and can result in a fully-unusable system, in that it will completely butcher the underlying BTRFS filesystem in such a way that it uses far more disk space than it needs and can get into a state where it cannot even delete any image, requiring one to take drastic actions up to and including reformatting the entire affected BTRFS root file system.

According to the official Docker documentation:

btrfs requires a dedicated block storage device such as a physical disk. This block device must be formatted for Btrfs and mounted into /var/lib/docker/.

In my experience, you will still run into issues even if you use a dedicated partition. No, it seems it requires a standalone

haisum / UploadedFile.class.php
Created July 23, 2019 20:42
PHP verify uploaded file class
* CUploadedFile class file.
* @author Qiang Xue <>
* @link
* @copyright 2008-2013 Yii Software LLC
* @license
haisum / Db.class.php
Created July 23, 2019 20:38
mysql master/slave db connection class php
* Class for executing and logging queries on database
* @author Haisum <>
class TradeBanqDb {
* stores link returned from mysql_connect from master
* on execution of first DML query
* @var mysql
haisum / Html.class.php
Created July 23, 2019 20:35
Modified Non Yii Html class
* Html class file.
* @author Qiang Xue <>
* @link
* @copyright 2008-2013 Yii Software LLC
* @license
haisum /
Created June 28, 2018 13:37
yum download all dependencies
#install downloadonly yum plugin
sudo yum --enablerepo=mariadb install --installroot=`pwd` --releasever=/ --downloadonly --downloaddir=./ MariaDB-client
haisum /
Created May 18, 2018 01:32
Capture ldap packets with tshark
tshark -i any -2 -R ldap.filter -f "dst port 389" -O ldap -V
haisum / pprof.go
Created November 6, 2017 14:36
Go memory/cpu analysis
//run two servers:
go func() {
err := proxy.Start(viper.GetString("PROXY_URL"),
if err != nil {
log.WithError(err).Fatal("Error happened in starting proxy server.")
haisum / equiv-binary-go-tour.go
Created August 28, 2017 20:51
equivalent binary trees
package main
import (
// Walk walks the tree t sending all values
// from the tree to the channel ch.
haisum / redirects.js
Created August 10, 2017 12:18
Phantomjs redirects handling
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 / .bashrc
Created July 31, 2017 07:44
Bash History sharing
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"