Skip to content

Instantly share code, notes, and snippets.

View gyermolenko's full-sized avatar

Grygorii Iermolenko gyermolenko

View GitHub Profile
@gyermolenko
gyermolenko / .bashrc
Created April 21, 2017 15:26
Kill process in running docker container by its name
dkill() {
# Example:
# $ dkill <container_name> <process_name>
if [[ $# -ne 2 ]] ; then
echo "dkill [container name] [process name]"
return 1
fi
local pid=$(docker exec -it $1 ps aux | grep $2 | awk '{ print $2 }')
@gyermolenko
gyermolenko / check_and_copy.sh
Last active April 2, 2018 12:51
bash script to copy folders if they are not present in destination
FROM="from"
TO="to"
for i in $( ls $FROM); do
if [ -d "$TO/$i" ]; then
echo "$TO/$i exists"
else
cp -r $FROM/$i $TO/$i
fi
done