Shell Programming Shell Code Samples


Shell Script to Generate the SSH key and display it on output screen also create virtualenv
sandeep | 2 years, 8 months
export PATH=$WORKSPACE/resources/chromedriver/mac:$WORKSPACE/venv/bin:/usr/local/bin:$PATH
export P
shell auto ssh key
To delete all the none docker images in single shot.
ashokrebel007 | 2 years
docker rmi $(docker images | grep "^<none>" | awk "{print $3}") --force
shell docker
Shell Script to Monitor Site with Json content
sandeep | 2 years, 8 months
a=`curl --insecure -I SITE-NAME | awk 'NR==1 {print $2}'`
b=`wget -qO- --no-check-certificate SITEN
shell Site-Monitor
How to untrack/ unstage a file i.e already trackable by git
harika | 1 year, 9 months
git reset HEAD fileName.txt
git shell
copy a file and replace with another or original file
kishore_kumar | 2 years, 3 months
# way1

cp -f /path/to/file1.txt /another/path/to/file1.txt
How to check the logs around or at particular time in git
harika | 1 year, 9 months
#If you want to check the logs since 1 hour
git log --since="1 hour ago"

git shell
Remote copying (One centos machine to another centos machine)
ashokrebel007 | 2 years
scp filename username@ipaddress:destinationpath

For example :
shell centos
How to execute a curl command with bash script
Reshma | 1 year, 2 months
result=$(curl -n \
-X POST -H 'Content-Type: application/json' \
"give_url" \
shell curl with shell
How to find the port which is running and stop the process
Reshma | 1 year, 5 months
sudo lsof -i tcp:port //To find the port which is running

kill pid //kills the process which is r
shell kill port
How to install and read parquet files using cli
Reshma | 9 months, 2 weeks
pip install parquet-cli              # install parquet cli tool

parq filename.parquet --head 10  
cli shell parquet