Damus

Recent Notes

Zergling_man - fedicon 2026 @ C109 · 3d
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpq9telf2frlhmfentvcjkhmgvtzgnjhpah253w4ecd5v9rkaxn0y3qhwwhl5 Can't you just do that with a capturing regex...?
niin sanottu :maya-kurainmaster-yay: :tkw: profile picture
hello
#!/bin/rc

token = `{cat /usr/glenda/lib/shftoken}

ifs = ()

if (~ $1 -f)
{
shift
peatfile = `{cat $1}
shift
}

if (echo $#* 1 eq '=' | gs | grep false > /dev/null)
{
echo 'usage: $0 [-f file] ''message'''
exit
}

message = $1

peatinquestion = $message^$peatfile

echo trying to peat the peat with characteristics
echo $peatinquestion | wc
echo and head
echo $peatinquestion | sed 10q

echo
echo in 5
sleep 1
echo 4
sleep 1
echo 3
sleep 1
echo 2
sleep 1
echo 1
sleep 1

hpost -u https://bloat.freesoftwareextremist.com/nav -m /post is_nsfw:false content:$peatinquestion csrf_token:$token referrer:/nav > /dev/null

echo 0
niin sanottu :maya-kurainmaster-yay: :tkw: profile picture
#include <u.h>
#include <libc.h>
#include <bio.h>

char *choice[65536];

void
main (int argc, char *argv[])
{
int i, k, n, m;
char *p, *file;
Biobuf *f;

k = 1;
file = "/fd/0";

ARGBEGIN{
case 'k':
k = atoi (EARGF (sysfatal ("Misfortune!")));
if (k <= 0) sysfatal ("reservoir size cannot < 1, you stupid fucking nigger");
break;
default:
print ("lol, lmao\n");
goto End;
}ARGEND;

if (argc > 0) file = argv[0];
if ((f = Bopen (file, OREAD)) == nil) sysfatal ("can't open %s: %r", file);

srand (truerand ());

n = 0;

while ((p = Brdline (f, '\n')) != nil)
{
p[Blinelen (f)-1] = 0;

if (n < k) choice[n] = strdup (p); else
{
i = nrand (n + 1);

if (i < k)
{
free ((void*)choice[i]);
choice[i] = strdup (p);
}
}

n ++;
}

if (n == 0) sysfatal ("no fortunes found");

m = n < k ? n : k;
for (i = 0; i < m; i ++) print ("%s\n", choice[i]);

End: exits (0);
}