Skip to content

Instantly share code, notes, and snippets.

Rai Escarez brainv

Block or report user

Report or block brainv

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
brainv / supervisord-example.conf
Created Aug 8, 2019 — forked from didip/supervisord-example.conf
Example configuration file for supervisord.conf
View supervisord-example.conf
file=/tmp/supervisor.sock ; path to your socket file
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/ ; pidfile location
nodaemon=false ; run supervisord as a daemon
brainv / gist:595c02252343989150411225dadf7c92
Created Aug 2, 2019 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
View gist:595c02252343989150411225dadf7c92
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
brainv /
Created Oct 16, 2018
List of AWS availability zones for each AWS region
AWS region code AWS region name Number of AZs AZ names
us-east-1 Virginia 4 us-east-1a, us-east-1b, us-east-1c, us-east-1e
us-west-1 N. California 2 us-west-1a, us-west-1b
us-west-2 Oregon 3 us-west-2a, us-west-2b, us-west-2c
eu-west-1 Ireland 3 eu-west-1a, eu-west-1b, eu-west-1c
eu-central-1 Frankfurt 2 eu-central-1a, eu-central-1b
ap-southeast-1 Singapore 2 ap-southeast-1a, ap-southeast-1b
ap-southeast-2 Sydney 2 ap-southeast-2a, ap-southeast-2b, ap-southeast-2c
ap-northeast-1 Tokyo 2 ap-northeast-1a, ap-nort
brainv /
Created Jan 10, 2018 — forked from PaulFurtado/
Reset USB device from python
Example code for resetting the USB port that a Teensy microcontroller is
attached to. There are a lot of situations where a Teensy or Arduino can
end up in a bad state and need resetting, this code is useful for
import os
import fcntl
import subprocess
brainv /
Created Jan 11, 2017 — forked from hhcordero/
Dockerized JMeter - A Distributed Load Testing Workflow
brainv /
Created Jan 10, 2017 — forked from joewiz/
Recovery from nginx "Too many open files" error on Amazon AWS Linux

On Tue Oct 27, 2015, began buckling under load, intermittently issuing 500 errors. Nginx's error log was sprinkled with the following errors:

2015/10/27 21:48:36 [crit] 2475#0: accept4() failed (24: Too many open files) 2015/10/27 21:48:36 [alert] 2475#0: *7163915 socket() failed (24: Too many open files) while connecting to upstream...

An article at provided directions that mostly worked. Below are the steps we followed. The steps that diverged from the article's directions are marked with an *.

    • Instead of using su to run ulimit on the nginx account, use ps aux | grep nginx to locate nginx's process IDs. Then query each process's file handle limits using cat /proc/pid/limits (where pid is the process id retrieved from ps). (Note: sudo may be necessary on your system for the cat command here, depending on your system.)
  1. Added fs.file-max = 70000 to /etc/sysctl.conf
  2. Added `nginx soft nofile 1
brainv /
Created Jan 9, 2017 — forked from willurd/
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
brainv / gist:76ae67b161df078ac6425e8736257d13
Created Sep 3, 2016 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
View gist:76ae67b161df078ac6425e8736257d13
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
View gist:e16cf5ba23bfb2831e5008c5b0b6fc5b
#Example of how to use EasyMDB RS232
#Date June/2014
#Version 1.0.2
#Not warranty, for educational purposes
#dispense coin function
#Level coin changer added
brainv / gist:16b1fcbfae6f675884fc
Last active Feb 17, 2018
SSH stop in "debug1: SSH2_MSG_KEXINIT sent"
View gist:16b1fcbfae6f675884fc
mybaby:~ brainv$ ssh -v
OpenSSH_6.7p1 Debian-5, OpenSSL 1.0.1k 8 Jan 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to [] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa type -1
You can’t perform that action at this time.