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 re | |
| def print_dup_words(sentence): | |
| word_list = split_words(sentence) | |
| print(word_list) | |
| word_count = count_words(word_list) | |
| for key, val in word_count.items(): |
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
| gen_remote_host() { | |
| case $1 in | |
| "thor") r_host="10.189.50.0" | |
| user_name="thor" | |
| ;; | |
| "loki") r_host="10.189.16.251" | |
| user_name="loki" | |
| ;; | |
| esac | |
| } |
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 | |
| for filename in servers/*.txt; do | |
| for server in $(cat $filename) | |
| do | |
| user_name=$(cut -d'.' -f1 <<<$filename) | |
| user_name=$(cut -d'/' -f2 <<<$user_name) | |
| #echo $user_name | |
| if ssh $user_name'@'$server "true" | |
| then | |
| echo "Server $server: OK" |
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
| $ git remote add upstream git://github.com/kuroy/github-services.git | |
| $ git fetch upstream | |
| # then: (like "git pull" which is fetch + merge) | |
| $ git merge upstream/master master | |
| OR | |
| # or, better, replay your local work on top of the fetched branch | |
| # like a "git pull --rebase" |
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 | |
| case $# in | |
| 0) | |
| echo "Usage: $0 {start|stop}" | |
| exit 1 | |
| ;; | |
| 1) | |
| case $1 in | |
| start) |
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 | |
| # relaunch with sudo if we aren't root | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "$0: relaunching as sudo $0 $1 $USER" | |
| sudo "$0" $1 $USER | |
| exit $? | |
| fi | |
| real_user=$USER |
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
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)
$ git checkout masterFetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master
NewerOlder

