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
#! /usr/bin/env python | |
import sys | |
ifile = open(sys.argv[1], 'r') | |
ofile = open(sys.argv[2], 'w') | |
for c, line in enumerate(ifile, 1): | |
ofile.write("{} {}".format(c,line)) | |
ifile.close() | |
ofile.close() |
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
# repo - https://github.com/xbalaji/git-hooks | |
wget https://raw.githubusercontent.com/xbalaji/git-hooks/master/setup-githooks.sh -q -O - | bash |
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
<script> | |
var d = new Date(); | |
var mm = (d.getMonth() + 1).toString().padStart(2, "0"); | |
var dd = (d.getDate()).toString().padStart(2, "0"); | |
var yy = ((d.getFullYear() %100).toString()).padStart(2, "0"); | |
var date_str = '' + mm + '-' + dd + '-' + yy; | |
</script> |
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
# make your browser your simple editor | |
# in the address bar type: | |
data:text/html,<html contenteditable> | |
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
startpyws () | |
{ | |
V=$(python -c 'import sys;print(sys.version_info.major)'); | |
if [ "$V" == "2" ]; then | |
python -m SimpleHTTPServer; | |
else | |
python -m http.server; | |
fi | |
} |
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 | |
docker run -d --name swagger -p 8080:8080 swaggerapi/swagger-editor | |
docker run -d --name dillinger -p 8090:8080 --restart="always" joemccann/dillinger:3.24.1 |
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
cd <basedir> | |
git clone ssh://git@<your git repo>:7999/fleet/fleet.git | |
cd <basedir>/fleet | |
git checkout -b xbtask01 | |
... make changes ... | |
cd <basedir>/fleet | |
git status | |
git commit -am "fixing issue, task01" | |
git push origin xbtask01 |
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 | |
brew list | |
brew cask list | |
brew update | |
brew outdated | |
brew upgrade | |
brew cask upgrade | |
brew cask upgrade --greedy | |
brew cleanup -n | |
brew cleanup |
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
# from https://superuser.com/questions/472476/is-there-an-automatically-scrolling-time-delayed-unix-pager-command | |
function scroll | |
{ | |
while read -r ; do echo "$REPLY" ; sleep ${1:-0.5} ; done | |
} | |
# assuming you have source code src directory | |
find src -type f -name "*c" -exec cat {} \; | scroll 0.2 | |
# use the following vimpager, asciinema, asciicast2gif |
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
# in a single line | |
echo "wget http://bit.ly/xb-do-unix -q -O test02.txt" | at now + 1 minutes | |
# using here document | |
at 6:26 PM << EOF | |
wget http://bit.ly/xb-do-unix -q -O test02.txt | |
EOF | |
# if there is no EOF given, use CTRL+D to terminate the commands |