Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeroen Wiert Pluimers jpluimers

  • wiert.me
  • Amsterdam, The Netherlands
View GitHub Profile
@jpluimers
jpluimers / disable-windows-news-feeds.bat
Created Jun 23, 2022
Disabling the Windows 10 and Windows 11 news (and weather) feeds
View disable-windows-news-feeds.bat
@echo off
:: https://wiert.wordpress.com/?p=99344
:: no need to logoff/logon or reboot, killing explorer then restarting it suffices
:: without the kill; explorer will reset the value from 2 to 0 within milliseconds
taskkill /F /IM explorer.exe
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds" /v "ShellFeedsTaskbarViewMode"
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds" /v "ShellFeedsTaskbarViewMode" /t REG_DWORD /d "2" /f
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds" /v "ShellFeedsTaskbarViewMode"
start explorer.exe
@jpluimers
jpluimers / explanation.md
Created Jun 16, 2022 — forked from masak/explanation.md
How is git commit sha1 formed
View explanation.md

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry.

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@jpluimers
jpluimers / refresh.js
Created May 18, 2022
Embed html page in iframe then autorefresh that iframe every 5 minutes (1000 milliseconds * 60 seconds per minute * 5 minutes = 30000 milliseconds)
View refresh.js
javascript:document.getElementsByTagName("body")[0].innerHTML = "<iframe id=\"testFrame\" src=\""+window.location.toString()+"\" style=\"position: absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%;\"><\/iframe>";reloadTimer = setInterval(function(){ document.getElementById("testFrame").src=document.getElementById("testFrame").src },300000)
@jpluimers
jpluimers / gist:7be482fdafee9e2bf0a6cf360ce0e5b3
Created May 11, 2022
Chocolatey vcredist140 update failing during "You have vcredist140 v14.31.31103.20220402 installed. Version 14.32.31326 is available based on your source(s)."
View gist:7be482fdafee9e2bf0a6cf360ce0e5b3
2022-05-11 11:35:36,609 9952 [DEBUG] - Package 'vcredist140' found on source 'https://chocolatey.org/api/v2/'
2022-05-11 11:35:36,609 9952 [WARN ] -
You have vcredist140 v14.31.31103.20220402 installed. Version 14.32.31326 is available based on your source(s).
2022-05-11 11:35:36,703 9952 [DEBUG] - Backing up existing vcredist140 prior to operation.
2022-05-11 11:35:36,719 9952 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\vcredist140'
to 'C:\ProgramData\chocolatey\lib-bkp\vcredist140'
2022-05-11 11:35:38,734 9952 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib\vcredist140".
2022-05-11 11:35:38,734 9952 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\vcredist140\vcredist140.nupkg"
to "C:\ProgramData\chocolatey\lib\vcredist140\vcredist140.nupkg".
2022-05-11 11:35:38,734 9952 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\vcredist140\vcredist140.nuspec"
View beer.o.clock.txt
SET search_path TO public, pg_catalog;
SET
CREATE OR REPLACE FUNCTION now(beverage TEXT= 'beer')
RETURNS TEXT
AS $$
BEGIN
RETURN 'It's | quote literal(beverage) || o''clock! ';
END;
$$
LANGUAGE plpgsql
@jpluimers
jpluimers / clonevm.sh
Created Apr 17, 2022
VMware ESXi – Script to clone a VM without vSphere or vCenter. Original: https://grangerx.wordpress.com/2020/09/23/vmware-esxi-script-to-clone-a-vm/
View clonevm.sh
#!/bin/sh
#File: clonevm.sh
#Version: 2020.09.23.A
#Author: www.grangerx.com
#Set debug = true to enable debug echoes.
debug=false
#For format: accepts same, zeroedthick, eagerzeroedthick, thin, rdm:dev, rdmp:dev, or 2gbsparse.
format="thin"
@jpluimers
jpluimers / vm-rename.sh
Last active Apr 18, 2022 — forked from Gremgoll/vm-rename
Script to rename a virtual machine in ESXi 6
View vm-rename.sh
#!/bin/sh
#
# shell script to rename a virtual machine in ESXi
#set -x
if [ $# -ne 4 ]; then
echo "Usage: $0 VOLNAME DIRNAME OLDNAME NEWNAME
where VOLNAME is the volume name, e.g. datastore1,
DIRNAME is the the name of the directory of the virtual machine,
@jpluimers
jpluimers / gist:d453c707276298f47729d96a608f8b75
Created Mar 30, 2022 — forked from spudbean/gist:1558257
Look of disapproval and other emoticons
View gist:d453c707276298f47729d96a608f8b75
ಠ_ಠ
( ͡° ͜ʖ ͡°)
¯\_(ツ)_/¯
(╯°□°)╯︵ ┻━┻
http://www.fileformat.info/convert/text/upside-down.htm
WRTTN http://wrttn.me/30dbfd/
Unicode Emoticons
View exception.cs
throw new_ಠ();
class ಠ_ಠ : public class : Exception
{
}
View how-to-view-source-of-chrome-extension.md

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.