Skip to content

Instantly share code, notes, and snippets.

View aytacworld's full-sized avatar

Adem Aytac aytacworld

View GitHub Profile
@aytacworld
aytacworld / compress-pdf
Created July 16, 2018 08:21
compress-scanned pdf files
#!/bin/bash
if [ -z "${1}" ]; then
echo "please use it as 'compress-pdf <filename>'"
else
FILE=$1
NEW_FILE=${FILE}.new.pdf
echo compressing $FILE
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="${NEW_FILE}" "${FILE}"
ORIG_SIZE=$(ls "$FILE" -s | cut -d " " -f 1)
@aytacworld
aytacworld / init.sh
Created March 12, 2018 14:34
bash commend to run after installing a fresh vm on a cloud serviceprovider
#!/bin/bash
read -p "Enter your ip: " IP
read -p "Enter your hostname: (myserver) " HOSTNAME
read -p "Enter your domainname: (domain.com) " DOMAIN
FQDN=$HOSTNAME.$DOMAIN
# Update the system
apt-get update
apt-get upgrade -y