Skip to content

Instantly share code, notes, and snippets.

View kushal-r's full-sized avatar
🎯
Focusing

Kushal kushal-r

🎯
Focusing
View GitHub Profile
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():
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
}
#!/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"
$ 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"
@kushal-r
kushal-r / iterm2-solarized.md
Created November 27, 2019 09:06 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@kushal-r
kushal-r / global-protect.sh
Created August 20, 2019 17:51 — forked from kaleksandrov/global-protect.sh
Simple script that starts and stops GlobalProtect.app on Mac OSX.
#!/bin/bash
case $# in
0)
echo "Usage: $0 {start|stop}"
exit 1
;;
1)
case $1 in
start)
#!/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
@kushal-r
kushal-r / git-tag-delete-local-and-remote.sh
Created May 28, 2019 06:47 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# 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
@kushal-r
kushal-r / Update-branch.md
Created May 28, 2019 05:54 — forked from santisbon/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

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 master

Fetch 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

@kushal-r
kushal-r / README.md
Created May 13, 2019 17:18 — forked from steve-jansen/README.md
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep