Skip to content

Instantly share code, notes, and snippets.

View furkanmustafa's full-sized avatar
💭
Set your status

Furkan Mustafa furkanmustafa

💭
Set your status
View GitHub Profile
@furkanmustafa
furkanmustafa / make-kernel-build-dir.sh
Created October 10, 2017 21:23
Script to generate /lib/modules/`uname -r`/build directory
#!/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 April 21, 2017 11:13
Linux Battery and Power Usage Monitoring Script
#!/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 December 14, 2016 01:51
Tmux Configuration
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 August 3, 2016 09:19
A draft rancher management script using bash and jshon
#!/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 April 22, 2016 09:39
Quickly start an iso with qemu (kvm)
#!/bin/sh -e
exec qemu-system-x86_64 -enable-kvm -cdrom $1 -m 1024
@furkanmustafa
furkanmustafa / async_controller.rb
Last active February 10, 2016 03:38
Sample Asynchronous action code for rails
# 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 August 4, 2023 19:17
A simple script to play random mp3s in a folder
#!/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
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 July 28, 2015 23:51
Git Commit nanorc file with diff/patch support
# 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
@furkanmustafa
furkanmustafa / better-pmset-values
Created July 28, 2015 23:47
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