Skip to content

Instantly share code, notes, and snippets.

Implementation of the curl_multi_socket API
The main ideas of the new API are simply:
1 - The application can use whatever event system it likes as it gets info
from libcurl about what file descriptors libcurl waits for what action
on. (The previous API returns fd_sets which is very select()-centric).
2 - When the application discovers action on a single socket, it calls
libcurl and informs that there was action on this particular socket and
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
@rlerdorf
rlerdorf / kc
Created December 21, 2020 16:47
#!/usr/bin/env php
<?php
function rgb($hex) {
$r = substr($hex,0,2);
$g = substr($hex,2,2);
$b = substr($hex,4,2);
return [hexdec($r), hexdec($g), hexdec($b)];
}
function preview($str, $cols) {
inc 2.00 2.00 2.00
cars 2.00 2.00 2.00
auto 2.00 2.00 2.00
car 2.00 2.00 2.00
loan 2.68 2.68 2.68
download 2.68 2.68 2.68
date 2.68 2.68 2.68
party 2.68 2.68 2.68
stream 2.68 2.68 2.68
win 2.68 2.68 2.68
inc 2.00 2.00 2.00
car 2.00 2.00 2.00
cars 2.00 2.00 2.00
auto 2.00 2.00 2.00
loan 2.68 2.68 2.68
download 2.68 2.68 2.68
men 2.68 2.68 2.68
date 2.68 2.68 2.68
party 2.68 2.68 2.68
win 2.68 2.68 2.68
xyz 0.79 9.18 9.18
monster 0.98 9.95 9.95
buzz 0.98 27.24 27.24
radio.am 1.41 12.85 12.85
radio.fm 1.41 12.85 12.85
icu 1.58 5.98 5.98
top 1.68 4.28 4.28
best 1.72 16.95 16.78
club 1.74 9.78 9.78
fun 1.97 16.95 16.48
The setup I use to manage machines remotely is all based on each machine
maintaining an ssh connection to a central server sitting in a colo in
San Jose. If you only want to manage machines that don't move around and
are behind a router you control, it probably makes more sense to set up
port forwarding on your router. Forward ports 22 (ssh), 5900 (vnc) and
3282 (ARD).
I use the proxy approach because I also manage laptops that may be
connected from anywhere. Like in a coffeeshop behind NAT where I have
no way to port forward from the router.
@rlerdorf
rlerdorf / c
Created February 17, 2020 15:58
processor : 0
vendor_id : AuthenticAMD
cpu family : 23
model : 113
model name : AMD Ryzen 9 3950X 16-Core Processor
stepping : 0
microcode : 0x8701013
cpu MHz : 2199.325
cache size : 512 KB
physical id : 0
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 43 bits physical, 48 bits virtual
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 2
Core(s) per socket: 16
Socket(s): 1
NUMA node(s): 1