Skip to content

Instantly share code, notes, and snippets.

@mousavian
mousavian / gugu.sh
Created March 15, 2016 02:28
Simple script to automate session/window & pane creation for tmux
#!/bin/bash
sn=GuGu
# Start the session and window 0 in workplace
# This will also be the default cwd for new windows created
# via a binding unless overridden with default-path.
cd /home/workspace
tmux new-session -s "$sn" -n "FirstWindowName" -d
tmux split-window -v
@mousavian
mousavian / .tmux.conf
Last active October 16, 2018 03:59
tmux config for Babun in Windows
# http://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
@mousavian
mousavian / fakes.py
Last active February 3, 2016 10:03
Mock pystalkd Beanstalkd connection for unit testing in Django - Python
class FakeBeanstalkdJob():
body = None
def __init__(self, body=''):
if not isinstance(body, str):
raise Exception('Job body must be a str instance')
self.body = body
def delete(self):
pass
@mousavian
mousavian / openstack-cleanup-database
Created June 17, 2015 02:17
A tool to cleanup openstack nova database from all deleted instances
#run this to keep the output:
#$ cleaner.py > cleaner.log
import mysql.connector
uuids = []
class MySQLCursorDict(mysql.connector.cursor.MySQLCursor):
def _row_to_python(self, rowdata, desc=None):
row = super(MySQLCursorDict, self)._row_to_python(rowdata, desc)
if row:
return dict(zip(self.column_names, row))
@mousavian
mousavian / keybase.md
Last active January 1, 2016 08:42
keybase.md

Keybase proof

I hereby claim:

  • I am mousavian on github.
  • I am mousavian (https://keybase.io/mousavian) on keybase.
  • I have a public key whose fingerprint is 2F46 5BDA 596E 2752 A31A A306 75BB 88CA 99BB 6A68

To claim this, I am signing this object: