Skip to content

Instantly share code, notes, and snippets.

View obatiuk's full-sized avatar
🇺🇦
#StandWithUkraine

Oleksii Batiuk obatiuk

🇺🇦
#StandWithUkraine
View GitHub Profile
@obatiuk
obatiuk / shred
Created March 11, 2017 04:27
folder shred example
#!/bin/bash
if dialog=`zenity --window-icon=warning --question --title="Secure Delete" --no-wrap --text="Are you sure you want to securely delete:\n\n $1\n\nand any other files and folders selected? File data will be overwritten and cannot be recovered."`
then /usr/bin/srm -fllrv "$@"| zenity --progress --pulsate --text="File deletion in progress..." --title="Secure Delete" --auto-close
fi
@obatiuk
obatiuk / tomcat.service
Created February 24, 2017 05:54
Example systemd unit file for tomcat 7.x
# Systemd unit file for tomcat 7.x
[Unit]
Description=Apache Tomcat 7.x Web Application Container
Wants=syslog.target network.target
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/java/latest
@obatiuk
obatiuk / check-url.sh
Created February 21, 2017 04:50
This script prints HTTP code for the supplied url
#!/bin/bash
url=$1
# Make a HEAD request to the supplied URL
code=$(curl $url -s -L -I -o /dev/null -w '%{http_code}')
if [ $code != "200" ]; then
# Some servers might reject HEAD requests. Downloading 1st byte of the data to get a code
code=$(curl --max-filesize 1 $url -s -L -o /dev/null -w '%{http_code}')
fi
echo $code

Keybase proof

I hereby claim:

  • I am obatiuk on github.
  • I am obatiuk (https://keybase.io/obatiuk) on keybase.
  • I have a public key ASDyMzcbQ_ZM0prRqugouarviLYpY1LQcf_xuv7zooU_kgo

To claim this, I am signing this object: