start new:
tmux
start new with session name:
tmux new -s myname
""" | |
Determine IPv4 addresses on a Linux machine via the socket interface. | |
Thanks @bubthegreat the changes to make it Py2/3 compatible and the helpful | |
code comments: https://gist.github.com/pklaus/289646#gistcomment-2396272 | |
This version has all comments removed for brevity. | |
""" | |
import socket | |
import array | |
import struct |
#!/bin/bash | |
# Install script for Latest WordPress by Johnathan Williamson - extended by Don Gilbert | |
# Disclaimer: It might not bloody work | |
# Disclaimer 2: I'm not responsible for any screwups ... :) | |
# DB Variables | |
echo "MySQL Host:" | |
read mysqlhost | |
export mysqlhost |
1) O Ócio Criativo - Domenico De Masi | |
http://www.livrariasaraiva.com.br/produto/443457/o-ocio-criativo/ | |
2) Você está Louco - Ricardo Semler | |
http://www.livrariasaraiva.com.br/produto/1461877/voce-esta-louco-!-uma-vida-administrada-de-outra-forma/ | |
3) Virando a própria mesa - Ricardo Semler | |
http://www.livrariasaraiva.com.br/produto/100702/virando-a-propria-mesa-uma-historia-de-sucesso-empresarial-made-in-brazil/ | |
4) The 4-Hour Workweek - Tim Ferriss |
Yesterday I upgraded our running elasticsearch cluster on a site which serves a few million search requests a day, with zero downtime. I've been asked to describe the process, hence this blogpost.
To make it more complicated, the cluster was running elasticsearch version 0.17.8 (released 6 Oct 2011) and I upgraded it to the latest 0.19.10. There have been 21 releases between those two versions, with a lot of functional changes, so I needed to be ready to roll back if necessary.
We run elasticsearch on two biggish boxes: 16 cores plus 32GB of RAM. All indices have 1 replica, so all data is stored on both boxes (about 45GB of data). The primary data for our main indices is also stored in our database. We have a few other indices whose data is stored only in elasticsearch, but are updated once daily only. Finally, we store our sessions in elasticsearch, but active sessions are cached in memcached.
BOX_NAME=vagrant-build | |
BASE_DIR="`pwd`/machines" | |
BOX_DIR="${BASE_DIR}/${BOX_NAME}" | |
mkdir -p ${BASE_DIR} | |
VBoxManage createvm --name "${BOX_NAME}" --ostype RedHat_64 --basefolder ${BASE_DIR} | |
VBoxManage registervm "${BOX_DIR}/${BOX_NAME}.vbox" | |
mkdir -p tmp |
Some scripts/configurations that greatly improve tmux/vim workflows. The shell scripts target zsh but should be adaptable without much effort for other unix shells.
Features:
'vim-tmux-move.zsh', '.vimrc' and '.tmux.conf' cooperate so you can move transparently between tmux panes and vim windows using ALT + (arrow keys or jkhl). It was based on this gist
#!/bin/bash | |
# Autor: Nilton OS -- www.linuxpro.com.br | |
echo 'setup-web2py-nginx-uwsgi-centos64.sh' | |
echo 'Support CentOS 6.4' | |
echo 'Installs Nginx 1.4.1 + uWSGI + Web2py' | |
# Get Web2py Admin Password | |
echo -e "Web2py Admin Password: \c " | |
read PW |
#!/usr/bin/python | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
#!/bin/bash | |
# | |
# Este script vai consultar o json da globo.com e vai mostrar em | |
# quantos estados o partido X coliga com os outros partidos | |
# | |
PARTIDO=${1:?favor informar o partido} | |
URL=http://estaticog1.globo.com/2014/07/Coligacoes/eleicao.json | |
echo "Coligações do partido $PARTIDO" |