Viewing profile — textmode
textmode
HN member- Joined
- Wed, Jun 15, 2016, 1:59 PM UTC
- HN karma
- 234
- Public activity
- 319 items
- HN profile
- View on Hacker News ↗
About textmode
int main(){
char *b[16];
b[0]="curvecpclient";
b[1]="server2"; // server name
b[2]="174b288f3edb7e930040d9f0dd417577b210eb4ef6b9103e6a197210df27bc33";
b[3]="127.0.0.1"; // server address
b[4]="80";
b[5]="90ce4d782b0211e8811d77379f4da525"; // server extension
b[6]="/usr/bin/curvecpmessage";
b[7]="-c";
b[7]="/usr/bin/tcpclient";
b[8]="-RHDl0";
b[9]="127.0.0.1";
b[10]="80";
b[11]="/usr/bin/http-get";
b[12]="http://127.0.0.1/1.htm";
b[13]="1.htm";
b[14]="1.tmp";
b[15]=(void *)0;
execve("/usr/bin/curvecpclient",b,(void *)0);
}Recent public activity
-
comment
Comment #40808020
correction: sed -n '/pattern/=' file|yy092|sed -nf/dev/stdin file
- comment
-
story
yy092: busybox omits csplit
NB. Try using busybox awk instead of yy092 usage: sed -n '/pattern/='|yy092|sed -nf/dev/stdin file /* context split using sed */ int fileno (FILE *); int x,y,z; %option nounput noi…
-
comment
Comment #38798997
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 …
-
comment
Comment #38777921
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>.*>'"$y"'& HTTP/1.1[]'"$z"…
-
story
Remove HTTP headers from gzip or zip on stdin yy054 (revised)
. /* 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 show…
-
comment
Comment #38727891
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/HT…
-
story
Extract URLs Relative and/or Absolute yy044
/* experimental usage: [host=example.com] yy044 [ar] */ int fileno (FILE *); int x,y,absolute,relative,omit,proto; int setenv (const char *, const char *, int); int fprintf(FILE *_…
-
story
Gzip and Zip File Extraction from stdin
/* remove HTTP headers from multiple gzip or single zip from stdin */ int fileno(FILE *); #define jmp (yy_start) = 1 + 2 * #define echo do{if(fwrite(yytext,(size_t)yyleng,1,yyout))…
-
comment
Comment #33054610
/* 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,c…
- story
- story
- story
-
story
Not all grep implementations provide an “-o” option
For example, Plan9 grep. Solution: #!/bin/sh # usage: $0 pattern
-
comment
Comment #27769832
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 …
-
story
HTTP/1.1 pipelining example: retrieving 100s of small files
A simple demonstration of HTTP/1.1 pipelining with netcat. Retrieving 100s of small JPEG files with a single TCP connection. Here, 2 TCP connections for 141 files. Splitting the ou…
-
story
JPEG File Extraction from stdin
cat > 056.l /* JPEG file carver */ #define echo ECHO #define jmp BEGIN int fileno(FILE *); xa "\xFF\xD8" xb "\xFF\xD9" %s xa %option noyywrap nounput noinput %% {xa} echo;jmp xa; {…
-
comment
Comment #27490395
https://news.ycombinator.com/item?id=27490265 The "gibberish" is GZIP compressed data. "yy054" is a simple filter I wrote to extract a GZIP file from stdin, i.e., discard leading a…
-
story
Gzip File Extraction from stdin
Note only extracts the first GZIP file. How to decompress multiple, consecutive GZIP files on stdin from the network (HTTP/1.1 pipelining) cat > 054.l; int fileno(FILE *); #define …
- story
-
comment
Comment #27483448
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 …
-
comment
Comment #27449208
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 spac…
-
comment
Comment #27433595
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…
-
comment
Comment #27338117
Corrections: /int main/{s/input();//;s/return 0/exit(0)/;};/int yywrap/s/return 0/exit(0)/;/%option/s/$/ noinput/
-
comment
Comment #27237910
static void flush(void) { if (writeall(1, buf, buflen) == -1) _exit(errno); buflen = 0; } static void wrch(const char ch) { if (buflen >= sizeof buf) flush(); buf[buflen++] = ch; r…