Skip to content

Instantly share code, notes, and snippets.

View ichaida's full-sized avatar

Ismail Chaida ichaida

View GitHub Profile
@ichaida
ichaida / MacOS_defaults.sh
Created February 14, 2017 10:05
MacOS defaults setup
# install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew install git
brew install node
brew install wget
brew install z
brew install ag
brew install ack
brew install ffind
@ichaida
ichaida / install_etcd.sh
Created December 8, 2016 11:19
Linux install ETCD Distributed Key-Value Store
echo "Downloading ETCD Distributed Key-Value Store..."
# Grab binary release of etcd
ETCD_VER=v3.0.15
DOWNLOAD_URL=https://github.com/coreos/etcd/releases/download
curl -L ${DOWNLOAD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz -o /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz
# Extract in temp
mkdir -p /tmp/etcd && tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /tmp/etcd --strip-components=1
# Install etcd and etcdctl
cp /tmp/etcd/etcd /usr/local/bin/
cp /tmp/etcd/etcdctl /usr/local/bin/

Keybase proof

I hereby claim:

  • I am ichaida on github.
  • I am ichaida (https://keybase.io/ichaida) on keybase.
  • I have a public key ASAxQmGepGoYXAnX6LhvK3WWiysVupx1LQFHPEdRgctU_wo

To claim this, I am signing this object:

@ichaida
ichaida / breaktime.sh
Created October 31, 2016 20:28
Break Time is a simple shell script that's help you remember to take breaks away from your computer.
#!/bin/bash
# Visit Github:
# https://github.com/variadico/noti
# Install latest:
# go get -u github.com/variadico/noti/cmd/noti
# On macOS:
# brew install noti
@ichaida
ichaida / generate_random_tokens.sh
Created October 14, 2016 18:56
Shell script that generate random tokens
echo `dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null`
@ichaida
ichaida / restart_bluetooth.sh
Created October 8, 2016 09:11
Restart Bluetooth Daemon on Mac OS X without rebooting the OS
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@ichaida
ichaida / feature_updated.sh
Created September 14, 2016 08:30
Keep feature branch updated
function update(){
git checkout master && git pull && git checkout - && git rebase master
}
@ichaida
ichaida / build_docker.sh
Last active August 11, 2016 13:53
Build and run dockerize application project
#!/usr/bin/env bash
# Connect to shell to the default machine
eval "$(docker-machine env default)"
# -------------------------------------------------
# Variables
# -------------------------------------------------
# Names to identify images and containers of this app
IMAGE_NAME='NAME'
CONTAINER_NAME="NAME"
PORT=5000

Docker images/containers cleaning

1- Delete all containers

docker ps -q -a | xargs docker rm

-q prints only the container IDs -a prints all containers

@ichaida
ichaida / clear_docker_logs.md
Last active August 10, 2016 13:43
Clear Docker logs

Clear Docker's container logs

For ZSH use noglobto escape the wildcards.

noglob truncate -s 0 /var/lib/docker/containers/*/*-json.log