Skip to content

Instantly share code, notes, and snippets.

View randolf's full-sized avatar
🇨🇦
I may be slow to respond.

Randolf Richardson 張文道 randolf

🇨🇦
I may be slow to respond.
View GitHub Profile
@plembo
plembo / autopodonreboot.md
Last active June 19, 2025 19:24
Automatically start pod on reboot

Auto start podman containers on reboot as systemd services

NOTE: This was written while I was experimenting with using podman in lieu of docker, something I'm now looking at again. Not all docker images work with podman, so be prepared to struggle with the system and to engage in many fruitless Internet searches.

Intro

OK, so who knew podman containers won't automatically start on reboot? Yeah. Me neither.

Found out after a family member complained about getting a 500 error when trying to reach a PiGallery2 instance I had set up on the home server.

Fixing this is easy, as detailed in Pratham Patel's "How to Autostart Podman Containers?" over on Linux Handbook: A systemd servic

@Hakky54
Hakky54 / BRACES.MD
Last active April 21, 2025 18:46
Braces cheatsheet

braces-clipart-punctuation-6-original

@Grinnz
Grinnz / perl7faq.md
Last active June 27, 2025 13:40
Perl 7 FAQ

Perl 7 FAQ

last updated 2025-01-16

Is Perl 7 coming?

It has been the plan that this version number will be used for Perl at some point in the future.

As of 2025, there is now a proposal to use the second component of the Perl version number as the major version, skipping over the question of what Perl 7 should or should not be.

@uablrek
uablrek / mptcp.c
Created May 14, 2020 12:04
Small client/server MPTCP program
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <unistd.h>
#include <netdb.h>
#include <time.h>
@ajithrn
ajithrn / Making Apple Push Notification certificates on Linux
Last active March 7, 2025 18:58 — forked from boodle/Making Apple Developer certificates on Linux.md
Making Apple Apple Push Notification certificates on Linux
1. Create a new directory;
mkdir Apple\ Enterprise
cd Apple\ Enterprise
2. Generate a certificate signing request
openssl req -nodes -newkey rsa:2048 -keyout aps.key -out CertificateSigningRequest.certSigningRequest
3. With the information like so (ensure you give it a password):
Country Name (2 letter code) [AU]:GB
State or Province Name (full name) [Some-State]:London
@k3a
k3a / captest.c
Created April 25, 2019 16:28
Example code using libcap to set CAP_NET_BIND_SERVICE (binding to port 81) to the effective capability set.
/*
Example code using libcap to set CAP_NET_BIND_SERVICE
(binding to port 81) to the effective capability set.
For more info, see the full blog post at
https://k3a.me/linux-capabilities-in-a-nutshell/
*/
#include <stdlib.h>
#include <stdio.h>
@allyusd
allyusd / sql.cpp
Last active November 13, 2024 14:31
Qt PostgreSQL Example
QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
db.setHostName("127.0.0.1");
db.setDatabaseName("FirstDB");
db.setUserName("demo");
db.setPassword("password");
bool ok = db.open();
if (ok)
{
QSqlQuery query("SELECT \"SID\", \"Account\", \"CreateDate\", \"LoginTimes\" FROM \"Account\"");
@wenjianhn
wenjianhn / test_socket_prio_and_tos.c
Created January 29, 2015 03:30
Test if setsockopt(SO_PRIORITY) sets the IP type-of-service (TOS) field or not.
#include <assert.h>
#include <netinet/ip.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
void test_setsockopt()
{
int priority = 6;

channel operator quick reference

direct discussion about administrative action away from the main channel and into #reddit-diabetes-ops to minimise disruption. our -ops channel is the place where users should come to ask for our help. examples:

  • any sort of operator request or discussion of channel administration in the main channel
  • PMs asking why a ban was set
  • reports of harassment (unless the user is confiding in you)
  • any request for operator action

changing channel access permissions