Skip to content

Instantly share code, notes, and snippets.

View thesabbir's full-sized avatar

Sabbir Ahmed thesabbir

View GitHub Profile
@thesabbir
thesabbir / amber_mirror_bd.sh
Created January 5, 2017 19:10
Fedora amber mirror
#!/bin/bash
sudo dnf config-manager --add-repo http://mirror.amberit.com.bd/fedora/linux/releases/25/Everything/x86_64/os/
sudo dnf config-manager --add-repo http://mirror.amberit.com.bd/fedora/linux/updates/25/x86_64/
@thesabbir
thesabbir / setup_buildroot.sh
Created October 24, 2016 19:15
Install xcode and brew and run this script to setup openwrt build tool on OSX 10.10+
#!/bin/bash
brew tap homebrew/dupes
brew install coreutils findutils gawk gnu-getopt gnu-tar grep wget quilt xz
brew ln gnu-getopt --force
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
hdiutil create -size 20g -type SPARSE -fs "Case-sensitive HFS+" -volname OpenWrt OpenWrt.sparseimage
hdiutil attach OpenWrt.sparseimage
cd /Volumes/OpenWrt
git clone https://github.com/openwrt/openwrt.git buildroot
cd buildroot
#!/usr/bin/env python
import argparse
from string import Template
"""
Subclassing template class
"""
class NginTemplate(Template):
delimiter = '#'
@thesabbir
thesabbir / updateip.lua
Created October 5, 2016 07:10 — forked from 85degree/updateip.lua
CloudFlare Dynamic DNS using OpenWRT
#!/usr/bin/lua
-- Original script: https://github.com/nileshgr/utilities/blob/master/general/updateip.lua
-- http://nileshgr.com/2015/09/23/cloudflare-dynamic-dns-using-openwrt
-- For use with openwrt since openwrt supports LUA.
-- Prerequisites:
-- luasec
-- luasocket
-- libubus-lua
@thesabbir
thesabbir / install_mongooseim.sh
Last active January 14, 2018 14:29
CentOS 7 mongooseIM installer
#!/usr/bin/env bash
yum update -y
yum install -y https://packages.erlang-solutions.com/erlang/esl-erlang/FLAVOUR_1_general/esl-erlang_17.5-1\~centos\~7_amd64.rpm
yum install -y expat-devel openssl-devel erlang-reltool gcc-c++ make
git clone https://github.com/esl/MongooseIM.git ~/mongooseim
cd ~/mongooseim
./rebar get-deps
./tools/configure with-all
./rebar compile
make install
@thesabbir
thesabbir / OpenerPlugins.js
Last active August 20, 2016 20:42
Webpack opener plugin
const opener = require('opener');
const { devServerUrl } = require('./config');
const removeCallback = require('lodash/pull');
function OpenerPlugin() {
}
OpenerPlugin.prototype.apply = (compiler) => {
compiler.plugin('done', function openerCallback(stats) {
/*eslint no-console:0*/
@thesabbir
thesabbir / vm-bridge
Created July 25, 2016 18:05 — forked from CrashenX/vm-bridge
Example script for configuring host networking for KVM guest. Works for wireless interface on host.
#!/bin/bash
# "Bridge" Networking between KVM Guest and Host
#
# Copyright (c) 2014 Jesse J. Cook
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@thesabbir
thesabbir / .zshrc
Last active September 21, 2016 13:27
centos minmal
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="robbyrussell"
plugins=(git history-substring-search fedora yum)
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
source $ZSH/oh-my-zsh.sh
alias zshconfig="vi ~/.zshrc"
alias reload="source ~/.zshrc"
/**
* Takes a raw param strings then converts it to int if integer
* If separated with , then return an array
* @param rawParams
* @returns {Params Item Array} || { Param Item}
*/
function paramsMake(rawParams) {
const param = rawParams.split(',').map(item => {
if (Number.isNaN(parseInt(item, 8))) return item;
return parseInt(item, 8);
"precommit.silent": true,
"pre-commit": [
"pre-commit-eslint"
]