Skip to content

Instantly share code, notes, and snippets.

View muhamadazmy's full-sized avatar
🤓

Muhamad Awad muhamadazmy

🤓
  • Threefold Tech
  • Ghent/Belgium
View GitHub Profile
#!/bin/bash
function run_git {
pwd
git $@
}
for dir in `find . -maxdepth 1 -type d -not -name .`; do
pushd $dir >/dev/null
if [ ! -d .git ]; then
!*Rxvt.depth: 32
!*Rxvt.background: black
URxvt.buffered: true
URxvt.saveLines: 100000
URxvt.termName: rxvt
!-------------------------------------------------------------------------------
! URxvt settings
! Colours lifted from Solarized (http://ethanschoonover.com/solarized)
! More info at:
# vim: filetype=yaml
---
meta:
description: 'Solarized theme by lasers'
colors:
base03: '#002b36'
base02: '#073642'
base01: '#586e75'
base00: '#657b83'
base0: '#839496'
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
from i3pystatus import Status
from i3pystatus.weather import Weather
status = Status()
# Displays clock like this:
# Tue 30 Jul 11:59:46 PM KW31
# ^-- calendar week
status.register("clock",
format="%a %-d %b %X",)
@muhamadazmy
muhamadazmy / influxdb.query
Created July 17, 2017 13:03
Influxdb Difference between 2 series values
select mean("x") - mean("y") FROM
(SELECT mean("value") as "x" FROM "series" WHERE $timeFilter GROUP BY time($__interval)),
(SELECT mean("value") as "y" FROM "series" WHERE $timeFilter GROUP BY time($__interval))
WHERE $timeFilter group by time($__interval) fill(linear)
@muhamadazmy
muhamadazmy / ledisbug.go
Created August 13, 2017 08:37
Reproduce the ledis bug
package main
import (
"fmt"
"github.com/siddontang/ledisdb/config"
"github.com/siddontang/ledisdb/server"
"gopkg.in/redis.v2"
"math/rand"
"time"
)
@muhamadazmy
muhamadazmy / ubuntu-flist.sh
Last active February 24, 2019 08:50
A build script for ubuntu flist (type ./ubuntu-flist.sh -h for options)
#!/bin/bash
set -e
function error {
echo -e $* >&2
}
OPTS=`getopt -o hd:p: -l help,dist:,password:,jwt: -- "$@"`
if [ $? != 0 ] ; then error "Failed parsing options." ; exit 1 ; fi
@muhamadazmy
muhamadazmy / copy-chroot.sh
Created December 19, 2017 13:19
Copy binaries to a chroot
#!/bin/bash
if [ $# != 2 ] ; then
echo "usage $0 PATH_TO_BINARY TARGET_FOLDER"
exit 1
fi
PATH_TO_BINARY="$1"
TARGET_FOLDER="$2"
#SET TO DESTINATION IP
DEST_IP='172.17.0.1'
#CHANGE IF NECESSARY (the dest ip should be reachable from eth0)
DEV=eth0
dmesg -n 7
modprobe configfs