Skip to content

Instantly share code, notes, and snippets.

[pcae@Agnes ~]$ cat .bashrc
# .bashrc
[ -z "$PS1" ] && return
source /home/pcae/.bashrc-tmux
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
@pedrompcaetano
pedrompcaetano / block country @ pf
Last active August 29, 2015 14:19
replace table contents instead of reloading pf ruleset at each crontab interval
#!/bin/sh
PFDIR=/etc/pf-files
ZONEFILE=blocked_zones
mkdir -p ${PFDIR}
> ${PFDIR}/${ZONEFILE}
for ZONE in cn az by kz kg ru tj tm uz vn
do
Index: acpimadt.c
===================================================================
RCS file: /data/src/openbsd/src/sys/dev/acpi/acpimadt.c,v
retrieving revision 1.31
diff -u -p -r1.31 acpimadt.c
--- acpimadt.c 9 Feb 2015 08:15:19 -0000 1.31
+++ acpimadt.c 24 Jun 2015 22:33:04 -0000
@@ -239,13 +239,13 @@ acpimadt_attach(struct device *parent, s
entry->madt_lapic.apic_id,
entry->madt_lapic.flags);
ssh-keygen -y > id_rsa.pub
@pedrompcaetano
pedrompcaetano / gist:c141836846f1f6396dfb
Created August 26, 2015 13:13
filtering prefixes by AS
https://anuragbhatia.com/networking/using-bgpq3-for-automated-filter-generation/
#!/bin/sh
(
# Retrieves ad blacklist and adds them to unbound as NXDOMAIN
ftp -V -o - http://winhelp2002.mvps.org/hosts.txt | awk '!/^#/ {print $2}' |egrep -v '^$|localhost' | sort -u | sed -e 's/
//g' | sed 's/^/local-zone: \"/' | sed 's/$/\" static/'
# Retrieves URLs from phishtank and adds them to unbound as NXDOMAIN
# It might be a good idea to get an API key at phishtank for the download
rtr1/bgpd.conf:
rtr1/bgpd.conf:internal_peer="10.10.107.242"
rtr1/bgpd.conf:upstream1="10.20.136.161"
rtr1/bgpd.conf:upstream2="10.20.136.162"
rtr1/bgpd.conf:pt="{$upstream1, $upstream2 }"
rtr1/bgpd.conf:bgp_networks="{10.20.249.144/28, 10.10.106.0/23, 10.10.106.0/24, 10.10.107.0/24, 10.30.23.0/24 }"
rtr1/bgpd.conf:
rtr1/bgpd.conf:AS 65529
rtr1/bgpd.conf:router-id 10.20.136.165
rtr1/bgpd.conf:holdtime 3
rtr2/bgpd.conf:
rtr2/bgpd.conf:peer_impresa_site1="10.10.107.241"
rtr2/bgpd.conf:upstream1="10.20.136.161"
rtr2/bgpd.conf:upstream2="10.20.136.162"
rtr2/bgpd.conf:pt="{$peer1,$peer2}"
rtr2/bgpd.conf:bgp_networks="{10.20.249.144/28, 10.10.106.0/23, 10.10.106.0/24, 10.10.107.0/24, 10.30.23.0/24 }"
rtr2/bgpd.conf:
rtr2/bgpd.conf:AS 65530
rtr2/bgpd.conf:router-id 10.20.136.166
rtr2/bgpd.conf:holdtime 3
ob@cirrus:~$ nmap --script=ssl-cert.nse -p 443 gmail.com
Starting Nmap 7.00 ( https://nmap.org ) at 2015-12-07 15:48 CET
Nmap scan report for gmail.com (173.194.112.21)
Host is up (0.014s latency).
Other addresses for gmail.com (not scanned): 2a00:1450:4001:80b::1015 173.194.112.22
rDNS record for 173.194.112.21: fra07s27-in-f21.1e100.net
PORT STATE SERVICE
443/tcp open https
pcaetano@soekris $ > df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/sd0a 1005M 86.1M 869M 9% /
/dev/sd0k 190G 420M 180G 0% /home
/dev/sd0d 3.9G 24.0K 3.7G 0% /tmp
/dev/sd0f 2.0G 700M 1.2G 37% /usr
/dev/sd0g 1005M 227M 727M 24% /usr/X11R6
/dev/sd0h 9.8G 450M 8.9G 5% /usr/local
/dev/sd0j 2.0G 989M 923M 52% /usr/obj
/dev/sd0i 2.0G 1.4G 444M 77% /usr/src