Some tips for me and other


Linux + Fast check directory size

du -hd1

PFSense + Installing packages

You can install packages from the command line: e.g.: pkg install -y pfsense-pkg-stunnel if something blocks it you will see: Updating pfSense-core repository catalogue…pfSense-core repository is up to date.Updating pfSense repository catalogue…pfSense repository is up to date.All repositories are up to date.process with pid 12837 still holds the lock Tnen you can kill it: kill […]

Pfsense + Zabbix + Temperature monitoring via com-port

pw usermod zabbix -G uucp Services: Zabbix Agent 4.2: Agent: Advanced: User Parameters: UserParameter=temperature, /root/digitemp_DS9097 -c /root/.digitemprc -q -t 0 | awk ‘{if ($7 == “85.00”) print “36”; else print $7}’ | bc Add a new item to a host as Numeric (float), a graph and a trigger.

Get text before dot

s=”4.56″ $ echo “${s%%.*}” 4

IPSEC + multilpe networks

I had to configure access from other local networks to remote site via IPSEC. My environment: FreeBSD + PFSense. I tried to add an additional SA to the both systems but that didn’t work. I read this document: and did such a way: Supernetting Example At Site A, there is one subnet, This […]

Grep + Parse IPs

grep -o ‘[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}’ file.txt

FTP-log + get IP-addresses

cat ftp.txt | grep incorrect | awk ‘{print $8};’ | tr -d “(” | tr -d “)>” | sort -u

PFSense + import DHCP-mappings from dhcpd.conf

I wanted migrate my static mapping from my dhcpd.conf to PFSense. Script to parse data from dhcpd.conf to xml-text: #!/usr/bin/awk -f # # Author: Matt Pascoe – # Forked: Konstantin Shalygin – # Forked2: Rexxer, for PFSense # USAGE: # ./dhcpparse.awk /etc/dhcpd.conf # Note that for hosts, it will try a reverse lookup […]

DHCPD + Classes e.g. MAC-address

subnet netmask { option routers; option domain-name-servers,; class “Hyper-V” { match if substring(hardware,1,3) = 00:15:5d; } class “VMWare” { match if substring(hardware,1,3) = 00:0c:29; } class “Winemu” { match if substring(hardware,1,3) = 00:03:ff; } pool { range; allow members of “Hyper-V”; } pool { range; allow […]

Tcpdump examples

See the list of interfaces on which tcpdump can listen: tcpdump -D Listen on interface eth0: tcpdump -i eth0 Listen on any available interface (cannot be done in promiscuous mode. Requires Linux kernel 2.2 or greater): tcpdump -i any Be verbose while capturing packets: tcpdump -v Be more verbose while capturing packets: tcpdump -vv Be […]

Previous Posts