Skip to content

Instantly share code, notes, and snippets.

💭
Set your status

Furkan Mustafa furkanmustafa

💭
Set your status
Block or report user

Report or block furkanmustafa

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
@furkanmustafa
furkanmustafa / make-kernel-build-dir.sh
Created Oct 10, 2017
Script to generate /lib/modules/`uname -r`/build directory
View make-kernel-build-dir.sh
#!/bin/bash -e
#
# Extracted from: https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/linux
set -x
ARCH=$(uname -m)
KARCH=x86 # applies to x86_64 too (change for arm, etc.)
pkgdir=
@furkanmustafa
furkanmustafa / power-usage
Created Apr 21, 2017
Linux Battery and Power Usage Monitoring Script
View power-usage
#!/usr/bin/env python2
import os
def readfile(path):
f = open(path, 'r')
if not f:
return false
val = f.read()
f.close()
return val
@furkanmustafa
furkanmustafa / .tmux.conf
Created Dec 14, 2016
Tmux Configuration
View .tmux.conf
set -g default-terminal "screen-256color"
#set -g history-limit 10000
#set -g mode-mouse on
#set -g terminal-overrides 'xterm*:smcup@:rmcup@'
#set -g mouse-select-pane on
#set -g mouse-select-window on
#set -g mouse-resize-pane on
bind -n WheelUpPane copy-mode
bind -n S-down new-window
@furkanmustafa
furkanmustafa / rancher.sh
Last active Aug 3, 2016
A draft rancher management script using bash and jshon
View rancher.sh
#!/bin/sh -e
# set -x
RANCHER_URL="rancher.mydomain.com"
PROJECT_ID="1a5" #id of my stack in rancher
CATTLE_ACCESS_KEY=MY_RANCHER_ACCESS_KEY
CATTLE_SECRET_KEY=MY_RANCHER_ACCESS_SECRET
TMP_FILE=$(mktemp)
@furkanmustafa
furkanmustafa / start-iso-vm.sh
Created Apr 22, 2016
Quickly start an iso with qemu (kvm)
View start-iso-vm.sh
#!/bin/sh -e
exec qemu-system-x86_64 -enable-kvm -cdrom $1 -m 1024
@furkanmustafa
furkanmustafa / async_controller.rb
Last active Feb 10, 2016
Sample Asynchronous action code for rails
View async_controller.rb
# FROM: http://www.jonb.org/2013/01/25/async-rails.html @jbaudanza
# Modified to get it working.
module AsyncController
# This is the rack endpoint that will be invoked asyncronously. It will be
# wrapped in all the middleware that a normal Rails endpoint would have.
class RackEndpoint
attr_accessor :action
@furkanmustafa
furkanmustafa / play-random-music.sh
Last active Nov 12, 2015
A simple script to play random mp3s in a folder
View play-random-music.sh
#!/bin/bash -e
PLAYER="mpv -vo null"
#PLAYER="mpg321"
MUSIC=$(find . -regextype posix-extended -iregex '.*(m4a|mp3|mp4|aac)$' | sort -R)
IFS=$'\n'
for file in $MUSIC
View ghost-in-the-shell-ordered-list.txt
Ghost in the shell - Ordered list of Movie and Series
=====================================================
Original:
- Ghost in the Shell (1995/10)
- Ghost in the Shell 2: Innocence (2004/3)
- (Series) Ghost in the Shell: Stand Alone Complex (2002/10 .. 2003/10, 26 episodes)
@furkanmustafa
furkanmustafa / gitcommit.nanorc
Created Jul 28, 2015
Git Commit nanorc file with diff/patch support
View gitcommit.nanorc
# Some parts from here : http://milianw.de/code-snippets/git-commit-message-highlighting-in-nano
# Some parts from here : https://github.com/serialhex/nano-highlight/blob/master/patch.nanorc
# syntax highlighting for git commit messages
syntax "patch" ".git/COMMIT_EDITMSG$"
# overlong lines
# color brightred "^.{70,}.+$"
# comment
View better-pmset-values
DestroyFVKeyOnStandby 1
Active Profiles:
Battery Power -1*
AC Power -1
Currently in use:
standbydelay 0
standby 0
halfdim 1
hibernatefile /var/vm/sleepimage
darkwakes 0
You can’t perform that action at this time.