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
### Variables | |
UHOME=/home/$(logname) | |
GID=$(id -g $(basename $UHOME)) | |
USRID=$(id -u $(basename $UHOME)) | |
DOMAIN=YOUR-DOMAIN.ORG | |
## create keytab | |
function create_tkt { | |
ktutil > /dev/null <<INTER | |
add_entry -password -p $AUSER@$DOMAIN -k 0 -e aes256-sha1 |
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
yum update | |
reboot | |
## Repos configuration | |
subscription-manager config --rhsm.manage_repos=1 | |
subscription-manager repos --enable rhel-6-server-extras-rpms | |
echo “notify_only=0” >> /etc/yum/pluginconf.d/search-disabled-repos.conf |
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
menuentry "Windows custom" { | |
insmod part_gpt | |
insmod fat | |
insmod chain | |
search --no-floppy --fs-uuid --set={EFI partition UUID} | |
chainloader /EFI/Microsoft/Boot/bootmgfw.efi | |
} |
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
import requests as req | |
import json | |
def telegram_bot_sendtext(bot_message): | |
bot_token = '' | |
bot_chatID = '' | |
send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&parse_mode=Markdown&text=' + bot_message | |
response = req.post(send_text) |
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 | |
## update sudoers file | |
sed -e 's#%sudo.*#&,NOPASSWD: /bin/systemctl#' /etc/sudoers > /tmp/sd ; > /etc/sudoers ; cat /tmp/sd | EDITOR='tee -a' visudo | |
## add a service restart in update script | |
sed -i '/xf/a\ sudo systemctl restart cleanbox' /opt/cleanbox/update-new.sh | |
## remove service restart from root |
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 | |
function getID() | |
{ | |
ID=\$(xinput | grep Touch | sort -g | head -n1 | cut -f2 -d=) | |
} | |
xinput test-xi2 --root \$ID \ | |
| grep --line-buffered "EVENT type 22 (RawTouchBegin)" | \ |
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 | |
echo "Installing ModSecurity ... " | |
yum install yajl -y 1>/dev/null | |
rpm -ivh ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/linux/updates/25/x86_64/Packages/l/lua-libs-5.3.4-3.fc25.x86_64.rpm 1>/dev/null | |
rpm -ivh ftp://ftp.icm.edu.pl/vol/rzm6/linux-fedora-alt/releases/25/Cloud/x86_64/os/Packages/m/mod_security-2.9.1-1.fc25.x86_64.rpm 1>/dev/null | |
cd /etc/httpd |
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 | |
## Checkfor valid parameters | |
if [ -z $1 ] ; then | |
echo "missing destination directory" | |
exit 1 | |
else | |
if [ -d $1 ]; then | |
: | |
else |
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 | |
## this script is for Debian\Ubuntu. | |
## Check if root | |
if [ ! $UID = 0 ]; then | |
echo "This script needs super user privileges to run" | |
echo "run it againg using sudo or login as root" | |
exit 1 | |
fi |
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 | |
## nslookup an entire subnet | |
## It's possible to add more networks separated with space | |
if [ ! $1 ]; then | |
echo "Missing parameter" | |
echo "Usage: To scan 192.168.1.0/24, type:" | |
echo "subnet-scan 1" | |
exit 1 |
NewerOlder