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
cd "C:\Program Files\Docker\Docker" | |
./DockerCli.exe -SwitchDaemon | |
# I should switch back if I still needs the original Daemon |
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
$(<command> | grep <something I want to grep> | awk '{print <the line I wants to get, e.g. $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
echo "hello world" > a.txt | |
soffice --headless --invisible --nodefault --nofirststartwizard \ | |
--nolockcheck --nologo --norestore --convert-to pdf --outdir $(pwd) a.txt | |
# to run multiple convert just use * as a selector |
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
# linux command . Copy a file one hundred times | |
for n in {001..100}; do | |
cp file.jpg file-$n.jpg | |
done |
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
aws --version | |
# aws-cli/1.15.30 Python/3.6.5 Darwin/17.6.0 botocore/1.10.30 | |
# move or rename bucket | |
aws s3 mb s3://[new-bucket] | |
aws s3 mv s3://old-bucket s3://new-bucket --recursive | |
# or | |
aws s3 mb s3://[new-bucket] | |
aws s3 sync s3://[old-bucket] s3://[new-bucket] |
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
package org.doc2pdf.lambda; | |
import java.awt.image.BufferedImage; | |
import java.io.ByteArrayOutputStream; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import javax.imageio.ImageIO; |
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
# start mongodb with --replSet rs | |
# the rs means replica set name | |
# if MONGO_INITDB_ROOT_USERNAME was set, then use those init db root username and password | |
mongo -u <your user name> --authenticationDatabase admin -p <your passowrd> | |
rs.initiate() |
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
alias activatejupyter='module load Anaconda/3-5.0.0.1 ; source activate jupyterlab_2.0.1' | |
alias rm='trash' # to avoid wrong delete | |
# use \rm -rf is you still want to delete all file | |
# make symbolic link to avoid disk file count usage | |
# ln -s <the short cut that you want to link (may not be exist)> <the real folder path(must exist)> |
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
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT | |
# https://serverfault.com/questions/200635/best-way-to-clear-all-iptables-rules | |
# To answer your question succinctly, no: there would not be any "leftover" rules after flushing every table. In the interest of being thorough however, you may want to set the policy for the built-in INPUT and FORWARD chains to ACCEPT, as well | |
iptables -P OUTPUT ACCEPT | |
iptables -t nat -F | |
iptables -t mangle -F | |
iptables -F | |
iptables -X |
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
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D |
OlderNewer