[root@localhost iptables]# cat jump-goto.sh
#!/bin/bash
# Flush all chains in filter table
iptables -F
# Delete all user-defined chains in the filter table
iptables -X[root@localhost iptables]# cat jump-goto.sh
#!/bin/bash
# Flush all chains in filter table
iptables -F
# Delete all user-defined chains in the filter table
iptables -X| # pfreixes, 2012-07-27 | |
| # Add to /etc/bash_completion.d/supervisorctl | |
| _supervisor() | |
| { | |
| local cur prev opts base | |
| COMPREPLY=() | |
| cur="${COMP_WORDS[COMP_CWORD]}" | |
| prev="${COMP_WORDS[COMP_CWORD-1]}" |
| #!/bin/sh | |
| set -e | |
| # Auto-Get the latest commit sha via command line. | |
| get_latest_release() { | |
| tag=$(curl --silent "https://api.github.com/repos/${1}/releases/latest" | # Get latest release from GitHub API | |
| grep '"tag_name":' | # Get tag line | |
| sed -E 's/.*"([^"]+)".*/\1/' ) # Pluck JSON value |
| FILES=*.rst | |
| for f in $FILES | |
| do | |
| filename="${f%.*}" | |
| echo "Converting $f to $filename.md" | |
| `pandoc $f -f rst -t markdown -o $filename.md` | |
| done |
Install and configure MySQL with master-slave replication. The benefits of this include high availability, backups, disaster recovery and reporting.
For tutorial purposes, we will be using one master node and one slave node.
Master Node: 10.0.0.10
Slave Node: 10.0.0.11
Source: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
by Sander Marechal
I've written a simple Python class for creating daemons on unix/linux systems. It was pieced together for various other examples, mostly corrections to various Python Cookbook articles and a couple of examples posted to the Python mailing lists. It has support for a pidfile to keep track of the process. I hope it's useful to someone.