This file contains 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
{ | |
"registry-mirrors": ["https://registry.docker-cn.com", "http://repo.docker.ir:5000"] | |
} |
This file contains 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 | |
# create a file named key which contains the public key for new user | |
export SERVERS="ip1 ip2 ip3" | |
for server in $SERVERS | |
do | |
echo "=============" | |
echo $server |
This file contains 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
seq 16 | xargs -I{} sh -c 'echo ===== {} ===== && redis-cli -n {} keys "*"' |
This file contains 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
kubectl get pods --no-headers -o custom-columns=":metadata.name" | xargs -I{} sh -c "kubectl logs {} > {}.txt" |
This file contains 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 | |
# curl link-to-raw | bash | |
set -e | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y install docker.io |
This file contains 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
import queue | |
import threading | |
import time | |
from random import randint | |
class ParallelQueue: | |
def _worker(self, i): | |
print("Starting worker: ", i) | |
while True: |
This file contains 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 | |
function displaytime { | |
local T=`echo $1 / 1 | bc` | |
local D=$((T/60/60/24)) | |
local H=$((T/60/60%24)) | |
local M=$((T/60%60)) | |
local S=$((T%60)) | |
(( $D > 0 )) && printf '%d days ' $D | |
(( $H > 0 )) && printf '%d hours ' $H |
This file contains 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
export PYTHONDONTWRITEBYTECODE=1 |
This file contains 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
mediaplayer-remote play-pause | |
mediaplayer-remote next | |
mediaplayer-remote prev | |
mediaplayer-remote stop |
This file contains 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 | |
TIMEOUT=1 | |
function do_action(){ | |
player=$1 | |
action=$2 | |
# check if player is running | |
if ! pgrep $player &>/dev/null |
NewerOlder