Chrony Clients to the GPS Clocks

apt-get install chrony

systemctl enable chrony
systemctl start chrony
systemctl status chrony

/etc/chrony/chrony.conf
# Source servers
server gps1.my.side iburst
server gps2.my.side iburst
pool pool.ntp.org maxsources 3

# Act as an NTP server
#allow

# Only allow chronyc from the localhost
cmdallow 127.0.0.1

# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3

# Notify on error correction > 0.5 seconds
logchange 0.5

# Enable kernel synchronization of the real-time clock (RTC).
rtcsync

# Lock clock in to RAM
lock_all

# RTS
sched_priority 1

# Fudge Stratum if we cannot reach the internet
local stratum 10

# Save on exit
dumponexit
dumpdir /var/log/chrony

# Require 2 time sources before adjusting clock
minsources 2

# Get TAI-UTC offset and leap seconds from the system tz database.
leapsectz right/UTC
leapsecmode slew
maxslewrate 1000
smoothtime 400 0.001 leaponly

# Specify directory for log files.
logdir /var/log/chrony

# Select which information is logged.
log measurements statistics tracking

systemctl restart chrony

netstat -ant

watch “chronyc sources -v”

Hits: 11

Chrony+GPSD (PPS+GPS) on Pi

apt-get update; apt-get -y dist-upgrade; apt -y autoremove; apt clean; apt autoclean

root@gps1:~# cat /etc/apt/sources.list
deb http://approx.my.side/raspbian/ bullseye main contrib non-free rpi

apt clean; apt update; apt upgrade; apt dist-upgrade; apt autoremove

reboot

apt-get install snmpd
apt-get install lsof
Configure remote logging

ln -s /usr/share/zoneinfo/US/Central /etc/localtime

Set swap to 1G
vi /etc/dphys-swapfile
CONF_SWAPSIZE=1024
/etc/init.d/dphys-swapfile stop
/etc/init.d/dphys-swapfile start

/boot/cmdline.txt

dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=1d8091da-02 rootfstype=ext4 elevator=deadline fsck.repair=yes net.ifnames=0 rootwait

/boot/config.txt

#GPS Changes
enable_uart=1
init_uart_baud=57600
disable_pvt=1
dtoverlay=pps-gpio,gpiopin=21
dtoverlay=pi3-disable-bt

echo “pps-gpio” >> /etc/modules

apt-get install pps-tools

reboot

lsmod
vcgencmd measure_clock arm

apt-get install gpsd gpsd-clients

/etc/default/gpsd

DEVICES="/dev/gps0"
GPSD_OPTIONS="-n"
USBAUTO="false"


root@gps1:/etc/udev/rules.d# cat 09.gps.rules
KERNEL=="ttyAMA0", SYMLINK+="gps0"
KERNEL=="pps0", OWNER="root", GROUP="tty", MODE="0777", SYMLINK+="gpspps0"

systemctl enable gpsd

reboot

systemctl status gpsd
gpsmon /dev/gps0

ppstest /dev/pps0

reboot

systemctl disable systemd-resolved
systemctl stop systemd-resolved
systemctl status
systemctl disable dhcpcd.service
Configure /etc/network/interfaces

reboot (hope for the best)

apt-get install chrony

/etc/chrony/chrony.conf

# Source Clock
refclock PPS /dev/pps0 lock NMEA refid PPS1 prefer
refclock SHM 0 offset 0.5 refid NMEA noselect

# Internal peers
peer gps2.my.side iburst prefer

# Sanity Servers
server time1.google.com iburst
server time2.google.com iburst
server time3.google.com
server time4.google.com

# Act as an NTP server
allow XXX.XXX.XXX.XXX/XX

# Only allow chronyc from the localhost
cmdallow 127.0.0.1

# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3

# Notify on error correction > 0.5 seconds
logchange 0.5

# Enable kernel synchronization of the real-time clock (RTC).
rtcsync

# Lock clock in to RAM
lock_all

# RTS
sched_priority 1

# Fudge Stratum if we cannot reach the internet
local stratum 10

# Get TAI-UTC offset and leap seconds from the system tz database.
leapsectz right/UTC
leapsecmode slew
maxslewrate 1000
smoothtime 400 0.001 leaponly

# Specify directory for log files.
logdir /var/log/chrony

# Select which information is logged.
log measurements statistics tracking

keyfile /etc/chrony/chrony.keys

systemctl enable chrony
systemctl status chrony
systemctl restart chrony
systemctl status chrony

watch “chronyc sources -v”

General OS Setup:
apt-get install libsasl2-modules postfix bsd-mailx deborphan
Create /root/.forward
/etc/postfix/main.cf: inet_interfaces = loopback-only

apt-get install bind9 dnsutils
named.conf.local

Fail2Ban
Install custom /etc/fail2ban/jail.local

apt-get install clamav
/etc/clamav/freshclam.conf
#NotifyClamd /etc/clamav/clamd.conf

Hits: 12

Teamspeak Linux Setup

  1. Download proper Teamspeak server for your architecture.
  2. Create teamspeak user.
  3. tar -xvf *.tar.bz2
  4. vi /etc/systemd/system/teamspeak.service

[Unit]
Description=TeamSpeak 3 Server
After=network.target

[Service]
WorkingDirectory=/home/teamspeak/ts3s/
User=teamspeak
Group=teamspeak
Type=forking
ExecStart=/home/teamspeak/ts3s/ts3server_startscript.sh start inifile=ts3server.ini
ExecStop=/home/teamspeak/ts3s/ts3server_startscript.sh stop
PIDFile=/home/teamspeak/ts3s/ts3server.pid
RestartSec=15
Restart=always

[Install]
WantedBy=multi-user.target

5. systemctl start teamspeak

6. cat /usr/local/teamspeak/logs/* | grep “token”

7. Login to Teamspeak using client and enter token to take ownership.

Hits: 115

Fucking w/ TinyDNS

Getting the serial number/change date for a domain on an authoritative server.

nameserver:/root # tinydns-get soa domain.com
6 domain.com:
193 bytes, 1+1+3+3 records, response, authoritative, noerror
query: 6 domain.com
answer: domain.com 60 SOA ns1.domain.com domain.com 2012043001 10800 3600 604800 3600
authority: domain.com 60 NS ns1.domain.com
authority: domain.com 60 NS ns2.domain.com
authority: domain.com 60 NS ns3.domain.com
<SNIP>

Hits: 144

Syslog: Log Levels

0 -> emerg —-> System is unusable.
1 -> alert ——> Should be corrected immediately.
2 -> crit ——–> Failure in the system’s primary application.
3 -> err ———> An application has exceeded storage.
4 -> warning -> An error will occur if action is not taken.
5 -> notice —–> Events that are unusual.
6 -> info ——–> Normal operational messages.
7 -> debug —–> Debug level logging.

Hits: 537