Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeroen Wiert Pluimers jpluimers

  • wiert.me
  • Amsterdam, The Netherlands
View GitHub Profile
@jpluimers
jpluimers / wireguard_watchdog.sh
Created February 23, 2023 16:10
GL-SFT1200 firmware version 3.215, script `/usr/bin/wireguard_watchdog`
View wireguard_watchdog.sh
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2018 Aleksandr V. Piskunov <aleksandr.v.piskunov@gmail.com>.
# Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
#
# This watchdog script tries to re-resolve hostnames for inactive WireGuard peers.
# Use it for peers with a frequently changing dynamic IP.
# persistent_keepalive must be set, recommended value is 25 seconds.
#
@jpluimers
jpluimers / pfsense_cert_to_keystore.sh
Created February 23, 2023 10:11 — forked from noelmartinon/pfsense_cert_to_keystore.sh
Simple script to copy certificates from pfSense's certificate manager (which in my case were being updated with Let's Encrypt) to a Java keystore (in my case the one being used by Ubiquiti's Unifi Controller).
View pfsense_cert_to_keystore.sh
#!/bin/sh
set -eu
XMLLINT=/usr/local/bin/xmllint
BASE64_DECODE='/usr/local/bin/python2 -m base64 -d'
OPENSSL="/usr/bin/openssl"
KEYTOOL="/usr/local/bin/keytool"
PFSENSE_CONF=/cf/conf/config.xml
@jpluimers
jpluimers / Borland.Common.Targets
Created February 9, 2023 16:52 — forked from anonymous/Borland.Common.Targets
Delphi 2007 Borland.*.Targets files that should be in C:\Windows\Microsoft.NET\Framework\v2.0.50727 and C:\Windows\Microsoft.NET\Framework64\v2.0.50727
View Borland.Common.Targets
<!--
===============================================================================================
Borland.Common.Targets
WARNING
DO NOT MODIFY unless you have made a backup of these files. Modifying
this file unless you have knowledge about MSBuild you could cause problems
when loading or building projects in the IDE or building from the
@jpluimers
jpluimers / chocolatey.log
Created December 27, 2022 16:43
log of `choco install --yes --debug --verbose reshack`
View chocolatey.log
2022-12-27 17:42:02,235 23412 [INFO ] - ============================================================
2022-12-27 17:42:02,638 23412 [INFO ] - Chocolatey v1.2.1
2022-12-27 17:42:02,644 23412 [DEBUG] - Chocolatey is running on Windows v 10.0.22621.0
2022-12-27 17:42:02,647 23412 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2022-12-27 17:42:02,649 23412 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2022-12-27 17:42:02,656 23412 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" install --yes --debug --verbose reshack
2022-12-27 17:42:02,658 23412 [DEBUG] - Received arguments: install --yes --debug --verbose reshack
2022-12-27 17:42:02,701 23412 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2022-12-27 17:42:02,709 23412 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2022-12-27 17:42:02,715 23412 [DEBUG] - [Pending] Removing all pending packages that should not be considered ins
@jpluimers
jpluimers / sourceforge.to.github.impor.markdown
Created December 27, 2022 11:29 — forked from rubo77/sourceforge.to.github.impor.markdown
import a sourceforge project (with full history) to github
View sourceforge.to.github.impor.markdown

In order to clone the timeeffect application from sourceforge to github I performed the following steps.

rsync -av rsync://a.cvs.sourceforge.net/cvsroot/timeeffect/\* cvs
svn export --username=guest http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk
cp ./cvs2svn-trunk/cvs2git-example.options ./cvs2git.options
vim cvs2git.options # edit run_options.set_project
cvs2svn-trunk/cvs2git --options=cvs2git.options --fallback-encoding utf-8
#create at https://github.com/rubo77/timeeffect.git
git clone git@github.com:rubo77/timeeffect.git timeeffect-github
@jpluimers
jpluimers / download-file.bat
Created December 15, 2022 09:18
Quick batch file hack to download a file calling PowerShell to do the heavy lifting
View download-file.bat
@echo off
if "%1"=="" goto :help
@echo on
powershell.exe -Command (New-Object System.Net.WebClient).DownloadFile('%1','%2')
@echo off
goto :eof
:help
echo Syntax: %0 URL local-filename
@jpluimers
jpluimers / git-commit-template.md
Created December 9, 2022 14:41 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages
View git-commit-template.md

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@jpluimers
jpluimers / Personal Windows 10 customization script.bat
Created December 2, 2022 20:41 — forked from ScribbleGhost/Personal Windows 10 customization script.bat
A personal collection of Windows 10 customizations. Run as admin. Has to be run as a batch file, not in CMD.
View Personal Windows 10 customization script.bat
REM ----------------------------------------------------------------------------------------------------------
REM ### Apps and app suggestions
REM ----------------------------------------------------------------------------------------------------------
REM TITLE: Turn Off Automatic Installation of Suggested Apps in Windows 10
REM LINK: https://www.tenforums.com/tutorials/68217-turn-off-automatic-installation-suggested-apps-windows-10-a.html
REM OPTIONS: 0x00000001=On, 0x00000000=Off
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /V "SilentInstalledAppsEnabled" /T "REG_DWORD" /D "0x00000000" /F 1>NUL 2>&1
@jpluimers
jpluimers / query.c
Created November 24, 2022 18:38
IPC C Example; A C example to send a search query to Everything using WM_COPYDATA and retrieve the results. Note: requires Everything running in the background.; https://www.voidtools.com/support/everything/sdk/ipc_c_example/
View query.c
#define COPYDATA_QUERYCOMPLETE 0
BOOL sendquery(HWND hwnd,DWORD max_results,WCHAR *search_string,BOOL regex,BOOL match_case,BOOL match_whole_word,BOOL match_path)
{
EVERYTHING_IPC_QUERY *query;
DWORD len;
DWORD size;
HWND everything_hwnd;
COPYDATASTRUCT cds;
@jpluimers
jpluimers / grab-tco.sh
Created November 20, 2022 15:33 — forked from weiglemc/grab-tco.sh
Command-line to grab t.co URLs from Twitter archive
View grab-tco.sh
awk -F '\"' '/\"url\" :/ {print $4}' tweets.js