This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sysctl -w fs.file-max="9999999" | |
| sysctl -w fs.nr_open="9999999" | |
| sysctl -w net.core.netdev_max_backlog="4096" | |
| sysctl -w net.core.rmem_max="16777216" | |
| sysctl -w net.core.somaxconn="65535" | |
| sysctl -w net.core.wmem_max="16777216" | |
| sysctl -w net.ipv4.ip_local_port_range="1025 65535" | |
| sysctl -w net.ipv4.tcp_fin_timeout="30" | |
| sysctl -w net.ipv4.tcp_keepalive_time="30" | |
| sysctl -w net.ipv4.tcp_max_syn_backlog="20480" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -eu | |
| # | |
| # Renames subtitles files according to tv shows names found in the current directory | |
| # Accepted syntaxes for season/episode: s3e04, s03e04, 3x04 (case insensitive) | |
| # | |
| # switch into case insensitive | |
| shopt -s nocasematch | |
| # search subtitles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/bin/bash -eu | |
| find ~/series/wip -name "*.mkv" -exec mv {} ~/series \; | |
| find ~/series/wip -name "*.nfo" -exec rm -f {} ~/series \; | |
| find ~/series/wip -name "*.srt" -exec rm -f {} ~/series \; | |
| find ~/series/wip -name "*.txt" -exec rm -f {} ~/series \; | |
| find ~/series/wip -type -d empty -exec rmdir {} \; | |
| cd ~/series | |
| srtmv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # list_ips kaastor faas_functions | |
| list_ips() { | |
| declare filterName=$1 network=$2 | |
| for m in $(docker-machine ls -q); do | |
| echo -- $m | |
| eval $(set_docker_env $m) | |
| for ID in $(docker ps --filter=name=$filterName --format={{.ID}}); do | |
| docker inspect $ID | jq -c '.[] | { | |
| name:.Name, | |
| ip:.NetworkSettings.Networks.'$network'.IPAddress |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| echo "Stopping firewall and allowing everyone..." | |
| iptables -P INPUT ACCEPT | |
| iptables -P FORWARD ACCEPT | |
| iptables -P OUTPUT ACCEPT | |
| iptables -F | |
| iptables -X | |
| iptables -t nat -F | |
| iptables -t nat -X |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # top 5 CPU processes | |
| ps -eo pcpu,comm= --sort=-pcpu | head -n 5 | |
| # top 5 MEM processes | |
| ps -eo pmem,comm= --sort=-pmem | head -n 5 | |
| # sort tcp open connections | |
| echo "TCP ACTIVE CONN" | |
| netstat -ant | tail -n +3 | awk '{print $6}' | sort | uniq -c | sed -e 's/^\s*/ /' | sort -rn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -eu | |
| # | |
| # Toggle 2 LED on each kafka message. | |
| # @dep jq, oq (https://github.com/thbkrkr/qli/releases/download/0.2.1/oq), blinkstick (pip install blinkstick) | |
| # | |
| get() { jq -r .message <<< $1 2>/dev/null; } | |
| blink() { blinkstick --index $1 --pulse $2 --brightness 40 --duration 70; } | |
| while read msg; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| distro=$1 | |
| sudo apt-get install -y \ | |
| apt-transport-https \ | |
| ca-certificates \ | |
| curl \ | |
| software-properties-common |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -eu | |
| until_ready() { | |
| declare try=${1:-10} sleepTime=${2:-1} | |
| _is_ready() { | |
| test $try -eq 0 | |
| is_ready | |
| } | |
| until _is_ready ; do | |
| echo "try $try" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tcp_rules: | |
| 8500: | |
| - "{{ fw_trusted_ips }}" | |
| 8300: | |
| - "{{ private_node_ips.split(',') }}" | |
| 8301: | |
| - "{{ private_node_ips.split(',') }}" | |
| 8302: | |
| - "{{ private_node_ips.split(',') }}" | |
| 8400: |