Skip to content

Instantly share code, notes, and snippets.

NamE Avyd

Block or report user

Report or block Avyd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Avyd
Avyd / gist:5e296e98b26574e17010
Created Jul 22, 2014
Cisco_ASA_connection_dump_with_ACLs
View gist:5e296e98b26574e17010
# Cisco ASA dumping
access-list whatever permit ip 192.168.12.0 255.255.255.0 any
access-list whatever permit ip any 192.168.12.0 255.255.255.0
capture whatever access-l whatever circular-buffer interface outside buffer 64000 real-time
# Remove ACL and stop capture
no access-list whatever permit ip 192.168.12.0 255.255.255.0 any
no access-list whatever permit ip any 192.168.12.0 255.255.255.0
no capture whatever
@Avyd
Avyd / CheckPoint_Firewall_CLI_Commands
Created Jul 22, 2014
CheckPoint_Firewall_CLI_Commands
View CheckPoint_Firewall_CLI_Commands
fw ver
fw lslogs # List log files
fw ctl iflist # Interface list
fw ctl pstat # Kernel memory and connections
fw log -c drop # Show dropped connections
fw log -f # Tail logs
fw stat -l # Show flow (policy, drop, accept..etc)
fw monitor -e 'accept host(10.1.1.1);'
fw monitor -e 'accept host(10.1.1.1) and dst=10.1.1.2;'
fw monitor -e 'accept host(1.1.1.1) and host(2.2.2.2) and not ping;'
@Avyd
Avyd / Mass_SSH_Commander_AndStuff
Created Jul 22, 2014
Short scripts and stuff to run commands on multiple servers
View Mass_SSH_Commander_AndStuff
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
@Avyd
Avyd / irc_link_collector
Last active May 10, 2017
irc_link_collector
View irc_link_collector
@Avyd
Avyd / Linux_Process_Logger.sh
Created Feb 13, 2014
Linux_Process_Logger.sh
View Linux_Process_Logger.sh
#!/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
@Avyd
Avyd / Hungarian_Text_l33tifier.py
Last active Aug 29, 2015
Hungarian_Text_l33tifier
View Hungarian_Text_l33tifier.py
#!/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()
@Avyd
Avyd / CPU Heat Keeper
Last active Jan 2, 2016
CPU Heat Keeper
View CPU Heat Keeper
#!/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
@Avyd
Avyd / Compile to .deb
Last active Jan 30, 2019
Compile kernel to installable .deb package
View Compile to .deb
#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
@Avyd
Avyd / SSH_Login_Checker
Created Oct 20, 2013
Checks SSH logins (Success, Auth_Fail, Etc)
View SSH_Login_Checker
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
@Avyd
Avyd / Will_You_FSCK?
Last active Dec 25, 2015
Bash script to check if there will be fsck on the next reboot. Checks for ext* filesystems.
View Will_You_FSCK?
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
You can’t perform that action at this time.