Skip to content

Instantly share code, notes, and snippets.

View Luxian's full-sized avatar
🐢
superhero with no power or motivation

Lucian NEAG Luxian

🐢
superhero with no power or motivation
View GitHub Profile
@krakjoe
krakjoe / crawler.php
Last active January 5, 2025 06:28
parallel Futures, Channels (buffered, unbuffered, synchros), Events using parallel producer/consumer pattern
<?php
use \parallel\{Runtime, Future, Channel, Events};
/* usage php crawler.php [http://example.com] [workers=8] [limit=500] */
$page = $argv[1] ?: "https://blog.krakjoe.ninja"; # start crawling this page
$workers = $argv[2] ?: 8; # start this number of threads
$limit = $argv[3] ?: 500; # stop at this number of unique pages
$timeout = $argv[4] ?: 3; # socket timeout for producers
@magnusbae
magnusbae / Install nano in msysgit.md
Last active August 24, 2018 17:20
Install script and manual instructions for nano + msysgit

#How to install the 'nano' text editor in msysgit

Adapted from https://vijayparsi.wordpress.com/2012/03/07/nano-with-mingw32-for-msysgit/


#Fast and simple install Run msysgit as administrator and copy and paste (insert-key) the following line, press enter. It will execute the install_nano.sh script found at the bottom of this file. If you prefer to install nano manually, the process is described below.

@sivel
sivel / better-ssh-authorized-keys-management.md
Last active October 22, 2025 19:48
Better SSH Authorized Keys Management

Better SSH Authorized Keys Management

A seemingly common problem that people encounter is how to handle all of your users authorized_keys file.

People struggle over management, ensuring that users only have specific keys in the authorized_keys file or even a method for expiring keys. A centralized key management system could help provide all of this functionality with a little scripting.

One piece of functionality overlooked in OpenSSH is the AuthorizedKeysCommand configuration keyword. This configuration allows you to specify a command that will run during login to retrieve a users public key file from a remote source and perform validation just as if the authorized_keys file was local.

Here is an example directory structure for a set of users with SSH public keys that can be shared out via a web server:

var loadingMessages: [
'Caffeinating our Development team!',
'Locating the required gigapixels to render...',
'Shovelling coal into the server...',
'Please wait... the architects are still drafting!',
'Warming up Large Hadron Collider...',
'Yes there really are magic elves with an abacus working frantically in here.',
'Elf down! We are cloning the elf that was supposed to get you the data. Please wait.',
'1,000,000 bottles of beer on the wall...',
'Have you lost weight?',

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: