Skip to content

Instantly share code, notes, and snippets.

View kofrasa's full-sized avatar
💭
Believe. Think. Do.

Francis Asante kofrasa

💭
Believe. Think. Do.
View GitHub Profile
@kofrasa
kofrasa / setup-devbox.sh
Last active December 8, 2015 19:44
Scripts to setup my DEV machine
# install Java8
sudo add-apt-repository ppa:webupd8team/java
sudo -E apt-get update
sudo -E apt-get install -y --force-yes oracle-java8-installer
sudo -E apt-get install -y --force-yes oracle-java8-set-default
# install PIP
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install --upgrade virtualenv
Command Structure
=================
[count]<verb><modifier><target>
<target> = <object|motion>
Navigation (Motion)
===================
h,j,k,l - left, down, up, right (respectively)
0 - beginning of line
^ - first character of line
## Command Structure
Ctrl-b <command>
## CLI
tmux list-sessions
tmux new -s <session-name>
tmux attach -t <session-name>
tmux kill-session -t <session-name>
## Sessions
@kofrasa
kofrasa / submit-to-pypi
Last active June 14, 2017 09:51
Submit package to pypi
1. Create your account on pypi and pypitest
2. Create a ~/.pypirc file
3. Populate with configuration
```
[distutils]
index-servers =
pypi
pypitest
[pypi]
@kofrasa
kofrasa / architecture-and-scaling-lessons.md
Last active June 14, 2017 09:51
Software Architecture and Scaling
@kofrasa
kofrasa / python-libraries.md
Last active March 11, 2019 14:10
Useful Python Packages

Useful Python Packages

General

Name Description
asyncpg A fast PostgreSQL Database Client Library for Python/asyncio
boltons Useful extensions to the standard library
click Composable command line utility library
envoy Python Subprocesses for Humans
gevent Asynchronous event loop implementation
@kofrasa
kofrasa / linux-sys-perf.md
Last active May 21, 2018 13:02
Linux System Performance

Find the processes consuming the most memory

1. Compute memory usage and sort

ps aux  | awk '{print $6/1024 " MB\t\t" $11}'  | sort -nr | head -10
ps -eo pmem,pcpu,vsize,pid,cmd | sort -k 1 -nr | head -10
@kofrasa
kofrasa / gen-tags.md
Last active June 14, 2017 09:49
Generate ctags for a project

Small function to generate tags file for your project

tags_init() {
  local root=$(pwd)
  local cmd="ctags -R -o .tags"
  for d in src test tst $*; do
    if [ -d "$root/$d" ]; then
      cmd="$cmd $d"
 fi