October 19, 2020

ISC DHCP Server Failover

 Documenting this as it was driving me insane, couldnt find any help online

Ubuntu 18.04 and 20.04

Errors in syslog

Oct 19 07:24:32 control dhcpd[13024]: DHCPDISCOVER from 40:a3:6b:c1:25:20 via ens160: not responding (recovering)

Oct 19 07:24:32 control dhcpd[13024]: DHCPDISCOVER from 60:01:94:e4:0b:a6 via ens160: not responding (recovering)

Oct 19 07:24:32 control dhcpd[13024]: DHCPREQUEST for 192.168.1.132 from d8:31:34:f2:e3:ad via ens160: not responding (recovering)

All I needed to do was the let ISC-DHCP-Server use the default ports:

failover peer "failover-partner" {
    primary;
    address 192.168.1.62;
    # port 519;

    peer address 192.168.1.172;
    # peer port 520;
    mclt 3600; # Primary only
    split 128; # Primary Only
    max-response-delay 60;
    max-unacked-updates 10;
    load balance max seconds 3;
}

June 11, 2020

Cisco 3802 u-boot


printenv BOOT  <<< Check the current configuration
setenv BOOT <part1 part2="">  <<< Change to another partition
saveenv  <<< Save configuration
boot  <<< Reload the AP</part1>

setenv bootcmd nandboot  <<< Set to nandboot
saveenv  <<< Save configuration
boot  <<< Reload the AP
setenv bootcmd nandboot  <<< Set to nandboot
saveenv  <<< Save configuration
boot  <<< Reload the AP
printenv BOOT  <<< Check the current configuration
setenv BOOT <part1 part2="">  <<< Change to another partition
saveenv  <<< Save configuration
boot  <<< Reload the AP</part1>

March 01, 2020

Automated Renewal of LetsEncrypt Cert on Cisco IOS with Route53


Installed the AWS CLI
apt-get install python3-pip
Ubunutu 16.x needs this as there is a bug in the package above
pip3 install awscli --upgrade 
I used this script as the base for the AWS Route 53 Zone update and Certificate request

https://github.com/jed/certbot-route53

Create a public key for the "automation" user:

root@control:/usr/local/scripts# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): /usr/local/scripts/cisco-automation.key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /usr/local/scripts/cisco-automation.key.
Your public key has been saved in /usr/local/scripts/cisco-automation.key.pub.
The key fingerprint is:
The key's randomart image is:
Add the public key to the router:
ip ssh pubkey-chain
username automation
key-string
(paste in your pub key max 254 characters per line, so you will need to split it)
exit
exit
exit
exit
wr
copy the keys into the id_rsa and ird_rsa.pub file of the user that will run the script
cat cisco-automation.key > /root/.ssh/id_rsacat cisco-automation.key.pub > /root/.ssh/id_rsa.pub 









emonCMS

Ubuntu 18.04 LTS

EmonScripts/readme.md at master · openenergymonitor/EmonScripts · GitHub

echo $USER' ALL=(ALL) NOPASSWD: ALL' | sudo tee /etc/sudoers.d/$USER && sudo chmod 0440 /etc/sudoers.d/$USER


wget https://raw.githubusercontent.com/openenergymonitor/EmonScripts/stable/install/init.sh
chmod +x init.sh && ./init.sh


settings.ini in /var/www/emoncms/.

cd /opt/openenergymonitor/EmonScripts/install/
nano config.ini

Standard Setup Filepaths

Install location for code from OpenEnergyMonitor GitHub repository such as EmonScripts /opt/openenergymonitor
Install location for modules symlinked to www /opt/emoncms
Main code location /var/www/emoncms
Log file location /var/log/emoncms
Data directory /var/opt/emoncms

November 28, 2019

Cert notes

chown root:certs /etc/pki/tls/certs/localhost.crt
chown root:certs /etc/pki/tls/private/localhost.key
chmod g+rwx /etc/pki/tls/certs/localhost.crt
chmod g+rwx /etc/pki/tls/private/localhost.key

scp /media/nas-backup/certs/wjw-walkerfamily/fullchain.cer  admin@192.168.1.40:/etc/pki/tls/certs/localhost.crt

scp /media/nas-backup/certs/wjw-walkerfamily/wjw.nz.key admin@192.168.1.40:/etc/pki/tls/private/localhost.key

Observium Application Monitoring Agent Install


yum install xinetd
scp   root@zeus:/opt/observium/scripts/observium_agent_xinetd /etc/xinetd.d/observium_agent_xinetd
service xinetd restart
scp  root@zeus:/opt/observium/scripts/observium_agent /usr/bin/observium_agent
mkdir -p /usr/lib/observium_agent
mkdir -p /usr/lib/observium_agent/local

cp /media/nas-backup/observium_agent/scripts-available/mysql* /usr/lib/observium_agent/local
cp /media/nas-backup/observium_agent/scripts-available/exim* /usr/lib/observium_agent/local
cp /media/nas-backup/observium_agent/scripts-available/postfix* /usr/lib/observium_agent/local
cp /media/nas-backup/observium_agent/scripts-available/vmwaretools /usr/lib/observium_agent/local

chmod +x /usr/bin/observium_agent

November 19, 2019

Setting up AutoDiscover for Windows Mail with imap


mkdir /var/www/html/autodiscover

nano autodiscover.xml

<?xml version="1.0" encoding="utf-8" ?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
<Account>
  <AccountType>email</AccountType>
  <Action>settings</Action>
  <Protocol>
    <Type>IMAP</Type>
    <Server>mx1.wjw.nz</Server> <!--IP Addr or DNS name of server-->
    <Port>993</Port>
    <DomainRequired>on</DomainRequired>
    <SPA>off</SPA>
    <SSL>on</SSL>
    <AuthRequired>on</AuthRequired> <!-- Optional: Is Authentication required? -->
    <UsePOPAuth>on</UsePOPAuth>
    <SMTPLast>off</SMTPLast>
  </Protocol>
  <Protocol>
    <Type>SMTP</Type>
    <!--<TTL>%TTL%</TTL>-->
    <Server>mx1.wjw.nz</Server>
    <Port>25</Port>
    <DomainRequired>on</DomainRequired>
    <SPA>off</SPA>
    <SSL>on</SSL>
    <AuthRequired>on</AuthRequired>
    <UsePOPAuth>on</UsePOPAuth>
    <SMTPLast>off</SMTPLast>
  </Protocol>
</Account>
</Response>
</Autodiscover>