Skip to content

Instantly share code, notes, and snippets.

View petski's full-sized avatar

Patrick Kuijvenhoven petski

View GitHub Profile
@petski
petski / wslhosts.ps1
Last active July 11, 2024 14:23
Update the Windows hosts file with the WSL2 IP address and additional hostnames
# Description: Update the Windows hosts file with the WSL2 IP address and additional hostnames.
# It will add the WSL2 IP address to the hosts file with the hostname `wsl.local`.
# It will also add any additional hostnames from the `~/.wslhosts` file in the WSL2 home directory.
#
# Usage: `powershell -ExecutionPolicy Bypass -File wslhosts.ps1`
#
# Follow these steps to run the script at each WSL2 boot:
# - Open Task Scheduler
# - Create a new task
# - Set the trigger to run on:
@petski
petski / rrdtool-1.6.0-newline-in-graphtitle.diff
Created March 8, 2017 12:16
Patch to support newline(s) in rrdtool title. Separation char is "?"
--- rrdtool-1.6.0-orig/src/rrd_graph.c 2017-03-07 10:20:47.154603542 +0100
+++ rrdtool-1.6.0/src/rrd_graph.c 2017-03-07 11:57:28.174767236 +0100
@@ -3084,6 +3084,8 @@
long i;
int res = 0;
double X0, Y0; /* points for filled graph and more */
+ int j = 0;
+ imgtitle_t myimgtitle_t;
struct gfx_color_t water_color;
FROM phusion/baseimage:0.9.16
CMD ["/sbin/my_init"]
#
# Apt
#
RUN apt-get -y update
RUN apt-get -y install \