TODO - Writing rsyslogd to database and viewing with modern tools

When I get some spare time I would like to make rsyslogd write its contents to database, and parse it through a web interface. In the meantime I’ll just collect some guides here. Writing syslog messages to MySQL, PostgreSQL or any other supported Database Handling a massive syslog database insert rate with Rsyslog Elasticsearch Elasticsearch - Logstash Elasticsearch - Kibana

December 9, 2017  | 

Fonts

FiraCode Supports iTerm2 & IntelliJ Has ligatures

November 18, 2017  | 

Test color support in bash

for i in {0..255} ; do printf "\x1b[48;5;%sm%3d\e[0m " "$i" "$i" if (( i == 15 )) || (( i > 15 )) && (( (i-15) % 6 == 0 )); then printf "\n"; fi done

November 18, 2017  |  🏷️Bash

Adding subdomain to Let's encrypt

Extending the certificate to also cover www.iix.se sudo certbot certonly --standalone -d iix.se,www.iix.se,monit.iix.se,test.iix.se Sat Nov 04 11:14 W44 Saving debug log to /var/log/letsencrypt/letsencrypt.log Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org ------------------------------------------------------------------------------- You have an existing certificate that contains a portion of the domains you requested (ref: /etc/letsencrypt/renewal/iix.se.conf) It contains these names: iix.se, monit.iix.se, test.iix.se You requested these names for the new certificate: iix.se, www.iix.se, monit.iix.se, test.iix.se. Do you want to expand and replace this existing certificate with the new certificate? ------------------------------------------------------------------------------- (E)xpand/(C)ancel: e Renewing an existing certificate Performing the following challenges: tls-sni-01 challenge for iix.se tls-sni-01 challenge for www.iix.se tls-sni-01 challenge for monit.iix.se tls-sni-01 challenge for test.iix.se /usr/lib/python2.7/dist-packages/OpenSSL/rand.py:58: UserWarning: implicit cast from 'char *' to a different pointer type: will be forbidden in the future (check that the types are as you expect; use an explicit ffi.cast() if they are correct) result_code = _lib.RAND_bytes(result_buffer, num_bytes) Waiting for verification... Cleaning up challenges Generating key (2048 bits): /etc/letsencrypt/keys/0009_key-certbot.pem Creating CSR: /etc/letsencrypt/csr/0009_csr-certbot.pem IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/iix.se/fullchain.pem. Your cert will expire on 2018-02-02. To obtain a new or tweaked version of this certificate in the future, simply run certbot again. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le

New equipment for home LAN

This is basically scratch-space for my plans (or dreams) of buying new home equipment. I have some smaller problems with my current equipment, and it would be nice to upgrade to something more modern. Current issues Router (which also is modem and access-point) is not wall-mountable and is currently placed in an awkward position. Switch does not support link aggregation (IEEE 802.3ad), which my storage supports. Current plans I have no real need for a new router, as I can just as well run pfsense on a KVM instead. For that reason I can just buy a nice, wall-mountable AP. Likely with PoE. Since my current switch does not support PoE either, that needs to be a requirement for it. Since I would like to be a bit future proof, PoE+ would be nice, if not too expensive. As I currently have 5 slots, which are all filled, I would need at least 8 slots on it. Since I’m thinking of future-proofing with PoE+, I might want an SFP slot, since I might have some use for it later. ...

October 21, 2017  | 

Windows 10 cleanup after install

Both come from reddit Alternative 1 @rem *** Disable Some Service *** sc stop DiagTrack sc stop diagnosticshub.standardcollector.service sc stop dmwappushservice sc stop WMPNetworkSvc sc stop WSearch sc config DiagTrack start= disabled sc config diagnosticshub.standardcollector.service start= disabled sc config dmwappushservice start= disabled REM sc config RemoteRegistry start= disabled REM sc config TrkWks start= disabled sc config WMPNetworkSvc start= disabled sc config WSearch start= disabled REM sc config SysMain start= disabled REM *** SCHEDULED TASKS tweaks *** REM schtasks /Change /TN "Microsoft\Windows\AppID\SmartScreenSpecific" /Disable schtasks /Change /TN "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /Disable schtasks /Change /TN "Microsoft\Windows\Application Experience\ProgramDataUpdater" /Disable schtasks /Change /TN "Microsoft\Windows\Application Experience\StartupAppTask" /Disable schtasks /Change /TN "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /Disable schtasks /Change /TN "Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /Disable schtasks /Change /TN "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /Disable schtasks /Change /TN "Microsoft\Windows\Customer Experience Improvement Program\Uploader" /Disable schtasks /Change /TN "Microsoft\Windows\Shell\FamilySafetyUpload" /Disable schtasks /Change /TN "Microsoft\Office\OfficeTelemetryAgentLogOn" /Disable schtasks /Change /TN "Microsoft\Office\OfficeTelemetryAgentFallBack" /Disable schtasks /Change /TN "Microsoft\Office\Office 15 Subscription Heartbeat" /Disable REM schtasks /Change /TN "Microsoft\Windows\Autochk\Proxy" /Disable REM schtasks /Change /TN "Microsoft\Windows\CloudExperienceHost\CreateObjectTask" /Disable REM schtasks /Change /TN "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" /Disable REM schtasks /Change /TN "Microsoft\Windows\DiskFootprint\Diagnostics" /Disable *** Not sure if should be disabled, maybe related to S.M.A.R.T. REM schtasks /Change /TN "Microsoft\Windows\FileHistory\File History (maintenance mode)" /Disable REM schtasks /Change /TN "Microsoft\Windows\Maintenance\WinSAT" /Disable REM schtasks /Change /TN "Microsoft\Windows\NetTrace\GatherNetworkInfo" /Disable REM schtasks /Change /TN "Microsoft\Windows\PI\Sqm-Tasks" /Disable REM The stubborn task Microsoft\Windows\SettingSync\BackgroundUploadTask can be Disabled using a simple bit change. I use a REG file for that (attached to this post). REM schtasks /Change /TN "Microsoft\Windows\Time Synchronization\ForceSynchronizeTime" /Disable REM schtasks /Change /TN "Microsoft\Windows\Time Synchronization\SynchronizeTime" /Disable REM schtasks /Change /TN "Microsoft\Windows\Windows Error Reporting\QueueReporting" /Disable REM schtasks /Change /TN "Microsoft\Windows\WindowsUpdate\Automatic App Update" /Disable @rem *** Remove Telemetry & Data Collection *** reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" /v PreventDeviceMetadataFromNetwork /t REG_DWORD /d 1 /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\MRT" /v DontOfferThroughWUAU /t REG_DWORD /d 1 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\SQMClient\Windows" /v "CEIPEnable" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "AITEnable" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "DisableUAR" /t REG_DWORD /d 1 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f reg add "HKLM\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener" /v "Start" /t REG_DWORD /d 0 /f reg add "HKLM\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\SQMLogger" /v "Start" /t REG_DWORD /d 0 /f @REM Settings -> Privacy -> General -> Let apps use my advertising ID... reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v Enabled /t REG_DWORD /d 0 /f REM - SmartScreen Filter for Store Apps: Disable reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" /v EnableWebContentEvaluation /t REG_DWORD /d 0 /f REM - Let websites provide locally... reg add "HKCU\Control Panel\International\User Profile" /v HttpAcceptLanguageOptOut /t REG_DWORD /d 1 /f @REM WiFi Sense: HotSpot Sharing: Disable reg add "HKLM\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" /v value /t REG_DWORD /d 0 /f @REM WiFi Sense: Shared HotSpot Auto-Connect: Disable reg add "HKLM\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" /v value /t REG_DWORD /d 0 /f @REM Change Windows Updates to "Notify to schedule restart" reg add "HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" /v UxOption /t REG_DWORD /d 1 /f @REM Disable P2P Update downlods outside of local network reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" /v DODownloadMode /t REG_DWORD /d 0 /f REM *** Hide the search box from taskbar. You can still search by pressing the Win key and start typing what you're looking for *** REM 0 = hide completely, 1 = show only icon, 2 = show long search box reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f REM *** Disable MRU lists (jump lists) of XAML apps in Start Menu *** reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_TrackDocs" /t REG_DWORD /d 0 /f REM *** Set Windows Explorer to start on This PC instead of Quick Access *** REM 1 = This PC, 2 = Quick access REM reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "LaunchTo" /t REG_DWORD /d 1 /f @rem Remove Apps PowerShell -Command "Get-AppxPackage *3DBuilder* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *Getstarted* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *WindowsAlarms* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *WindowsCamera* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *bing* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *MicrosoftOfficeHub* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *OneNote* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *people* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *WindowsPhone* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *photos* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *SkypeApp* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *solit* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *WindowsSoundRecorder* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *zune* | Remove-AppxPackage" REM PowerShell -Command "Get-AppxPackage *WindowsCalculator* | Remove-AppxPackage" REM PowerShell -Command "Get-AppxPackage *WindowsMaps* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *Sway* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *CommsPhone* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *ConnectivityStore* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *Microsoft.Messaging* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *Facebook* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *Twitter* | Remove-AppxPackage" PowerShell -Command "Get-AppxPackage *Drawboard PDF* | Remove-AppxPackage" @rem NOW JUST SOME TWEAKS REM *** Show hidden files in Explorer *** REM reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Hidden" /t REG_DWORD /d 1 /f REM *** Show super hidden system files in Explorer *** REM reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowSuperHidden" /t REG_DWORD /d 1 /f REM *** Show file extensions in Explorer *** reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f REM *** Uninstall OneDrive *** start /wait "" "%SYSTEMROOT%\SYSWOW64\ONEDRIVESETUP.EXE" /UNINSTALL rd C:\OneDriveTemp /Q /S >NUL 2>&1 rd "%USERPROFILE%\OneDrive" /Q /S >NUL 2>&1 rd "%LOCALAPPDATA%\Microsoft\OneDrive" /Q /S >NUL 2>&1 rd "%PROGRAMDATA%\Microsoft OneDrive" /Q /S >NUL 2>&1 reg add "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\ShellFolder" /f /v Attributes /t REG_DWORD /d 0 >NUL 2>&1 reg add "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\ShellFolder" /f /v Attributes /t REG_DWORD /d 0 >NUL 2>&1 echo OneDrive has been removed. Windows Explorer needs to be restarted. pause start /wait TASKKILL /F /IM explorer.exe start explorer.exe Alternative 2 get-appxpackage messaging | remove-appxpackage get-appxpackage sway | remove-appxpackage get-appxpackage commsphone | remove-appxpackage get-appxpackage windowsphone remove-appxpackage get-appxpackage phone | remove-appxpackage get-appxpackage communicationsapps | remove-appxpackage get-appxpackage people | remove-appxpackage get-appxpackage zunemusic | remove-appxpackage get-appxpackage zunevideo | remove-appxpackage get-appxpackage zune | remove-appxpackage get-appxpackage bingfinance | remove-appxpackage get-appxpackage bingnews | remove-appxpackage get-appxpackage bingsports | remove-appxpackage get-appxpackage bingweather | remove-appxpackage get-appxpackage bing | remove-appxpackage get-appxpackage onenote | remove-appxpackage get-appxpackage maps | remove-appxpackage get-appxpackage solitaire | remove-appxpackage get-appxpackage officehub | remove-appxpackage get-appxpackage skypeapp | remove-appxpackage get-appxpackage getstarted | remove-appxpackage get-appxpackage 3dbuilder | remove-appxpackage Get-AppxPackage drawboardpdf | Remove-AppxPackage Get-AppxPackage freshpaint | Remove-AppxPackage Get-AppxPackage nytcrossword | Remove-AppxPackage Get-AppxPackage microsoft.xboxapp | Remove-AppxPackage Get-AppxPackage SurfaceHub | Remove-AppxPackage Get-AppxPackage flipboard | Remove-AppxPackage

September 30, 2017  | 

Umoria: Farming with Wand of Clone Monster

To farm with a wand of clone monster, you need the following: A wand of clone monster A monster with good drops (optional) A way to refresh your wand As always in moria, things can go wrong. It would be stupid to not carry an escape mechanism like a scroll of teleportation. Wand of Clone Monster The wand begins dropping on 750ft, and is therefore best aquired there. It’s not that rare though, so you will probably find a few every once in a while. ...

Umoria: General Tips

Umoria General Tips Traps Disarming traps give exp. But only do this if you are fine with the trap possibly springing on you, since sooner or later it will. Invisible monsters A good way to kill invisible monsters is moving into a corridor, waiting until it hits you, and then attacking the way you came from. If this doesn’t work, it’s one of the ghosts which can walk through walls. It’s usually better to just leave than trying to kill those, since they don’t chase much anyways. ...

Umoria: Guide to Moria Adventuring

Guide to Moria Adventuring (or How to Slay Your Balrog) The information on this page comes from Beej’s moria page, 30 minutes of UMoria, investigating the source code, and simply playing the game. If there’s something you want to know that I don’t mention, it’s likely mentioned in one of the links. Links Beej’s Moria Page 30 minutes of UMoria (walkthrough) Debian moria package The Moria Spoilers (data sheets) Table of Content General Tips Farming with a wand of clone monsters Winning UMoria with a mage

Umoria: Winning with a Mage

This walkthrough is based on my attempt to win the game with an elven mage. Much of this comes from 30 minutes of UMoria, but it’s a very long show, and I prefer text to video. Character Generation A elven mage gets a lot of negative STR and CON, which you need to be aware of. STR INT WIS DEX CON CHA Elf -1 | +2 | +1 | +1 | -2 | +1 Mage -5 | +3 | +0 | +1 | -2 | +1 Total -6 | +5 | +1 | +2 | -4 | +2 My mage started out with 5 STR and >18 INT, which turned out to be a bit problematic because of weight issues. ...