Skip to content

Instantly share code, notes, and snippets.

View Airdawg5571's full-sized avatar

Airdawg Airdawg5571

  • Romania
View GitHub Profile
@Airdawg5571
Airdawg5571 / dpkg-reverse
Created May 31, 2016 06:53
Get a reverse-time view of apt-get commands and Synaptic activities on a debian-based distro
#!/bin/bash
# source: http://askubuntu.com/a/250530
( zcat $( ls -tr /var/log/apt/history.log*.gz ) ; cat /var/log/apt/history.log ) | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep '^Commandline:'
@Airdawg5571
Airdawg5571 / ipt
Last active October 18, 2023 07:01
More organized (pretty-printed) iptables output.
#!/bin/bash
# Written and tested on CentOS 7
iptables -nvL |cut -f -9|column -t| sed 's/^Chain/\n&/g'|sed '/^Chain/ s/[ \t]\{1,\}/ /g'|sed '/^[0-9]/ s/[ \t]\{1,\}/ /10g'