Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
textmode
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
1.
▲
by
textmode
2y ago
correction: sed -n '/pattern/=' file|yy092|sed -nf/dev/stdin file
2.
▲
yy092: busybox omits csplit
1 points
by
textmode
2y ago
|
1 comments
3.
▲
by
textmode
3y ago
Correction: /* remove HTTP headers from multiple gzip or single zip from stdin */ int fileno (FILE *); int setenv (const char *, const char *, int); #define jmp (yy_start) = 1 + 2 * int x; %opt
4.
▲
by
textmode
3y ago
Usage example: Download NetBSD 1.0 in a single TCP connection. y="GET /pub/NetBSD-archive/NetBSD-1.0/source/src10/" z="Host: archive.netbsd.org" sed '$!s>.*>'&q
5.
▲
Remove HTTP headers from gzip or zip on stdin yy054 (revised)
3 points
by
textmode
3y ago
|
2 comments
6.
▲
by
textmode
3y ago
Normally I use yy030 but I have been experimenting with this instead. Seems to be slightly faster and smaller than similar programs from html-xml-utils. https://www.w3.org/Tools/HTML-XML-utils/man1/ Compile:
7.
▲
Extract URLs Relative and/or Absolute yy044
1 points
by
textmode
3y ago
|
1 comments
8.
▲
Gzip and Zip File Extraction from stdin
2 points
by
textmode
4y ago
|
0 comments
9.
▲
by
textmode
4y ago
/* chunked transfer decoding */ #define echo do{if(fwrite(yytext,(size_t)yyleng,1,yyout)){}}while(0) #define jmp (yy_start) = 1 + 2 * int fileno (FILE *); int ischunked,chunksize,count; xa "\15&qu
10.
▲
Chunked-transfer decoding from stdin yy045
1 points
by
textmode
4y ago
|
1 comments
11.
▲
Not all grep implementations provide an “-o” option
2 points
by
textmode
5y ago
|
1 comments
12.
▲
by
textmode
5y ago
Below is a short script that downloads and makes a PDF from the image files. No browser required. The script uses a feature of HTTP/1.1 called pipelining; proponents of HTTP/2 and HTTP/3 want people to believe it has problem
13.
▲
HTTP/1.1 pipelining example: retrieving 100s of small files
2 points
by
textmode
5y ago
|
0 comments
14.
▲
JPEG File Extraction from stdin
1 points
by
textmode
5y ago
|
0 comments
15.
▲
by
textmode
5y ago
https://news.ycombinator.com/item?id=27490265 <-- yy054 The "gibberish" is GZIP compressed data. "yy054" is a simple filter I wrote to extract a GZIP file from stdin, i.e., discard leading and traili
16.
▲
Gzip File Extraction from stdin
3 points
by
textmode
5y ago
|
1 comments
17.
▲
by
textmode
5y ago
Need to get rid of the leading spaces on all lines except the "int fileno" line. Can also forgo the "here doc" and just save the lines between "flex" and "eof" to a file. Run flex on that file. Th
18.
▲
by
textmode
5y ago
The extra "a" is a typo but would have no effect. The "i" is also superfluous but harmless. Without more details on the "gibberish" it is difficult to guess what happened. The space before "int fileno (
19.
▲
by
textmode
5y ago
I make most HTTP requests using netcat or similar tcp clients so I write filters that read from stdin. Reading text files with the chunk sizes in hex interspersed is generally easy. Sometimes I do not even bother to remove the chunk sizes
20.
▲
by
textmode
5y ago
Corrections: /int main/{s/input();//;s/return 0/exit(0)/;};/int yywrap/s/return 0/exit(0)/;/%option/s/$/ noinput/
21.
▲
by
textmode
5y ago
static void flush(void) { if (writeall(1, buf, buflen) == -1) _exit(errno);
22.
▲
by
textmode
5y ago
#include <unistd.h> #include <errno.h> #include <sys/types.h> int writeall(int fd,const void *xv,long long xlen) { const unsigned char *x = xv; long long w; while (xlen > 0)
23.
▲
by
textmode
5y ago
writeall() comes from http://nacl.cace-project.eu and there it is used in a networking program. I removed poll() but only see a very small speed increase so far. fsync() can be removed too but I'm not seeing any resulting
24.
▲
Binary to hex faster than xxd, part 2 of 2
3 points
by
textmode
5y ago
|
1 comments
25.
▲
Binary to hex faster than xxd, part 1 of 2
3 points
by
textmode
5y ago
|
3 comments
26.
▲
Making HTTP clients for use with netcat-like programs, part 2 of 2
2 points
by
textmode
5y ago
|
1 comments
27.
▲
Making HTTP clients for use with netcat-like programs, part 1 of 2
2 points
by
textmode
5y ago
|
0 comments
28.
▲
Chunked-transfer decoding from stdin yy045
1 points
by
textmode
5y ago
|
0 comments
29.
▲
Convert hex to binary faster than xxd part 2/2
1 points
by
textmode
5y ago
|
0 comments
30.
▲
Convert hex to binary faster than xxd - part 1/2
2 points
by
textmode
5y ago
|
0 comments
More ›