Skip to content

Instantly share code, notes, and snippets.

@wylu
wylu / iptables1.md
Created November 16, 2024 17:57 — forked from ekc/iptables1.md
iptables-jump-vs-goto
[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
@wylu
wylu / supervisorctl.bash_completion
Created March 22, 2023 08:34 — forked from camathieu/supervisorctl.bash_completion
bash completion for supervisorctl
# 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]}"
@wylu
wylu / download-vs-code-server.sh
Created June 27, 2022 02:27 — forked from b01/download-vs-code-server.sh
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
#!/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
@wylu
wylu / rst_to_md.sh
Created May 31, 2021 10:04 — forked from zaiste/rst_to_md.sh
Convert RST to Markdown using Pandoc
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

MySQL Master-Slave Replication on CentOS 7

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
@wylu
wylu / install-rabbitmq-centos-7.md
Created April 20, 2021 12:31 — forked from fernandoaleman/install-rabbitmq-centos-7.md
Install RabbitMQ on CentOS 7

Install RabbitMQ on CentOS 7

sudo yum -y install epel-release
sudo yum -y update

Install Erlang

Download repository

@wylu
wylu / daemon.md
Created September 20, 2019 03:26 — forked from andreif/daemon.md
A simple unix/linux daemon in Python

A simple unix/linux daemon in Python

Source: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

Access: http://web.archive.org/web/20131025230048/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.