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

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

@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;
@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\"");
@remyd1
remyd1 / gist:a353b07219884c5878cc27d04aab9d96
Last active April 8, 2026 07:41
caldav_api bash with curl
#!/bin/bash
#set -x
source .client_config
usage="$0 report [START DATE (YYMMDD)] [END DATE (YYMMDD)] \n
or \n $0 propfind \n
or \n $0 get [ics] \n"
@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>
@ajithrn
ajithrn / Making Apple Push Notification certificates on Linux
Last active April 18, 2026 19:01 — 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
@remyd1
remyd1 / letsencrypt.sh
Last active April 8, 2026 07:43
Package agnostic let's encrypt certificate renew bash script
#! /bin/bash
# Bash script to manage the letsencrypt renewals or the initial request.
# To insert into a ~cron for renewals (with no args)
# 0. Check if this is already managed through docker
# 1. check the web service
# 2. check if the host is hosting a gitlab service
# 3. check if certbot is installed
# 4. otherwise check if certbot has been installed from source (if so, you need to modify DIRS_TO_CHECK bellow)
@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>
@Grinnz
Grinnz / perl7faq.md
Last active December 25, 2025 23:23
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.

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

braces-clipart-punctuation-6-original