October 7 2022

Windows built in VPN, dont use as network credentials

I know this is an old question, but I believe there is a better answer in that it doesn’t require any server-side changes: edit the VPN settings to not use the VPN credentials when authenticating to network servers. This setting is not exposed through Windows’ UI, so you need to locate the .pbk file associated with your VPN connection (%AppData%\Roaming\Microsoft\Network\Connections\PBK\rasphone.pbk for user VPNs) or (%ProgramData%\Microsoft\Network\Connections\Pbk\rasphone.pbk for system VPNs).

Right click on the VPN’s .pbk file and open it with Notepad. (Remember to untick ‘Always use this program for this file type’)
Roughly 5 lines down will be an entry ‘UseRasCredentials=1’
Change this to ‘UseRasCredentials=0’
Save the file.
I sourced these instructions are from: https://social.technet.microsoft.com/Forums/windows/en-US/0204464d-e32d-4584-966b-60788cce0d6f/disable-creation-of-vpn-session-credential-in-credential-manager-without-disabling-all-of

https://serverfault.com/questions/322235/do-not-use-vpn-credentials-to-connect-to-network-resources

September 10 2022

EdgeRouter install/update nano

set system package repository stretch components 'main contrib non-free'
set system package repository stretch distribution stretch
set system package repository stretch url http://http.us.debian.org/debian

Fix URL:
set system package repository stretch url http://archive.debian.org/debian

Do apt-get update, but don’t do apt-get upgrade, as it will break some of the packages the ER depends on.

https://help.ui.com/hc/en-us/articles/205202560-EdgeRouter-Add-Debian-Packages-to-EdgeOS
https://community.ui.com/questions/Install-Nano/40e7697a-404b-4083-b901-dbedbfdc8a8c

September 9 2022

fetchmail ssl error

Get the combined ssl fingerprint:

openssl s_client -connect email.server.wan:993 -showcerts | openssl x509 -fingerprint -noout -md5

Example fetchmailrc:

set logfile /home/user/fetchmail.log
poll email.server.wan proto pop3
user "loginnamehere" password "passwordhere"
ssl
sslcertpath "/home/user/.fetchmail/ssl"
#sslcertck
nokeep
mda "/usr/bin/procmail -f %F -d %T";
sslfingerprint 'md5 thumbprint separated by :'s from first step'

The running script, print attachments with cups

#!/bin/bash
echo -n $(date +%m-%d-%Y_%H:%M:%S) ":>> " >> fetchmail.log
SUPPORTED_FILETYPES=.pdf.jpg
LP_OPTIONS="-d MFCL2710DN -o media=A4,tray1 -o fit-to-page -o position=top -o scaling=100"
FILENAME=$(date +%H%M%S).txt
/usr/bin/fetchmail --bsmtp ~/mailtemp/$FILENAME
if [ "$?" = "0" ]; then
/usr/bin/uudeview +e $SUPPORTED_FILETYPES -p ~/printable -i ~/mailtemp/$FILENAME
# rm ~/mailtemp/$FILENAME

for f in ~/printable/*
do
lp $LP_OPTIONS $f
rm $f
done
fi

https://www.linuxquestions.org/questions/linux-server-73/fetchmail-809435/

How to fix ssl certificate issue on fetchmail

March 9 2022

UniFi Site Controller custom SSL

Download the script:

sudo wget https://raw.githubusercontent.com/stevejenkins/unifi-linux-utils/master/unifi_ssl_import.sh -O /usr/local/bin/unifi_ssl_import.sh

Edit the variables in the script

Add your domain
UNIFI_HOSTNAME=unifi.yourdomain.com

Comment the three lines for Fedora/RedHat/Centos by placing a # for it:
# Uncomment following three lines for Fedora/RedHat/CentOS
#UNIFI_DIR=/opt/UniFi
#JAVA_DIR=${UNIFI_DIR}
#KEYSTORE=${UNIFI_DIR}/data/keystore

Uncomment the three lines for Debian/Ubuntu
# Uncomment following three lines for Debian/Ubuntu
UNIFI_DIR=/var/lib/unifi
JAVA_DIR=/usr/lib/unifi
KEYSTORE=${UNIFI_DIR}/keystore

Set the Let’s Encrypt mode to true:
If you only enable the line, by removing the #, you will get a loop ==Yes when running the script. So set it to true. Will still get some warning about missing [[:, but the doesn’t matter.
LE_MODE=true

https://lazyadmin.nl/home-network/unifi-controller-ssl-certificate/
February 28 2022

Two Default Gateways on One System

You have built two or more network cards into one Linux system and each of these cards has its own default gateway. By default, you can only have one default gateway on a system. The case described would lead to asynchronous routing, whereby the router would reject the packets as appropriate.

The iproute2 program, which is included in all current Linux distributions and already installed even, as a rule, can be used for the solution of this problem. Normally, a Linux system only has one routing table, in which only one default gateway can make entries. With iproute2, you have the ability to setup an additional routing table, for one thing, and allow this table to be used by the system based on rules, for another.

https://www.thomas-krenn.com/en/wiki/Two_Default_Gateways_on_One_System

September 30 2021

Bleachbit-Portable – Download and clean temp files


$datecurrent = get-date -Format MMddyyyyHmmss
$bleachbit_portable_url = “https://url/download/bleachbit-portable.zip”

$ourpath = “C:\absolute\” + $datecurrent + “\temp”
$zip = $ourpath + “\bleachbit-portable.zip”
$exe = Join-Path $ourpath “\bleachbit-portable\bleachbit_console.exe”

New-Item -ItemType Directory -Force -Path $ourpath
Invoke-WebRequest -Uri $bleachbit_portable_url -OutFile $zip
Expand-Archive -LiteralPath $zip -DestinationPath $ourpath

$Params = ” –clean microsoft_edge.cache chromium.cache firefox.cache google_chrome.cache internet_explorer.cache flash.cache java.cache system.tmp system.updates adobe_reader.cache”
$ParsedParams = $Params.Split(” “)

& $exe $ParsedParams

July 30 2021

MySQL Native Login

Remove the plugin

[mysql] use mysql;
[mysql] update user set plugin=” where User=’root’;
[mysql] flush privileges;
[mysql] \q

https://stackoverflow.com/questions/36864206/sqlstatehy000-1698-access-denied-for-user-rootlocalhost

July 11 2021

smartctl and megaraid/LSI

Run smartctl –scan to print all devices attached including the device id and RAID type:

# smartctl –scan
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/bus/0 -d megaraid,0 # /dev/bus/0 [megaraid_disk_00], SCSI device
/dev/bus/0 -d megaraid,1 # /dev/bus/0 [megaraid_disk_01], SCSI device
/dev/bus/0 -d megaraid,2 # /dev/bus/0 [megaraid_disk_02], SCSI device

https://serverfault.com/questions/620019/smartctl-megaraid-how-to-find-the-right-device-node-for-an-adapter

https://unix.stackexchange.com/questions/485463/smartctl-megaraid-n-how-to-find-the-right-value-for-n