This file contains hidden or 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/sh | |
| # Get top 1M domain list | |
| if [ ! -e top-1m.txt ]; then | |
| wget http://s3.amazonaws.com/alexa-static/top-1m.csv.zip | |
| unzip top-1m.csv.zip | |
| cut -d',' -f2 top-1m.csv >top-1m.txt | |
| fi | |
| # Create list of DNS resolvers |
This file contains hidden or 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
| keytool -genkeypair -alias tomcat -keyalg RSA -validity 3654 -dname "CN=Tomcat" -keypass changeit -keystore /srv/tomcat/.keystore -storepass changeit -deststoretype pkcs12 |
This file contains hidden or 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
| Windows Registry Editor Version 5.00 | |
| [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters] | |
| "AllowInsecureGuestAuth"=dword:00000001 |
This file contains hidden or 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
| # Checks if MANIFEST.MF in all jar files contain trailing line ending | |
| for JAR in $(find . -name '*.jar' -type f); do | |
| LL=$(unzip -p ${JAR} META-INF/MANIFEST.MF 2>/dev/null | cat -A | tail -1); | |
| LC=$(echo -n ${LL} | tail -c 1) | |
| [ "${LC}" != "" -a "${LC}" != "$" ] && echo "${JAR}: ${LL}" | |
| done |
This file contains hidden or 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
| cat <<EOF | sendmail -t -f test@example.com | |
| From: <test@example.com> | |
| To: <test@example.com> | |
| Subject: Mail test | |
| Mail test | |
| EOF |
This file contains hidden or 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
| systemctl stop mysql | |
| mysqld_safe --skip-grant-tables & | |
| mysql -u root mysql | |
| UPDATE user SET password=PASSWORD('password') WHERE user='root'; | |
| FLUSH PRIVILEGES; | |
| quit |
This file contains hidden or 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 get_ipv4 { | |
| ip address show ${1} | grep 'inet ' | awk '{print $2}' | cut -d/ -f1 | |
| } | |
| function get_mac { | |
| ip address show ${1} | grep 'link/ether' | awk '{print $2}' | |
| } |
This file contains hidden or 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
| #!/usr/bin/env python | |
| from lxml import html | |
| import argparse | |
| def main(args): | |
| index = '/srv/portal/index.html' | |
| doc = html.parse(index) | |
| if args.property == 'link': |
This file contains hidden or 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
| mount /dev/mapper/vg0-root /mnt | |
| mount /dev/sda1 /mnt/boot | |
| mount --bind /dev /mnt/dev | |
| mount --bind /proc /mnt/proc | |
| mount --bind /sys /mnt/sys | |
| chroot /mnt | |
| blkid | |
| vi /etc/fstab | |
| update-initramfs -u |
This file contains hidden or 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
| from passlib.hash import django_pbkdf2_sha256 as h | |
| print(h.hash('password')) |