This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# access using netints iso and rescue mode | |
update-grub2 | |
grub-install /dev/sda | |
update-grub2 | |
exit | |
reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo /etc/init.d/transmission-daemon stop | |
sudo chown -R pi:pi /etc/transmission-daemon | |
sudo rm -rf ~pi/.config/transmission-daemon | |
sudo mv /etc/transmission-daemon ~pi/.config/ | |
sudo ln -s ~pi/.config/transmission-daemon /etc/transmission-daemon | |
sudo chown pi:pi /etc/default/transmission-daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# adapted from: | |
# https://stackoverflow.com/questions/9609130/quick-way-to-find-if-a-port-is-open-on-linux#9609247 | |
# exec 6<>/dev/tcp/ip.addr.of.server/445 | |
# echo -e "GET / HTTP/1.0\n" >&6 | |
# cat <&6 | |
( exec 6<>/dev/tcp/127.0.0.1/22 && echo 'ssh open!' )|| echo 'ssh closed' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -s ifconfig.me | |
curl -s 'https://api.ipify.org' | |
curl -s 'http://ipv4bot.whatismyipaddress.com/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "${OS}" = "Linux" ] ; then | |
KERNEL=`uname -r` | |
elif [ -f /etc/redhat-release ] ; then | |
DIST='RedHat' | |
PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//` | |
REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//` | |
elif [ -f /etc/SuSE-release ] ; then | |
DIST=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
UFW="sudo ufw" | |
$UFW --force reset | |
$UFW default allow incoming | |
$UFW default deny outgoing | |
$UFW deny out on eth0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo wpa_supplicant \ | |
-B \ | |
-iwlan0 \ | |
-c/etc/wpa_supplicant.conf \ | |
-Dwext | |
sudo dhclient wlan0 | |
sudo ifconfig wlan0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo sed -i 's/managed=false/managed=true/g' /etc/NetworkManager/NetworkManager.conf | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Because migrating to python 2.7.9 requires me to update my code (or ask my clients to add cafiles to their trust store | |
# [which some people don't know how to do]), I found a way to explicitly allow insecure connections (ie. without hostname | |
# verification) using urllib2.urlopen() | |
# | |
# This gist basically involves creating an ssl.SSLContext() with some options which disable hostname verification | |
# This allows you to, for instance, add a parameter to a function which disables hostname verification. | |
import ssl | |
import urllib2 | |
import logging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo systemctl disable teamviewerd.service | |
Removed /etc/systemd/system/multi-user.target.wants/teamviewerd.service. | |
exit 0 |
OlderNewer