Skip to content

Instantly share code, notes, and snippets.

@pushcx
pushcx / mariadb.structure.sql
Last active February 12, 2026 17:47
structure.sql for dzwdz
/*M!999999\- enable the sandbox mode */
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
@pushcx
pushcx / mostcomments.sql
Created September 5, 2024 19:30
most comments
MariaDB [lobsters]> SELECT short_id, title, comments_count FROM stories ORDER BY comments_count DESC LIMIT 100;
+----------+-----------------------------------------------------------------------------------------------------------------+----------------+
| short_id | title | comments_count |
+----------+-----------------------------------------------------------------------------------------------------------------+----------------+
| h9xgpv | Rate my Homepage | 496 |
| uihyvs | backdoor in upstream xz/liblzma leading to ssh server compromise | 306 |
| zp4ofg | Lobster burntsushi has left the site, algorithm detecting standing might be off | 280 |
| 8aiw6g | What software do you dream about, b
@pushcx
pushcx / 1.txt
Last active May 17, 2023 17:38
2023-05-17 lobsters domain query
domain
undeadly.org
paulrouget.com
techblog.netflix.com
queue.acm.org
blog.golang.org
commandcenter.blogspot.com
lkml.org
idealab.talkingpointsmemo.com
aws.amazon.com
@zeux
zeux / clang27.md
Last active January 27, 2024 11:45
How does clang 2.7 hold up in 2021?

A friend recently learned about Proebsting's law and mentioned it to me off hand. I knew about the law's existence but I never really asked myself - do I believe in it?

For people who aren't aware, Proebsting's law states:

Compiler Advances Double Computing Power Every 18 Years

Which is to say, if you upgrade your compiler every 18 years, you would expect on average your code to double in performance on the same hardware.

Let's C about this

@katef
katef / plot.awk
Last active January 28, 2026 10:56
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@jarmitage
jarmitage / avril.tidal
Created April 14, 2020 20:37
Avril 14th
-- happy avril 14th :)))))))))))))))))))))))))))))))))))))))
do
let bars = 4
key = "8"
righthand = "[[4 -3] [0 _ _ _ _ _ 0]] [[-3, -8] [7 5 4 0]]"
lefthand = "[0 9 12 16] [4 12 16 19] [5 12 17 19] [2 12 17 16]"
d1 $ slow bars
$ stack [
n (righthand + key + "<24 36>/2"),
@Treeki
Treeki / TurnipPrices.cpp
Last active February 6, 2026 05:30
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@rohan-molloy
rohan-molloy / 01-Network-Isolation-of-Services-with-Systemd.md
Last active December 21, 2025 17:25
This tutorial will look at how network namespaces can be defined in systemd service unit definitions

Network Isolation of Services with Systemd

Network namespaces are an important component of containerization in Linux. A network namespace (netns) allows a running process to see different network interfaces, routes, and firewall rules from the rest of the system. There are a number of use cases for network namespaces, such as running multiple servers, testing/staging environments and providing isolation of services.

Creating a Network Namepsace

We begin by creating a generic systemd service for creating a named network namespace. I add the following to /usr/lib/systemd/system/netns@.service. In systemd, the @ mean the service takes a parameter which is passed to the unit via %i. E.g, we can run sudo systemctl start netns@webserver.service.

@lgg
lgg / keepass-file-format-explained.md
Last active January 15, 2026 17:57
Keepass file format explained

Keepass file format explained

I’m currently working (I’m just at the beginning, and I’m quite slow) on a personal project that will use Keepass files (kdb and kdbx).
I tried to find some documentation about .kdb and .kdbx format, but I didn’t find anything, even in the Keepass official website. I you want to know how these file formats are structured, you must read Keepass’s source code. So I wrote this article that explains how Keepass file format are structured, maybe it will help someone.

@rplacd
rplacd / tumblr-downloader.js
Created July 4, 2016 20:45
Dump media from a Tumblr blog - a Node.js script
"use strict";
/*
tumblr-downloader.js - a Node.js script to download all media files posted in
a Tumblr blog, most recent first.
Usage:
node tumblr-downloader.js
Options - domain to download from, API key, and so on - are exposed below.