C-NET :: PROJECTS

ls -t projects/ | grep -i "Reference"

Reference

2026

Excel Conditional Formatting

Two Excel conditional formatting tricks: apply a rule to a whole sheet, and match exact cell values with EXACT().

Windows · Reference

2024

Quickly generate a 10 year, base64 encoded, self signed, client cert using OpenSSL

A bash script that makes a self-signed client certificate valid for 10 years with OpenSSL and prints the PFX as base64.

Reference · Solved Problems
PowerShell script to download a certificate and update all IIS sites' bindings

A PowerShell script that downloads a certificate, installs it in the WebHosting store and sets it on every HTTPS binding in IIS.

Reference

2023

Forcing an ARRAY() in postgres subqueries

How to stop the PostgreSQL planner from filtering on an IN subquery too late by wrapping the subquery in = ANY(ARRAY(...)).

Reference
TIKI-100 Documentation

Archived scans of manuals and the software catalog for the Norwegian TIKI-100 microcomputer.

Reference

2022

Allowing an empty JSON body, or no Content-Type, in a C# ASP.NET Core API

An ASP.NET Core attribute that accepts requests with an empty body or no Content-Type, avoiding 415 and 400 errors on net6 and older.

Reference · Solved Problems
Moving columns in PowerQuery without naming every column

How to move a column to a given position in Power Query without naming every column, also when merging and expanding tables.

Windows · Reference · Solved Problems
Unpivoting two columns in PostgreSQL

How to unpivot two id columns into one distinct column without NULLs in PostgreSQL, using UNNEST on an array instead of a UNION.

Reference
Recursive PostgreSQL user manager query for PowerBI path value, with loop handling

A recursive PostgreSQL query that builds a manager path for PowerBI's PATH() while it skips loops and missing managers.

Reference
Copying data from a restored postgres database to the live database

How to copy selected rows from a restored PostgreSQL database into the live database with COPY and psql.

Linux · Reference · Software

2021

AWS RDS IAM Login pitfalls and checklist

A checklist for fixing failed IAM database logins to AWS RDS PostgreSQL from ECS containers, the CLI and C#.

Reference
Allowing RDP remote passwords in Windows 10 in 2021

How to stop Windows 10 from prompting for a password when connecting with saved RDP credentials, through a Group Policy setting.

Windows · Reference · Solved Problems
DNS names for VirtualBox client machines

A PowerShell script that adds the IP addresses of running VirtualBox guests to the Windows hosts file, and autostarts chosen VMs headless.

Howto's · Linux · Windows · Reference · Solved Problems
Office Volume License Keys (VLK)

KMS client setup keys for volume-licensed Office 2016, 2019, LTSC 2021 and LTSC 2024 products.

Reference
Finding and killing stuck or mistyped postgresql queries

PostgreSQL queries to list, cancel and terminate running or stuck queries.

Howto's · Reference · Software
Web Echo Service for developers

A pointer to the C-Net Echo Service, which returns the exact HTTP request it receives, for web client and proxy development.

Linux · Reference · Solved Problems
Generating a C# library from swagger.json using Docker for Windows

How to generate a C# client library from a swagger.json URL with swagger-codegen or openapi-generator in Docker for Windows.

Windows · Reference
Remote Desktop (RDP) to a computer that's enrolled in Azure AD

How to connect with Remote Desktop to an Azure AD joined computer from a machine outside the domain, with the .rdp file settings it needs.

Reference

2020

curl SSL fails even with ca-certificates installed

How to fix curl error 60 in a Docker container that has ca-certificates installed, by forcing a certificate rehash.

Linux · Reference · Solved Problems
GLaDOS Voice Generator (weekend project)

Announcement of the GLaDOS Voice Generator, a replacement for an offline GLaDOS speech synthesis site.

Reference · Solved Problems · Software
Perl one-liner to create random passwords

A Perl one-liner that prints a random alphanumeric password of a chosen length.

Linux · Reference
Disable the "Other people are logged on to this computer" message on a Windows VM

A registry setting that stops Windows asking for confirmation when the power button is pressed while other users are logged on.

Reference

2019

How to use Invoke-WebRequest in PowerShell without having to first open Internet Explorer

How to disable the Internet Explorer first-run wizard so Invoke-WebRequest works without -UseBasicParsing.

Reference
The trust relationship between this workstation and the primary domain failed

How to fix a lost trust relationship with the domain on a restored Windows machine with Reset-ComputerMachinePassword, without rejoining the domain.

Windows · Reference · Solved Problems
Finding the first (default) IPv4 gateway in a Windows batch script

A Windows batch snippet that reads the default IPv4 gateway from route print into a variable.

Reference

2018

Enable remote management of Windows Server Core and Hyper-V Core

PowerShell commands that enable the firewall rules needed to manage Windows Server Core and Hyper-V Core remotely.

Windows · Reference
My tweaks to get Kali Linux running well on the GPD Pocket

Tweaks for Kali Linux on the GPD Pocket: no GRUB splash, WiFi and power settings with tlp, lid screen handling and xorg config.

Linux · Reference · Solved Problems
Drivers for the Multicom Talisa U230

A download of the WiFi driver and the other drivers for the Multicom Talisa U230 laptop that Windows Update does not provide.

Windows · Reference · Solved Problems
Checking for required packages on a Debian (or derivative) system

A Bash snippet that checks a list of required Debian packages with a single dpkg-query call and reports the missing ones.

Linux · Reference · Solved Problems
Some tools for my GPD Pocket

Archived copies of AutoHotkey and LidWatcher, used on a GPD Pocket laptop.

Reference

2017

Supermicro X10DRL-i manual

A copy of the Supermicro X10DRL-i motherboard manual (MNL-1566), for reference.

Reference
Finding the most expensive recent SQL queries on SQL Server

A SQL Server query on the dynamic management views that lists the most expensive recent queries by reads, writes or CPU time.

Windows · Reference
Creating a local Certificate Authority using OpenSSL

Pointers to guides for running a local OpenSSL certificate authority and adding custom fields to client certificates.

Reference · Solved Problems
How to set the default location for new computers in Active Directory

How to change the default container for new computer accounts in Active Directory with redircmp.

Windows · Reference
Figuring out which session is blocking a query on Microsoft SQL Server (query suspended)

A SQL Server query that shows which session is blocking which, to find the cause of suspended queries and lock waits.

Howto's · Windows · Reference · Solved Problems
Yamaha Sting owner's manual

A copy of the Yamaha Sting owner's manual as a PDF.

Reference
Reset dpkg (apt) package configuration to default, restore deleted config files

How to restore a Debian package's deleted or changed config files with dpkg or apt-get and --force-confmiss.

Linux · Reference · Solved Problems
Installing Windows XP on the Dell Vostro 1700

How to install Windows XP on a Dell Vostro 1700, with an F6 floppy of SATA drivers and a collection of the XP drivers that work.

Windows · Reference
Windows Volume License Keys (VLK)

Windows KMS client setup keys for Windows and Windows Server editions, the Windows 10 Pro upgrade key, and the commands to activate with them.

Windows · Reference

2016

Some fonts shown as squares in Kali Linux

How to fix fonts shown as squares in Kali Linux by rebuilding the font cache.

Linux · Reference · Solved Problems
My tweaks to Kali Linux (note to self)

A checklist of settings, packages and tweaks for Kali Linux 2016.1: autologin, smartmontools, power button, encrypted swap file and virt-manager.

Linux · Reference
Enabling Quick Launch in Windows 10

How to add the classic Quick Launch toolbar to the Windows 10 taskbar, so pinned programs stay in place.

Windows · Reference · Solved Problems
Find and kill long running MS SQL Server queries

SQL queries to list running MS SQL Server queries by elapsed time and to kill one or all long-running ones.

Windows · Reference · Solved Problems
Squid Compile with SSL support under Debian Jessie

How to rebuild the Debian Jessie squid3 package from source with SSL support enabled.

Linux · Reference

2015

Force removal of a package that's "is in a very bad inconsistent state"

How to force dpkg to remove a package that is in a very bad inconsistent state.

Linux · Reference · Solved Problems
A few group policies I use on Windows 10

Group policy settings for Windows 10 that disable the lock screen and prevent the use of OneDrive.

Windows · Reference
Wiping an (Azure) SQL Server database, deleting all tables

A T-SQL script that drops all foreign keys, tables and views in a SQL Server or Azure SQL database.

Windows · Reference
Mounting and using KVM raw image files on the host system

How to map the partitions of a KVM raw disk image on the host with losetup and kpartx, and how to unmap them again.

Linux · Reference
Hardening IIS and scanning for SSL-related vulnerabilities - IISCrypto

IISCrypto, a tool that sets the registry entries to allow only secure cryptographic algorithms on IIS, with archived copies and a link to an SSL scanner.

Windows · Reference
Tool tip: "vbetool" runs real-mode video BIOS code to alter hardware state

The vbetool manual page: a tool that turns displays on and off and changes video BIOS state from the console.

Linux · Reference
The fastest way to extend disk image files on Linux

How to grow a virtual machine disk image file on Linux with the truncate tool instead of dd.

Linux · Reference · Solved Problems
Aeon Cobra 50cc (GOES 50s) service manuals and parts lists

Parts lists and service manuals (PDF) for the Aeon Cobra 50cc quad, sold in the Nordic countries as the GOES 50s.

Reference
MSSQL Mass Delete

How to delete large amounts of data from a SQL Server table in small chunks with DELETE TOP.

Howto's · Windows · Reference · Solved Problems
Deleting duplicates in SQL Server before adding a Unique Index

How to delete only the duplicate rows in a SQL Server table with ROW_NUMBER() so that a unique index can be added.

Windows · Reference · Solved Problems
What to do when kill -9 doesn't do anything

A pointer to an explanation of why kill -9 sometimes has no effect on a process.

Linux · Reference
Excellent article about the issues with 24 bit audio

A pointer to an article on xiph.org explaining why 24 bit audio playback is not audibly better, with an archived copy.

Reference
Writing a newline to separate commands in XChat

How to type a line break in XChat to put several commands on one line.

Linux · Reference
MSSQL Mass Copy

SQL Server batch loops for copying large amounts of data between tables without locking them for a long time.

Windows · Reference
SMPS Repair

A pointer to a useful general guide on repairing switched mode power supplies, with an archived copy.

Reference

2014

Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

How to fix the IIS ManagedPipelineHandler bad module error by registering ASP.NET 4 with aspnet_regiis -i.

Windows · Reference · Solved Problems
Enabling read_committed_snapshot on an existing MSSQL database

The SQL statements that turn on snapshot isolation and read_committed_snapshot for an existing SQL Server database.

Windows · Reference · Solved Problems
Typing the escape character ^] on a non-english keyboard

How to type the telnet escape character ^] on a Norwegian or other non-English keyboard: press Ctrl + 5.

Linux · Reference · Solved Problems
Removing VMware Player or workstation when the Hyper-V role is active

How to uninstall VMware Player or Workstation when the Hyper-V role blocks the uninstaller, by editing bootstrap.lua.

Windows · Reference · Solved Problems
Removing a WIFI-network in Windows 8

How to list and delete stored WiFi network profiles in Windows 8 with netsh.

Windows · Reference · Solved Problems
Shrinking a vmdk with VMware Player

How to shrink a VMware virtual disk from the command line with VMwareToolboxCmd.

Linux · Reference · Solved Problems

2013

Disable screensaver in default desktop Raspbian installation

How to disable the screensaver and screen blanking in the default LXDE desktop on Raspbian.

Linux · Reference
How to prevent ssh -X from hanging on exit when dbus is used

How to stop ssh -X from hanging on exit when the remote program starts dbus, by launching dbus yourself and killing it afterwards.

Linux · Reference · Solved Problems
Cygwin auto started sshd service as single user on Windows 8

Steps to run the Cygwin sshd service as a specific user without privilege separation on Windows 8, including the firewall rule.

Windows · Reference
Disable UAC in Windows 8

How to disable UAC in Windows 8 through secpol.msc or, on non-pro editions, the EnableLUA registry value.

Windows · Reference · Solved Problems

2012

XP Windows Update error 0x8024400A solution

How to fix Windows Update error 0x8024400A on Windows XP by installing Service Pack 3.

Windows · Reference · Solved Problems
Adding http:// back to the URL bar in Firefox

Where to find how to show the http:// prefix in the Firefox URL bar again, with an archived copy of the ghacks.net article.

Reference · Software
Parse long options in bash scripts

A Bash script by geirha that parses both short and long command line options in shell scripts.

Linux · Reference
Creating .deb-Packages With Checkinstall

Why to use checkinstall to wrap a from-source install in a .deb package on Debian, with a pointer to a howto.

Linux · Reference

2011

UDP through SSH

A link to a guide on tunneling UDP traffic through an SSH connection, with an archived copy.

Linux · Reference
SSH in a while loop - stdin problems

Why ssh inside a while read loop only runs once, because ssh consumes stdin, and how the -n option fixes it.

Linux · Reference · Solved Problems
Set php.ini values using .htaccess

How to set php.ini values with php_value lines in an Apache .htaccess file.

Linux · Reference
GCC stray X in program

How to fix GCC's "stray in program" error caused by invalid characters in source code, from building the Intel EMGD driver.

Linux · Reference · Solved Problems
Tell your friends how to burn ISO files properly

A pointer to a guide on burning an ISO image to disc correctly with common Windows burning software.

Windows · Reference
xorg.conf for KVM

An xorg.conf that works for a Linux guest in KVM, with the VESA driver and vmmouse.

Linux · Reference
Debian APT Pinning properly explained

A pointer to a Debian cheat sheet that explains APT pinning, with an archived PDF copy.

Linux · Reference
Using LD_PRELOAD to override a function

How to override a library function such as getpid with LD_PRELOAD and dlsym(RTLD_NEXT), with a complete example.

Linux · Reference
How to Hide a User Account from the Welcome Screen

How to hide a user account from the Windows Welcome screen with the SpecialAccounts registry key.

Windows · Reference
Save and restore partition tables with sfdisk

How to copy a partition table from one drive to a replacement drive with sfdisk, for example when rebuilding an mdadm RAID.

Linux · Reference

2010

sudo without a password

How to let a user run sudo without a password, for all commands or for specific ones, in /etc/sudoers.

Linux · Reference
Using Flags and Arguments in Bash

A small example bash script that parses command line flags and their arguments with getopts.

Linux · Reference
exim4 smarthost smtp password

How to give exim4 a username and password for an authenticated smarthost in /etc/exim4/passwd.client.

Linux · Reference
Use OpenDNS with Smoothwall Express 3.x

How to make Smoothwall Express 3.x use OpenDNS instead of the DNS servers from the ISP's DHCP, by editing rc.updatered.

Linux · Reference
What's touching that config file?!

How to find which Debian package's maintainer script changes a config file, by grepping the postinst scripts in /var/lib/dpkg/info.

Linux · Reference · Solved Problems
Switching alsa sound cards around

How to change the order of ALSA sound cards and pick the default card with module index options.

Linux · Reference

2009

Hide join/part messages in XChat

How to hide and show join and part messages in XChat with the irc_conf_mode setting.

Linux · Reference
Windows 7 autologin

How to open the user accounts dialog with control userpasswords2 to let Windows 7 log in automatically.

Windows · Reference
XFCE: Unable to perform shutdown

How to fix the XFCE "Unable to perform shutdown" error by allowing the HAL shutdown, reboot and mount actions in PolicyKit.conf.

Linux · Reference
Resizing an ext3 filesystem on an lvm

The steps to shrink an ext3 filesystem and its LVM logical volume with resize2fs and lvreduce, and to give the space to another volume.

Linux · Reference
Moving or removing ~/.xsession-errors

How to move, disable or split ~/.xsession-errors per host by changing ERRFILE in /etc/X11/Xsession on Debian.

Linux · Reference
Wake on Lan on an Intel Mac Mini with Linux

How to enable Wake on LAN and power-on after power loss on an Intel Mac Mini running Linux, with setpci and ethtool.

Linux · Reference
Compiling and patching debian packages from source

A quick reference on how to compile Debian packages from source, and possibly patching them along the way.

Linux · Reference
VMware Server and Windows Firewall

How to let VMware Server remote connections through Windows Firewall by allowing vmware-authd.exe instead of port 902/TCP.

Windows · Reference

2008

How to kill a process that uses too much CPU

A Bash script, run from cron, that watches a process's CPU usage and sends an alert e-mail when it goes over a set limit.

Linux · Reference
Disable .bash_history logging in bash, Debian

How to stop bash from writing a .bash_history file while keeping the command history of the current session.

Reference
What separates a straight network cable from a crossover network cable

If you're connecting two machines with just a single network cable, like we did with parallell and serial cables back in the days, you've no doubt used a crossover cable. But why is this?

Reference
VESA console modes

A table of VESA mode numbers, in hex and decimal, for the Linux kernel's vga= boot parameter.

Reference
Disable bittorrent in Opera

Where to find the setting that disables the built-in BitTorrent support in the Opera browser.

Reference
Retrieving Opera wand passwords, opera password recovery

How to recover passwords stored in the Opera wand for free, with a power button from the Opera wiki.

Reference
Installing Opera in Debian etch

How to add the Opera apt repository and its signing key to Debian etch, and install the Opera browser.

Reference
Performance Tuning VMWare Server

Stole this from http://www.fewt.com/2008/06/performance-tuning-vmware-server-on.html for personal reference. EDIT 2015: The link is now dead, so props to me for doing so. Damn you, Internet.

Reference
Prevent syslog from spamming the console

How to set the klogd options so that syslog messages stay in the log files and are not printed on the console.

Reference
Configuring the Broadcom 2045A Bluetooth Dongle in Windows

stolen from http://www.harshj.com/2007/02/06/configuring-the-broadcom-2045a-bluetooth-dongle-in-windows/ for personal reference

Reference
ATX power connector pinout

A diagram of the ATX power connector pinout, for reference.

Reference
How to move a mysql database from one box to another

How to move a MySQL database to another server with mysqldump and the mysql client.

Linux · Reference
Nifty linux oneliners

This is a list of nifty oneliners I often use and just as often forget. Now I have a place to jot them down.

Linux · Reference
Installing vmware from scratch

How to install VMware Server 1.0 and its management interface on a fresh Debian install, including the libraries it needs.

Linux · Reference
Intellisense issues in Visual C++ 2005

Basic troubleshooting steps for IntelliSense problems in Visual C++ 2005.

Windows · Reference
Linux fan speed control - speedfan for linux

A short reference for getting lm-sensors and fan speed control working on Linux, as a Linux equivalent of SpeedFan.

Linux · Reference