Rexxer

Some tips for me and other

FreeBSD

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: https://doc.pfsense.org/index.php/IPsec_with_Multiple_Subnets and did such a way: Supernetting Example At Site A, there is one subnet, 10.0.0.0/24. 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 – matt@opennetadmin.com # Forked: Konstantin Shalygin – kostya@opentech.ru # 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 192.168.30.0 netmask 255.255.255.0 { option routers 192.168.30.1; option domain-name-servers 192.168.30.11, 192.168.30.2; 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 192.168.30.100 192.168.30.130; allow members of “Hyper-V”; } pool { range 192.168.30.131 192.168.30.160; 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