Copy Link
Add to Bookmark
Report

BFi numero 08 anno 3 file 27 di 28

eZine's profile picture
Published in 
Butchered From Inside
 · 22 Aug 2019

  

==============================================================================
------------[ BFi numero 8, anno 3 - 30/04/2000 - file 27 di 28 ]-------------
==============================================================================


-[ MiSCELLANE0US ]------------------------------------------------------------
---[ C0FFEE-WARE
-----[ pIGpEN <pigpen@s0ftpj.org> <deadhead@sikurezza.org>


> Cos'e' il COFFEE-WARE ?

Il COFFE-WARE e' una derivazione del BEER-WARE di Poul-Henning Kamp celebre
sviluppatore di FreeBSD...

> A cosa serve ?

Principalmente e' una protesta contro la Natura stessa che ci ha dato una
piantina cosi' nociva per il pancreas ed il fegato, ma nello stesso tempo
cosi' indispensabile a stimolare e ad aggiornare la tabella di routing del
nostro sistema nervoso...

> Si ti capisco ...

E allora partecipa pure tu al COFFEE-WARE utilizzando questo header nei
tuoi sorgenti...

<-| coffee.c |->
/*
* Name: Coffee Beta 1
* Date: Mon Jan 31 19:05:04 2000
* Author: pIGpEN [pigpen@s0ftpj.org, deadhead@sikurezza.org]
*
* SoftProject Digital Security for Y2K (www.s0ftpj.org)
* Sikurezza.org Italian Security MailingList (www.sikurezza.org)
*
* COFFEE-WARE LICENSE - This source code is like "THE BEER-WARE LICENSE" by
* Poul-Henning Kamp <phk@FreeBSD.ORG> but you can give me in return a coffee.
*
* Tested on: FreeBSD 4.0-19990705-CURRENT FreeBSD 4.0-19990705-CURRENT #6 i386
*/



#include <stdio.h>
#include <sys/utsname.h>
#include <sys/time.h>

#define YES_SYSTEM

#define COFFEE_WARE \
"COFFEE-WARE LICENSE - This source code is like \"THE BEER-WARE LICENSE\" by\n * Poul-Henning Kamp <phk@FreeBSD.ORG> but you can give me in return a coffee."


#define AUTHOR \
"Dino Sauro [dinosauro@caffeinomane.it]"

#define SPOT \
"Dino Sauro Protezione Animali Antichi Srl"

#define SPOT_1 \
"Associazione Recupero Organi"

#define BUFFER 500


int main(int count, char **arg)
{
FILE *origin, *dest;
char date[60], name[60];
#ifdef YES_SYSTEM
struct utsname mysys;
#endif
time_t now = time(NULL);
char buffer[BUFFER];
int i;


if(count!=3) {
printf("COFFEE-WARE (c) pIGpEN\n\n");
printf("Usage: %s <source> <dest>\n", arg[0]);
exit(0);
}

if( !(origin = fopen(arg[1], "r")) ) {
printf("Source File Not Found\n");
exit(-1);
}

if( !(dest = fopen(arg[2], "w")) ) {
printf("Destination file not Found\n");
exit(-1);
}

strftime(date, 60, "%a %h %d %H:%M:%S %G", localtime(&now));

printf("Name: ");

for(i=0; i<60; i++) {
name[i] = (unsigned char) getchar();
if(name[i] == '\n') break;
}

name[i] = '\0';

fprintf(dest,"/*\n");
fprintf(dest," * Name: %s\n", name);
fprintf(dest," * Date: %s\n", date);
fprintf(dest," * Author: %s\n", AUTHOR);
fprintf(dest," *\n");
fprintf(dest," * %s\n", SPOT);
fprintf(dest," * %s\n", SPOT_1);
fprintf(dest," *\n");
fprintf(dest," * %s\n", COFFEE_WARE);
fprintf(dest," *\n");
#ifdef YES_SYSTEM
uname(&mysys);
fprintf(dest," * Tested on: %s %s %s %s\n", mysys.sysname,
mysys.release,
mysys.version,
mysys.machine);
#endif
fprintf(dest," */\n\n\n");

while(fgets(buffer, sizeof(buffer), origin)) {
fputs(buffer, dest);
}

fclose(origin); fclose(dest);

return (0);
}
<-X->

> Come si usa ?

Devi modificare AUTHOR, SPOT, SPOT_1 con i tuoi dati...
Fatto cio' la sintassi e' semplice...

Es:

coffee utmp.c utmpedit.c
Name: An utmp editor

E automaticamente ti genera l'header con i dati della tua macchina e
l'ora corrente ...

> E cosa capisco dalla vita ?

Principalmente capisci che ci sono altri che soffrono della tua stessa
dipendenza... avrai diritto ad una tazza di caffe' se chi usa il sorgente
vorra' pagartela...

bye

pIGpEN


==============================================================================
--------------------------------[ EOF 27/28 ]---------------------------------
==============================================================================

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT