Wishing all of you a merry Christmas
Cheers!!!
Cheers!!!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
RESUME=none
sudo update-initramfs -u -k all
set SWITCH(ignore) 1
sudo apt-get install tcl
~/Downloads/Videos/Movies/Action/Terminator/
cd Downloads/Videos/Movies/Action/Terminator/
cd "../ ../"
sudo apt-get install go2
go2; source $HOME/.bashrc
go2 Terminator
Go2 Term
go2 Videos
go2 Vid
go2 Do
a: ~/Documents
b: ~/Downloads
man go2
sudo pmiab
Block Internet Adverts
Unblock Internet Adverts
#!/usr/bin/env bash
########
function byye (){
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "One man's advertising is another man's malware"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
sleep 1
tput sgr0
printf "\033c"
exit 0
}
########
function pm_unblock (){
pmcp=$(which cp)
pmrm=$(which rm)
if [ ! -f /etc/hosts-block ]; then
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "Ad-blocking hosts not in use! Nothing to unblock!"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo ""
read -r -s -p $'Press Any Key To Return To Main Menu...\n' -n1
starrt
fi
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "Replacing the original hosts file..."
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
sleep 1
"$pmcp" /etc/hosts-system /etc/hosts
chmod 644 /etc/hosts
"$pmrm" -f /etc/hosts-system
"$pmrm" -f /etc/hosts-block
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "All done!!! Original system hosts file restored!!!"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo ""
read -r -s -p $'Press Any Key To Return To Main Menu...\n' -n1
starrt
}
########
function pm_block (){
pmcp=$(which cp)
hosts_cooking=$(mktemp)
hosts_cooked=$(mktemp)
datum=$(date +%d-%m-%Y:%H:%M:%S)
pmrm=$(which rm)
if [ ! -f /etc/hosts-system ]; then
"$pmcp" /etc/hosts /etc/hosts-system
chmod 444 /etc/hosts-system
fi
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "Downloading ad-blocking hosts files..."
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
wget -nv -O - "http://winhelp2002.mvps.org/hosts.txt" >> "$hosts_cooking" || { "$pmrm" -f "$hosts_cooking"; "$pmrm" -f "$hosts_cooked"; printf "\033c"; echo ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo ""; echo -e '\e[38;5;82m' "OOPS!! Failed to download \"mvps\" hosts file!!"; echo -e '\e[38;5;82m' "Make sure your internet connection is active!"; echo -e '\e[38;5;82m' "If the problem persists you can report it at,"; echo -e '\e[38;5;82m' "GitHub repository of the project by creating,"; echo -e '\e[38;5;82m' "an issue there. Here is the link to the repo,"; echo ""; echo -e '\e[38;5;82m' "https://github.com/hakerdefo/pmiab"; echo ""; echo -e '\e[38;5;82m' "If you don't use GitHub you can report it by,"; echo -e '\e[38;5;82m' "emailing the author at the following address,"; echo ""; echo -e '\e[38;5;82m' "hakerdefo (at) gmail (dot) com"; echo ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo ""; tput sgr0; exit 1; }
wget -nv -O - "http://hosts-file.net/ad_servers.asp" >> "$hosts_cooking" || { "$pmrm" -f "$hosts_cooking"; "$pmrm" -f "$hosts_cooked"; printf "\033c"; echo ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo ""; echo -e '\e[38;5;82m' "OOPS!! Failed to download \"hpHo\" hosts file!!"; echo -e '\e[38;5;82m' "Make sure your internet connection is active!"; echo -e '\e[38;5;82m' "If the problem persists you can report it at,"; echo -e '\e[38;5;82m' "GitHub repository of the project by creating,"; echo -e '\e[38;5;82m' "an issue there. Here is the link to the repo,"; echo ""; echo -e '\e[38;5;82m' "https://github.com/hakerdefo/pmiab"; echo ""; echo -e '\e[38;5;82m' "If you don't use GitHub you can report it by,"; echo -e '\e[38;5;82m' "emailing the author at the following address,"; echo ""; echo -e '\e[38;5;82m' "hakerdefo (at) gmail (dot) com"; echo ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo ""; tput sgr0; exit 1; }
wget -nv -O - "http://someonewhocares.org/hosts/hosts" >> "$hosts_cooking" || { "$pmrm" -f "$hosts_cooking"; "$pmrm" -f "$hosts_cooked"; printf "\033c"; echo ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo ""; echo -e '\e[38;5;82m' "OOPS!! Failed to download \"sowc\" hosts file!!"; echo -e '\e[38;5;82m' "Make sure your internet connection is active!"; echo -e '\e[38;5;82m' "If the problem persists you can report it at,"; echo -e '\e[38;5;82m' "GitHub repository of the project by creating,"; echo -e '\e[38;5;82m' "an issue there. Here is the link to the repo,"; echo ""; echo -e '\e[38;5;82m' "https://github.com/hakerdefo/pmiab"; echo ""; echo -e '\e[38;5;82m' "If you don't use GitHub you can report it by,"; echo -e '\e[38;5;82m' "emailing the author at the following address,"; echo ""; echo -e '\e[38;5;82m' "hakerdefo (at) gmail (dot) com"; echo ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo ""; tput sgr0; exit 1; }
wget -nv -O - "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext" >> "$hosts_cooking" || { "$pmrm" -f "$hosts_cooking"; "$pmrm" -f "$hosts_cooked"; printf "\033c"; echo ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo ""; echo -e '\e[38;5;82m' "OOPS!! Failed to download \"yoyo\" hosts file!!"; echo -e '\e[38;5;82m' "Make sure your internet connection is active!"; echo -e '\e[38;5;82m' "If the problem persists you can report it at,"; echo -e '\e[38;5;82m' "GitHub repository of the project by creating,"; echo -e '\e[38;5;82m' "an issue there. Here is the link to the repo,"; echo ""; echo -e '\e[38;5;82m' "https://github.com/hakerdefo/pmiab"; echo ""; echo -e '\e[38;5;82m' "If you don't use GitHub you can report it by,"; echo -e '\e[38;5;82m' "emailing the author at the following address,"; echo ""; echo -e '\e[38;5;82m' "hakerdefo (at) gmail (dot) com"; echo ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo ""; tput sgr0; exit 1; }
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "Parsing, Cleaning, De-Duplicating, Sorting..."
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
sleep 1
sed -e 's/\r//' -e '/^127.0.0.1/!d' -e '/localhost/d' -e 's/127.0.0.1/0.0.0.0/' -e 's/ \+/\t/' -e 's/#.*$//' -e 's/[ \t]*$//' < "$hosts_cooking" | sort -u > "$hosts_cooked"
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "Merging ad-blocking hosts with original system hosts..."
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
sleep 1
echo -e "\n# Ad blocking list generated on $datum" | cat /etc/hosts-system - "$hosts_cooked" > /etc/hosts-block
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "Doing some clean-up..."
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
sleep 1
"$pmrm" -f "$hosts_cooking"
"$pmrm" -f "$hosts_cooked"
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "Installing pmiab generated hosts file..."
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
sleep 1
"$pmcp" /etc/hosts-block /etc/hosts
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "All done!!! Enjoy the internet without those pesky adverts!!!"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo ""
read -r -s -p $'Press Any Key To Return To Main Menu\n' -n1
starrt
}
########
function pm_netchk (){
wget --spider --user-agent="Mozilla/5.0 Gecko/20100101" --timeout=30 -q "www.google.com" -O /dev/null
RETVAL=$?
case "$RETVAL" in
0)
pm_block
;;
*)
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "No active internet connection available!!"
echo -e '\e[38;5;82m' "Please check your internet connectivity!!"
echo -e '\e[38;5;82m' "Active internet connection is required to"
echo -e '\e[38;5;82m' "download necessary adblocking hosts files"
echo ""
echo ""
read -r -s -p $'Press Any Key To Return To Main Menu\n' -n1
starrt
;;
esac
}
########
function starrt (){
if [ "$EUID" -ne 0 ]; then
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "You must run \"pmiab\" script using \"sudo\" or as the root user."
echo -e '\e[38;5;82m' "Hint : \"sudo pmiab\" or \"su -c 'pmiab'\""
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
tput sgr0
exit 1
fi
printf "\033c"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo -e '\e[38;5;82m' "pmiab - (Poor Man's Internet Ad Blocker) blocks ads system-wide"
echo ""
{ for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; }
echo ""
echo ""
echo -e '\e[38;5;82m' "01 Block Internet Adverts"
echo -e '\e[38;5;82m' "02 Unblock Internet Adverts"
echo -e '\e[38;5;82m' "03 Quit pmiab"
echo -e ""
echo -e ""
echo -e '\e[38;5;82m' "Enter Your Choice: "
echo -e ""
read -r Choice
case $Choice in
01 | 1)
pm_netchk
;;
02 | 2)
pm_unblock
;;
03 | 3)
byye
;;
*)
printf "\033c"
echo -e ""
echo -e ""
echo -e '\e[38;5;82m' "\"$Choice\" Is An Invalid Option!"
echo -e ""
echo -e '\e[38;5;82m' "Correct Options To Choose From Are 1-2-3"
echo -e ""
echo -e '\e[38;5;82m' "To block internet adverts press \"1\" & hit \"Enter\" key"
echo -e '\e[38;5;82m' "To restore original hosts press \"2\" & hit \"Enter\" key"
echo -e '\e[38;5;82m' "To exit from pmiab script press \"3\" & hit \"Enter\" key"
echo -e '\e[38;5;82m' "Got It?!? Ready To Give It Another Go?!?"
echo -e ""
read -r -s -p $'Press Any Key To Try Again...\n' -n1
starrt
;;
esac
}
########
while :
do
starrt
done
PARAMS="-c -b $BUFFER"
## for mr-know-all:
# BUFFER=3000
# PLAYER="mpg123" # you can try with streamripper, mplayer, vlc, ...
# PARAMS="--silent-whore --shut-the-fuck-up-smoothly --asshole-on-fire -b $BUFFER" # depends on the $PLAYER, make *your* choices and stop fucking discussing what whoreface parameters you suggest
medit ~/.fluxbox/init
session.screen0.allowRemoteActions: false
session.screen0.allowRemoteActions: true
sudo apt-get install hicolor-icon-theme
sudo cp vsido-exit /usr/local/bin/
sudo chmod 755 /usr/local/bin/vsido-exit
sudo cp logout_exit.png logout_logo.png logout_reboot.png logout_shutdown.png logout_suspend.png logout_window.png /usr/share/pixmaps/
#!/usr/bin/env bash
function bye_bye (){
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"A screenshot is an image of the display on a computer screen."
echo -e '\E[1;32;49m'"But you already knew that so,"
echo -e '\E[1;32;49m'"Bye, Ciao, Adios."
echo -e ""
sleep 4
printf "\033c"
tput sgr0
exit 0
}
function imgur_upload (){
type curl >/dev/null 2>&1
RETVAL=$?
if [[ ! "$RETVAL" == 0 ]]; then
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"pmss requires \"cURL\" to upload to imgur."
echo -e '\E[1;32;49m'"Install \"curl\" via your package-manager."
echo -e ""
fi
printf "\033c"
response=$(curl -s --connect-timeout 30 --user-agent "Mozilla/5.0 Gecko/20100101" -H "Authorization: Client-ID $client_id" -H "Expect: " -F "image=@$NAME" https://api.imgur.com/3/image.xml 2>/dev/null)
RETVAL=$?
if [[ ! "$RETVAL" == 0 ]]; then
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"pmss cannot connect to \"imgur\"."
echo -e '\E[1;32;49m'"Check your internet connection."
echo -e ""
tput sgr0
read -rsp $'Press Any Key To Return To PMSS MENU..\n' -n1
MenU
else
URL3="${response##*<link>}"
URL2="${URL3%%</link>*}"
URL=$(echo "$URL2" 2>/dev/null | sed 's/^http:/https:/')
BASE_URL="${URL%.*}"
BASE_EXT="${URL##*.}"
DEL_HASH2="${response##*<deletehash>}"
DEL_HASH="${DEL_HASH2%%</deletehash>*}"
DEL_URL="https://imgur.com/delete/$DEL_HASH"
printf "\033c"
echo -e '\E[1;32;49m'"DIRECT LINK"
echo -e '\E[1;32;49m'"Original : "'\E[0;32;49m'"$URL"
echo -e '\E[1;32;49m'"Thumbnail : "'\E[0;32;49m'""$BASE_URL"m."$BASE_EXT""
echo -e ""
echo -e '\E[1;32;49m'"BBCODE (FORUMS, MESSAGE BOARDS, ETC.)"
echo -e '\E[1;32;49m'"Original : "'\E[0;32;49m'"[img]$URL[/img]"
echo -e '\E[1;32;49m'"Thumbnail : "'\E[0;32;49m'"[url=$BASE_URL][img]"$BASE_URL"m."$BASE_EXT"[/img][/url]"
echo -e ""
echo -e '\E[1;32;49m'"MARKDOWN (REDDIT, GITHUB, ETC.)"
echo -e '\E[1;32;49m'"Original : "'\E[0;32;49m'"[$SHORT_NAME]($URL)"
echo -e '\E[1;32;49m'"Thumbnail : "'\E[0;32;49m'"[$SHORT_NAME]("$BASE_URL"m."$BASE_EXT")"
echo -e ""
echo -e '\E[1;32;49m'"HTML (WEBSITES, BLOGS, ETC.)"
echo -e '\E[1;32;49m'"Original : "'\E[0;32;49m'"<a href="$BASE_URL"><img src="$URL" title="source: imgur.com" /></a>"
echo -e '\E[1;32;49m'"Thumbnail : "'\E[0;32;49m'"<a href="$BASE_URL"><img src=""$BASE_URL"m."$BASE_EXT"" title="source: imgur.com" /></a>"
echo -e ""
echo -e '\E[1;32;49m'"IMAGE DELETE LINK"
echo -e '\E[1;32;49m'"Delete url: "'\E[0;32;49m'"$DEL_URL"
echo -e ""
tput sgr0
read -rsp $'Press Any Key To Return To PMSS MENU..\n' -n1
MenU
fi
}
function area_mouse (){
printf "\033c"
DATE="$(date +%d%m%y-%H%M%S)"
SHORT_NAME="Shot-${DATE}.png"
NAME="${DIR}/${SHORT_NAME}"
echo -e ""
echo -e '\E[1;32;49m'"Draw A Rectangle On The Screen And Area Inside It Will Be Captured.."
echo -e ""
scrot -s "${NAME}"
printf "\033c"
echo -e ""
echo -e '\E[0;32;49m'"$SHORT_NAME"'\E[1;32;49m'" Saved in "'\E[0;32;49m'"$DIR"
echo -e ""
type xdg-open >/dev/null 2>&1
RETVAL=$?
if [[ "$RETVAL" == 0 ]]; then
xdg-open "${NAME}"
else
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"pmss unable to open saved shot."
echo -e '\E[1;32;49m'"Install \"xdg-utils\" to do this."
echo -e ""
fi
echo -e ""
echo -e '\E[1;32;49m'"Would you like to upload the shot to imgur?"
echo -e ""
echo -e '\E[1;32;49m'"Press \"Y\" to upload the shot to imgur"
echo -e '\E[1;32;49m'"Press \"N\" to go back to the main menu"
echo -e ""
echo -e '\E[1;32;49m'"Enter Your Choice: "
echo -e ""
tput sgr0
read -er Choice
case "$Choice" in
"Y" | "y")
imgur_upload
;;
"N" | "n")
printf "\033c"
MenU
;;
*)
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"\"$Choice\" Is An Invalid Choice!!!"
echo -e ""
echo -e '\E[1;32;49m'"Correct Options To Choose Are From Y-N"
echo -e ""
echo -e '\E[1;32;49m'"To upload image to imgur, press \"Y\""
echo -e '\E[1;32;49m'"To go back the main menu, press \"N\""
echo -e '\E[1;32;49m'"Got it? It is not that hard you see"
echo -e ""
tput sgr0
read -r -s -p $'Press Any Key To Continue...\n' -n1
MenU
;;
esac
}
function window_focus (){
printf "\033c"
DATE="$(date +%d%m%y-%H%M%S)"
SHORT_NAME="Shot-${DATE}.png"
NAME="${DIR}/${SHORT_NAME}"
echo -e ""
echo -e '\E[1;32;49m'"Minimize Terminal And Bring The Window To Be Captured In Focus.."
echo -e ""
scrot -u -d10 -b -c "${NAME}"
printf "\033c"
echo -e ""
echo -e '\E[0;32;49m'"$SHORT_NAME"'\E[1;32;49m'" Saved in "'\E[0;32;49m'"$DIR"
echo -e ""
type xdg-open >/dev/null 2>&1
RETVAL=$?
if [[ "$RETVAL" == 0 ]]; then
xdg-open "${NAME}"
else
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"pmss unable to open saved shot."
echo -e '\E[1;32;49m'"Install \"xdg-utils\" to do this."
echo -e ""
fi
echo -e ""
echo -e '\E[1;32;49m'"Would you like to upload the shot to imgur?"
echo -e ""
echo -e '\E[1;32;49m'"Press \"Y\" to upload the shot to imgur"
echo -e '\E[1;32;49m'"Press \"N\" to go back to the main menu"
echo -e ""
echo -e '\E[1;32;49m'"Enter Your Choice: "
echo -e ""
tput sgr0
read -er Choice
case "$Choice" in
"Y" | "y")
imgur_upload
;;
"N" | "n")
printf "\033c"
MenU
;;
*)
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"\"$Choice\" Is An Invalid Choice!!!"
echo -e ""
echo -e '\E[1;32;49m'"Correct Options To Choose Are From Y-N"
echo -e ""
echo -e '\E[1;32;49m'"To upload image to imgur, press \"Y\""
echo -e '\E[1;32;49m'"To go back the main menu, press \"N\""
echo -e '\E[1;32;49m'"Got it? It is not that hard you see"
echo -e ""
tput sgr0
read -r -s -p $'Press Any Key To Continue...\n' -n1
MenU
;;
esac
}
function entire_area (){
printf "\033c"
DATE="$(date +%d%m%y-%H%M%S)"
SHORT_NAME="Shot-${DATE}.png"
NAME="${DIR}/${SHORT_NAME}"
echo -e ""
echo -e '\E[1;32;49m'"Minimize Terminal To Avoid It From Being Captured.."
echo -e ""
scrot -d10 -c "${NAME}"
printf "\033c"
echo -e ""
echo -e '\E[0;32;49m'"$SHORT_NAME"'\E[1;32;49m'" Saved in "'\E[0;32;49m'"$DIR"
echo -e ""
type xdg-open >/dev/null 2>&1
RETVAL=$?
if [[ "$RETVAL" == 0 ]]; then
xdg-open "${NAME}"
else
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"pmss unable to open saved shot."
echo -e '\E[1;32;49m'"Install \"xdg-utils\" to do this."
echo -e ""
fi
echo -e ""
echo -e '\E[1;32;49m'"Would you like to upload the shot to imgur?"
echo -e ""
echo -e '\E[1;32;49m'"Press \"Y\" to upload the shot to imgur"
echo -e '\E[1;32;49m'"Press \"N\" to go back to the main menu"
echo -e ""
echo -e '\E[1;32;49m'"Enter Your Choice: "
echo -e ""
tput sgr0
read -er Choice
case "$Choice" in
"Y" | "y")
imgur_upload
;;
"N" | "n")
printf "\033c"
MenU
;;
*)
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"\"$Choice\" Is An Invalid Choice!!!"
echo -e ""
echo -e '\E[1;32;49m'"Correct Options To Choose Are From Y-N"
echo -e ""
echo -e '\E[1;32;49m'"To upload image to imgur, press \"Y\""
echo -e '\E[1;32;49m'"To go back the main menu, press \"N\""
echo -e '\E[1;32;49m'"Got it? It is not that hard you see"
echo -e ""
tput sgr0
read -r -s -p $'Press Any Key To Continue...\n' -n1
MenU
;;
esac
}
function MenU (){
printf "\033c"
type scrot >/dev/null 2>&1 || { printf "\033c"; echo -e ""; echo -e '\E[1;32;49m'"A required pmss dependency \"Scrot\" is not present."; echo -e '\e[1;32;49m'"\"Scrot\" is available for almost all linux distros."; echo -e '\e[1;32;49m'"Please install \"scrot\" using your package manager."; echo -e ""; tput sgr0; exit 1; }
DIR="${HOME}/Pictures/Screenshots"
if [ ! -d "${DIR}" ]; then mkdir --parents "${DIR}"; fi
client_id="af2f809b77dea2c"
echo -e '\E[1;32;49m'"** PMSS<>MENU *************************************************"
echo -e ""
echo -e ""
echo -e '\E[1;32;49m'"** Select One Of The Following Options"
echo -e ""
echo -e '\E[1;32;49m'"** Enter \"E\" To Take The Screenshot Of The Entire Screen"
echo -e '\E[1;32;49m'"** Enter \"W\" To Take The Screenshot Of Window In Focus"
echo -e '\E[1;32;49m'"** Enter \"A\" To Take The Screenshot Of Area Selected By Mouse"
echo -e '\E[1;32;49m'"** Enter \"Q\" To Exit"
echo -e ""
echo -e '\E[1;32;49m'"***************************************************************"
echo -e ""
tput sgr0
read -er Options
case "$Options" in
"E" | "e")
entire_area
;;
"W" | "w")
window_focus
;;
"A" | "a")
area_mouse
;;
"Q" | "q")
bye_bye
;;
*)
printf "\033c"
echo -e ""
echo -e '\E[1;32;49m'"\"$Options\" Is An Invalid Option!!!"
echo -e ""
echo -e '\E[1;32;49m'"Correct Options To Choose Are From E-W-A-Q"
echo -e ""
echo -e '\E[1;32;49m'"To Take The Screenshot Of The Entire Screen, Press \"E\" & Hit \"Enter\" Key"
echo -e '\E[1;32;49m'"To Take The Screenshot Of Window In Focus, Press \"W\" & Hit \"Enter\" Key"
echo -e '\E[1;32;49m'"To Take The Screenshot Of Area Selected By Mouse, Press \"A\" & Hit \"Enter\" Key"
echo -e '\E[1;32;49m'"To Exit From PMSS, Press \"Q\" & Hit \"Enter\" Key"
echo -e ""
tput sgr0
read -rsp $'Press Any Key To Return To PMSS MENU..\n' -n1
MenU
;;
esac
}
while :
do
MenU
done
sudo apt-get install xmlstarlet
sudo apt-get install curl
sudo apt-get install wget
sudo apt-get install coreutils
#!/usr/bin/env bash
###the-script-begins###
###
type curl >/dev/null 2>&1 || { printf "\033c"; echo -e ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo -e ""; echo -e '\e[38;5;82m'"A required dependency \"cURL\" is unavailable"; echo -e '\e[38;5;82m'"\"cURL\" is available for almost all linux distros."; echo -e '\e[38;5;82m'"Please install \"curl\" using your package manager."; echo -e '\e[38;5;82m'"Please visit the homepage of \"cURL\" for more info"; echo -e '\e[38;5;82m'"https://curl.haxx.se/"; echo -e ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo -e ""; tput sgr0; exit 1; }
type wget >/dev/null 2>&1 || { printf "\033c"; echo -e ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo -e ""; echo -e '\e[38;5;82m'"A required dependency \"Wget\" is unavailable"; echo -e '\e[38;5;82m'"\"Wget\" is available for almost all linux distros."; echo -e '\e[38;5;82m'"Please install \"wget\" using your package manager."; echo -e '\e[38;5;82m'"Please visit the homepage of \"Wget\" for more info"; echo -e '\e[38;5;82m'"https://www.gnu.org/software/wget/"; echo -e ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo -e ""; tput sgr0; exit 1; }
type xmlstarlet >/dev/null 2>&1 || { printf "\033c"; echo -e ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo -e ""; echo -e '\e[38;5;82m'"A required dependency \"XMLStarlet\" is unavailable"; echo -e '\e[38;5;82m'"\"XMLStarlet\" is available for almost all linux distros."; echo -e '\e[38;5;82m'"Please install \"xmlstarlet\" using your package manager."; echo -e '\e[38;5;82m'"Please visit the homepage of \"XMLStarlet\" for more info"; echo -e '\e[38;5;82m'"http://xmlstar.sourceforge.net/"; echo -e ""; for i in {16..51} {51..16}; do echo -en "\e[38;5;${i}m#\e[0m"; done; echo; echo -e ""; tput sgr0; exit 1; }
wget --spider --user-agent="Mozilla/5.0 Gecko/20100101" --timeout=30 -q "www.google.com" -O /dev/null
RETVAL=$?
if [[ ! "$RETVAL" == 0 ]]; then
echo -e ""
echo -e "Internet Connection Seems Down."
echo -e ""
exit
fi
local_user="gmail_username"
local_pass="gmail_password"
local_count="5"
local_rm=$(which rm)
curl --silent --connect-timeout 30 --user-agent "Mozilla/5.0 Gecko/20100101" "https://"$local_user":"$local_pass"@mail.google.com/mail/feed/atom" -o /tmp/cgmail.xml
grep "401" "/tmp/cgmail.xml"
RETVAL=$?
if [[ "$RETVAL" == 0 ]]; then
echo -e ""
echo -e "Incorrect username or password."
echo -e ""
"$local_rm" "/tmp/cgmail.xml"
exit
fi
mail_count=$(xmlstarlet sel -N x="http://purl.org/atom/ns#" -t -m '//x:feed' -v x:fullcount -n /tmp/cgmail.xml)
if [[ "$local_count" == 0 ]]; then
echo -e ""
echo -e "$local_user :: No New Email."
echo -e ""
"$local_rm" "/tmp/cgmail.xml"
exit
fi
if (( "$local_count" < "$mail_count" )); then
final_count="$local_count"
else
final_count="$mail_count"
fi
local_subject=$(cat "/tmp/cgmail.xml" | xmlstarlet sel -N x="http://purl.org/atom/ns#" -t -m "//x:entry[position()<=$final_count]" -v x:title -n)
mail_date=$(cat "/tmp/cgmail.xml" | xmlstarlet sel -N x="http://purl.org/atom/ns#" -t -m "//x:entry[position()<=$final_count]" -v x:issued -n)
local_date=$(while IFS= read -r line ; do date -d"$line" +%y-%m-%d ; done <<< "$mail_date")
echo -e ""
echo -e "$local_user :: \"$mail_count\" New Emails."
echo -e ""
pr -m -t <(echo "$local_date") <(echo "$local_subject")
echo -e ""
"$local_rm" "/tmp/cgmail.xml"
exit 0
###
###the-script-ends###
local_user="gmail_username"
local_pass="gmail_password"
local_count="5"
chmod 755 /path/to/check-gmail
execi 600 bash /path/to/check-gmail
sudo apt-get install perl
sudo apt-get install libxml-simple-perl
sudo apt-get install libwww-perl
#!/usr/bin/perl
use strict;
use XML::Simple;
use LWP::Simple;
my $u = $ARGV[0];
my $p = $ARGV[1];
my $xmldata = get("https://$u:$p\@mail.google.com/mail/feed/atom");
my $xml = new XML::Simple;
my $data = $xml->XMLin($xmldata);
my @arr = reverse sort keys %{$data->{'entry'}};
if (@arr != 0 ) {
print "[$u] :: New mails ". @arr ."\n";
my $n = 3;
$n = @arr if @arr < 3;
for(my $i = 0; $i < $n; $i++) {
my $title = substr $data->{'entry'}->{$arr[$i]}->{'title'}, 0, 45;
my $frm = substr $data->{'entry'}->{$arr[$i]}->{'author'}->{'name'}, 0, 30;
my $dt = substr $data->{'entry'}->{$arr[$i]}->{'modified'}, 0, 10;
print "\n";
print "From: $frm, Date: $dt\n";
print "$title\n";
}
print "\n";
} else {
print "No new mail..\n";
}
exit 0;
my $n = 3;
chmod 755 /path/to/check-gmail.pl
execi 600 perl /path/to/check-gmail.pl "your_gmail_username" "your_gmail_password"