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 | |
# 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 | |
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 |
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 | |
GCC_INSTLLR="https://raw.githubusercontent.com/gecos-team/gecoscc-installer/development/gecoscc-installer.sh" | |
GCC_VERSION=`curl -s "$GCC_INSTLLR" | grep 'export GECOSCC_VERSION' | cut -d"'" -f2` | |
GCC_TMPLATE=`curl -s "$GCC_INSTLLR" | grep 'export TEMPLATES_URL' | cut -d'"' -f2 | sed -e 's/$GECOSCC_VERSION/'"$GCC_VERSION"'/'` | |
# sed 's/xxx/'"$PWD"'/' | |
echo "Template -> $GCC_TMPLATE" |
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 | |
# I've tried to copy files from linux using vinagre (I like it most for RDP connections) | |
# but it is simplier that rdesktop. | |
# | |
# You just have to connect using the option -r disk:share=local_dir and go to a volume | |
# called 'share in your_machine' and copy the file | |
/usr/bin/rdesktop 10.10.10.10 -u admin -d myDomain -r disk:share=/home/n1mh/tmp |
OlderNewer