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.
$ python -m SimpleHTTPServer 8000Each 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.
$ python -m SimpleHTTPServer 8000On Tue Oct 27, 2015, history.state.gov 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 http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/ provided directions that mostly worked. Below are the steps we followed. The steps that diverged from the article's directions are marked with an *.
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.)fs.file-max = 70000 to /etc/sysctl.conf| """ | |
| 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 |
| 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 |
| ----- 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 |
| [unix_http_server] | |
| file=/tmp/supervisor.sock ; path to your socket file | |
| [supervisord] | |
| 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/supervisord.pid ; pidfile location | |
| nodaemon=false ; run supervisord as a daemon |
| RewriteRule "(^|/)\.(?!well-known\/)" - [F] |
| RewriteRule "(^|/)\.(?!well-known\/)" - [F] |
http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/
Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean