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
#! /usr/bin/env python | |
# | |
# Passlib is required to run Cisco md5 hasher. | |
# You can install simply with "easy_install passlib" | |
# | |
# Cisco didn't want to use normal md5 for their passwords. | |
# So they changed the salt size. | |
# That kind of hashing is used in routers / switches. | |
# You can test simply by a "show run" output. |
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
#Specify the settings and make sure you have a "results" folder | |
#"rpm_server" --> rpm will be downloaded here | |
#"server" ---> rpm will be installed here | |
#"up2date_ver" -> current version of rpm pack | |
rpm_server=server_name | |
server=server_name | |
up2date_ver=$(echo "server_name") | |
#Check version on the given server | |
version_check=$(ssh $server -l root -o StrictHostKeyChecking=no -o BatchMode=yes -C "rpm -qa | grep lsy_root_authorized" > /dev/null) |
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
for x in $(df -t ext4 -t ext3 -t ext2 | tr -s ' ' | cut -d " " -f1 | grep -v "^$" | tail -n +2); do mmc=$(tune2fs -l $x | grep 'mount count' | tr -s ' ' | cut -d ' ' -f4) ; mc=$(tune2fs -l $x | grep 'Mount count' | tr -s ' ' | cut -d ' ' -f3) ; if [ `expr $mmc - $mc` -le 0 ] ; then fsck="0" ; else fsck="1"; fi ; CT=`date +%s` ; LCT=`date -d "\`tune2fs -l $x | grep "Last checked" | tr -s ' '| cut -d" " -f3-\`" +%s` ; CI=`tune2fs -l $x | grep "Check interval"| tr -s ' '| cut -d" " -f3` ; if [ `let $CT-$LCT` -gt `let $CI*3600*24` ] && [ $CI -gt 0 ] || [ $fsck -eq 1 ]; then echo "There will be forced fsck for $x"; else echo "There will be no fsck for $x" ; fi ; done | |
#Alternative script from friend with sed | |
#mount -t ext2,ext3,ext4|while read i j; do tune2fs -l $i|sed -n '/[Mm]ount count/{s/.*: *//;p}'|(read c; read m; [ $m -gt 0 -a $m -le $c ] && echofsck,count,$i); c="$(tune2fs -l $i|sed -n '/Next check/{s/.*r: *//;p}')"; [ -z "$c" ] || ([ `date +%s` -ge `date -d"$c" +%s` ] && echo fsck,time,$i); done |
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
for host in $(cat nodes) | |
do | |
status=$(ssh -l root -o BatchMode=yes -o ConnectTimeout=5 $host 2>&1) | |
if [[ $status != *"Permission denied"* ]] ; then | |
echo "$host - $status" >> Succeeded | |
elif [[ $status == *"Permission denied"* ]] ; then | |
echo $host - $status >> Auth_failed | |
else | |
echo $host - $status >> Etc | |
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
#Install necessary things | |
apt-get update | |
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential -y | |
#Get the kernel | |
cd /usr/src | |
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.13.tar.xz | |
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.13.tar.sign | |
gpg --verify linux-3.13.tar.sign | |
tar xpvf linux-3.13.tar.xz |
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 "CPU Heat-keeper" | |
echo "---------------" | |
echo "Required - sensors and cpuburn" | |
echo "Tested on 3rd gen i5 procs." | |
echo "Use at your own risk!" | |
echo "" | |
# ---- Settings ---- | |
maxheat=80 |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
#https://simple.wikipedia.org/wiki/Leet | |
#http://qntm.org/l33t | |
#http://www.securepasswords.net/site/ASCII-1337-Alphabet/page/23.html | |
#http://leet.wikia.com/wiki/Category:Letters | |
text = raw_input("Text to l33t1fy: ") | |
text = text.lower() |
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 | |
while true ; do | |
date=$(date +"%T-%d-%m-%y") | |
name=pslist | |
ps aux >> $name && echo "--------------------------------------------------------------------------------------------" >> $name | |
echo $date >> $name | |
echo $date | |
filesize=`du $name | awk '{print $1}'` | |
echo " Current size:" $filesize |
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 | |
while true ; | |
do | |
echo "Collect the links..." | |
for x in $(find /home/user/irclogs/ -name "*.log" -print) ; do egrep --only-matching "http(s?):\/\/[^ \"\(\)\<\>]*" $x | tac ; done > output.txt | |
echo "Let's wait for some seconds..." | |
sleep 15 | |
done |
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
for i in $(cat secnodes); do ssh -o StrictHostKeyChecking=no -l root $i -C "find /etc/cron* -type f -exec cat {} \; > cron_all" ; done | |
for i in $(cat secnodes); do echo -e "\n\n XXXXXXXXXX $i XXXXXXXXXX \n" ; ssh -o StrictHostKeyChecking=no -l root $i -C "cat cron_all" ; done | |
for i in $(cat nodes); do echo -e "\n\n XXXXXXXXXX $i XXXXXXXXXX \n" ; ssh -o StrictHostKeyChecking=no -l root $i -C "netstat -tunlp|grep 8080" ; done | |
for i in node51 node52 node53 ; do ssh -o StrictHostKeyChecking=no -l root $i -C "grep something /var/log/squid3/access.log" ; done | |
# Regex matching from irclogs | |
for x in $(find irclogs/ -name "*something*.log" -print) ; do egrep --only-matching "http(s?):\/\/[^ \"\(\)\<\>]*" $x ; done |
OlderNewer