Skip to content

Instantly share code, notes, and snippets.

View NanoAi's full-sized avatar
🏠
Working from home

NanoAi NanoAi

🏠
Working from home
View GitHub Profile
@NanoAi
NanoAi / gist:2d3440014cba9c2d3f6c
Created August 16, 2015 06:24
Hosts File Generator for Linux and Mac
#!/bin/bash
echo "/etc/hosts | Stats" && stat -x /etc/hosts && echo -n "Number of Lines: " && wc -l /etc/hosts && echo -n "MD5: " && md5 /etc/hosts
echo -e "\n-------------------------\n"
cp ~/bakup.hosts ~/hosts.uniq
curl --silent http://someonewhocares.org/hosts/hosts | grep '^127.0.0.1' >> ~/hosts.uniq && echo "someonewhocares.org : DONE"
curl --silent http://www.malwaredomainlist.com/hostslist/hosts.txt | grep '^127.0.0.1' >> ~/hosts.uniq && echo "malwaredomainlist.org : DONE"
curl --silent https://adaway.org/hosts.txt | grep '^127.0.0.1' >> ~/hosts.uniq && echo "adaway.org : DONE"
curl --silent http://winhelp2002.mvps.org/hosts.txt | grep '^127.0.0.1' >> ~/hosts.uniq && echo "mvps.org : DONE"
curl --silent http://hosts-file.net/ad_servers.txt | grep '^127.0.0.1' >> ~/hosts.uniq && echo "hosts-file.net : DONE"
@NanoAi
NanoAi / screencap.sh
Created June 7, 2015 20:12
Script for screencapture and auto send to server, on Mac OSX Yosemite.
SITE="http://i.mirai.red";
DIR=~/Screenshots/;
SSH=root@baka.ovh;
FLDR=/home/i.mirai.red;
NM=$(LC_CTYPE=C tr -dc "a-zA-Z0-9" < /dev/urandom | head -c 5).png;
FILE=$(screencapture -i $DIR$NM && echo $DIR$(ls -Art $DIR | tail -n 1));
if [ -a $FILE ] ; then
@NanoAi
NanoAi / NodeJS-Installer.sh
Last active August 29, 2015 14:15
Shell script for installing NodeJS
echo "Hello, we will now install NodeJS & NPM."
read -p "Would you like to remove an old install first? (Y/n) " -n 1 -r && echo ""
if [[ $REPLY =~ ^[Yy]$ || ! $REPLY ]]
then
sudo apt-get remove nodejs
sudo apt-get remove npm
sudo apt-get autoremove
echo ""
fi