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
""" | |
Create markdown files based on your ticktick notes | |
You need to export your data from ticktick and use as input: | |
* Export from: Setting -> Account -> Generate Backup | |
Usage: | |
> python main.py -f ticktick.csv -d output_dir/ [--flatten] | |
""" |
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/zsh | |
installed=(`pacman -Qq`) | |
all_packages=`pacman -Ss | grep -v '^\s' | cut -d ' ' -f 1` | |
for package in "${installed[@]}" | |
do | |
repo=`echo $all_packages | grep "/$package\$" | cut -d '/' -f '1'` | |
if [[ $repo == "extra" ]] || [[ $repo == "core" ]] || [[ $repo == "multilib" ]] |
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
{ | |
"registry-mirrors": ["https://registry.docker-cn.com", "http://repo.docker.ir:5000"] | |
} |
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 | |
# 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 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
seq 16 | xargs -I{} sh -c 'echo ===== {} ===== && redis-cli -n {} keys "*"' |
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
kubectl get pods --no-headers -o custom-columns=":metadata.name" | xargs -I{} sh -c "kubectl logs {} > {}.txt" |
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 | |
# 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 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
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 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 | |
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 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
export PYTHONDONTWRITEBYTECODE=1 |
NewerOlder