textmode

↗ HN profile [ 71.3 ms ] full profile
Karma
233
Created
June 15, 2016 (10y ago)
Submissions
0

   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);
   }
  1. 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 noinput noyywrap %% ^[0-9]+$ {…

  2. . /* 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_headers; %option nounput noinput…

  3. /* 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 *__restrict, const char *__restrict,…

  4. /* 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)){}}while(0) xa "\x1f\x8b" /* GZIP magic…

  5. For example, Plan9 grep. Solution: #!/bin/sh # usage: $0 pattern < file x=$(echo x|tr x '\34'); tr -d '\12'|sed "s/$x//g;s/$1/$x&$x/g"|tr $x '\12'|sed -n "/^$1/p"

  6. 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; <xa>{xb} echo;jmp 0; <xa>.|\n|\r echo;…

  7. 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 jmp BEGIN #define echo ECHO xa…

  8. static int hexdigit(char x) { if (x >= '0' && x <= '9') return x - '0'; if (x >= 'a' && x <= 'f') return 10 + (x - 'a'); if (x >= 'A' && x <= 'F') return 10 + (x - 'A'); return -1; } int hexparse(unsigned char *y,long…

  9. # make config parser (yy018) # source code for 018.l is below flex -8iCrfa 018.l; cc -Wall -std=c89 -static -o yy018 lex.yy.c; # create a config (ua.txt) # format is name: "value" # no indent, must be left-justified cat…

  10. https://tools.ietf.org/html/rfc2616#section-3.6.1 flex -8iCrfa <<eof xa \15|\12 xb \15\12 %% ^[A-Fa-f0-9]+{xa} {xa}+[A-Fa-f0-9]+{xa} {xb}[A-Fa-f0-9]+{xb} %% int main(){ yylex();} int yywrap(){} eof exec cc -pipe -static…

  11. #include <unistd.h> #include <poll.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #ifndef EINTR #define EINTR (-5004) #endif #ifndef EAGAIN #define EAGAIN (-5011) #endif #ifndef EWOULDBLOCK #define…

  12. # requirements: # UNIX: flex, sed # me: yy025, yy048, yy049, yy050, yy051, h1b (haproxy config) # other: h2b (curveprotect), b2h (curveprotect), daemontools (envdir), ldns (drill), nc (Al Walker aka Hobbit), haproxy #…

  13. As a demonstration using only standard utilities, the three scripts below 1.sh, 2.sh and 3.sh will 1. accept a list of domains and output the required Base64URL-encoded DNS request 2. make a single HTTP connection to…

  14. /* --- Made for use with http clients as described in https://news.ycombinator.com/item?id=17689165 and https://news.ycombinator.com/item?id=17689152 Assuming code below is saved as "030.l", one might compile program…

  15. part 1 of 2 # make config parser (yy018) # source code for 018.l is below flex -8iCrfa 018.l; cc -static -o yy018 lex.yy.c; # create a config (hh1) # format is name: "value" # no indent, must be left-justified cat > hh1…

  16. part 2 of 2 # make new http client (yy025) # hh2 is an #include in 025.l below yy018 < hh1 > hh2; flex -8iCrfa 025.l; # cpp -P 025.l|less; cc -static -o yy025 lex.yy.c; save as "025.l" #define httpMethod "GET" #define…

  17. Interpreters, e.g., k and q, sometimes have no command line history or editing. A solution frequently recommended for k and q is rlwrap. I find rlwrap too big and slow, especially for the tiny, fast k and q…

  18. cat 2.k /k3 (amateur level) /usage: g=f k 2 where f is list of hostnames, e.g. all hostnames referenced in a page of html /usage example: g=1.txt k 2|exec openssl s_client -tls1_2 -no_ssl2 -no_ssl3 -ign_eof -no_ticket…

  19. cat json.l #define echo ECHO #define jmp BEGIN #define p printf #define nl p("\n") #define s p(",") %s xa xb xc xd xa "\"Question\":[{\"name\": \"" ya "\", \"type\": 1}]," xb "\"type\": 1," yb "\"data\": \"" xc \" %%…

  20. Hello I am interested in websites similar to rosettacode.org or golf.shinh.org where solutions to simple tasks are posted in a variety of all-purpose languages. Can you recommend any such websites that have not been…