Vertaa committeja

..

2 Commitit

Tekijä SHA1 Viesti Päivämäärä
tth
a6ff3f5086 un petit push, parfois 2022-01-29 22:46:41 +01:00
tth
6cbac48848 + portaudio 2022-01-24 21:24:11 +01:00
12 muutettua tiedostoa jossa 196 lisäystä ja 44 poistoa

Näytä tiedosto

@ -472,6 +472,36 @@ Libérer deux fois la mémoire.
% ========================================================= % =========================================================
\section{Debug} \index{Debug}
Des outils et astuces en page \pageref{chap:Debug}.
\begin{quote}
splint is an annotation-assisted lightweight static checker.
It is a tool for
statically checking C programs for security vulnerabilities and coding
mistakes.
If additional effort is invested in adding annotations to programs,
splint can perform stronger checking.
\end{quote}
% =========================================================
\section{Legalize}
"The two forms of conforming implementation are hosted and freestanding.
A conforming hosted implementation shall accept any strictly conforming
program. A conforming freestanding implementation shall accept any
strictly conforming program in which the use of the features specified
in the library clause (Clause 7) is confined to the contents of the
standard headers <float.h> , <iso646.h> , <limits.h> , <stdalign.h> ,
<stdarg.h> , <stdbool.h> , <stddef.h> , <stdint.h> , and <stdnoreturn.h>
. Additionally, a conforming freestanding implementation shall accept
any strictly conforming program in which the use of the features
specified in the header <string.h> , except the following functions:
strdup , strndup , strcoll , strxfrm , strerror ." (4p6)
% =========================================================
\section{Ailleurs dans cet ouvrage} \section{Ailleurs dans cet ouvrage}
Il y a plein d'autres exemples de code en C, sur des sujets Il y a plein d'autres exemples de code en C, sur des sujets

Näytä tiedosto

@ -70,6 +70,8 @@ tth@tranxene:~$
\subsection{dig} \subsection{dig}
\index{dig} \index{dig}
% https://jvns.ca/blog/2021/12/04/how-to-use-dig/
Dig (\textit{domain information groper}) est un outil d'interrogation Dig (\textit{domain information groper}) est un outil d'interrogation
des serveurs DNS. Par défaut, il questionne les serveurs des serveurs DNS. Par défaut, il questionne les serveurs
listés dans \texttt{/etc/resolv.conf}. listés dans \texttt{/etc/resolv.conf}.
@ -80,6 +82,10 @@ Pour résoudre récursivement un nom de domaine à partir de la racine :
Pour obtenir le reverse d'une adresse IP : Pour obtenir le reverse d'une adresse IP :
\texttt{\$ dig +trace -x <adresse.ip>} \texttt{\$ dig +trace -x <adresse.ip>}
% ------------------------------------------------------------ % ------------------------------------------------------------
% \subsection{delv} % \subsection{delv}
% \index{delv} % \index{delv}

Näytä tiedosto

@ -180,43 +180,7 @@ Il nius faut donc remplacer le getenv de la libc par notre propre
version qui va écouter et exfiltrer l'utilisation de cette version qui va écouter et exfiltrer l'utilisation de cette
fonction. fonction.
\begin{lstlisting}[language=C] \lstinputlisting[language=C]{code/debug/spy_getenv.c}
/*
spy_getenv.so: spy_getenv.c Makefile
gcc -Wall -shared -fPIC $< -ldl -o $@
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define __USE_GNU
#include <dlfcn.h>
typedef char * (*original_getenv)(const char *envname);
char *getenv(char *envname)
{
static char *arrow = "--getenv--> ";
static char *wtf = " --> WTF ?";
char *content;
original_getenv orig_getenv;
orig_getenv = (original_getenv)dlsym(RTLD_NEXT, "getenv");
write(STDERR_FILENO, arrow, strlen(arrow));
write(STDERR_FILENO, envname, strlen(envname));
content = orig_getenv(envname);
if (NULL != content) {
write(STDERR_FILENO, "=", 1);
write(STDERR_FILENO, content, strlen(content));
}
else {
write(STDERR_FILENO, wtf, strlen(wtf));
}
write(STDERR_FILENO, "\n", 1);
return content;
}
\end{lstlisting}
Simple et efficace. Simple et efficace.

Näytä tiedosto

@ -52,6 +52,11 @@ map_henon: map_henon.f
Hélas, je n'ai pas de commande \texttt{g77} dans ma machine, Hélas, je n'ai pas de commande \texttt{g77} dans ma machine,
que faire ? En écrire une ? que faire ? En écrire une ?
% ==============================================================
\section{qemu}
\index{qemu}\label{qemu}
http://sven.stormbind.net/blog/posts/deb\_qemu\_local\_openwrt/
% ============================================================== % ==============================================================

Näytä tiedosto

@ -100,6 +100,27 @@ la commande\texttt{tail} au début du script. Ensuite les deux clauses
coordonnées X et Z, dans le repère POVray, qui n'est pas le même que coordonnées X et Z, dans le repère POVray, qui n'est pas le même que
celui de Gnuplot. celui de Gnuplot.
% ------------------------------------------------
\subsection{image\_map}
% ------------------------------------------------
\subsection{height\_field}
Les champs d'altitude... Toute une histoire...
\begin{verbatim}
#declare Champ_Altitude = object
{
height_field {
png "WS/hf5.png" gamma 1.8
}
pigment { color Cyan }
scale 2
}
\end{verbatim}
% ------------------------------------------------ % ------------------------------------------------
\subsection{Trucs à voir} \subsection{Trucs à voir}

Näytä tiedosto

@ -111,6 +111,12 @@ changer la dimension de l'image. En détail, j'ai pas tout compris.
% ------------------------------------------ % ------------------------------------------
\subsection{Trucs}
convert -average frame*.png output.png
% ------------------------------------------
\subsection{Ressources} \subsection{Ressources}
Le futur livre de Brunus. Réclamez les prmiers drafts dans Le futur livre de Brunus. Réclamez les prmiers drafts dans

Näytä tiedosto

@ -10,4 +10,4 @@ TP Link
Archer C7 Archer C7
\end{verbatim} \end{verbatim}
http://sven.stormbind.net/blog/posts/deb\_qemu\_local\_openwrt/

Näytä tiedosto

@ -2,6 +2,8 @@
\label{S-lang} \label{S-lang}
\index{S-lang} \index{S-lang}
% ----------------------------------------------------------
\section{C'est quoi ?} \section{C'est quoi ?}
S-lang est une bibliothèque de fonctions multi-plateforme S-lang est une bibliothèque de fonctions multi-plateforme
@ -13,6 +15,8 @@ L'exemple le plus éblouissant étant le célèbre
longuement dans les pages consacrées à Usenet\index{Usenet} longuement dans les pages consacrées à Usenet\index{Usenet}
(page \pageref{slrn}). (page \pageref{slrn}).
% ----------------------------------------------------------
\section{slsh} \section{slsh}
\index{slsh} \index{slsh}
@ -40,3 +44,4 @@ tth@plop:~/Essais/Slang$
Cool... Cool...
% ----------------------------------------------------------

Näytä tiedosto

@ -154,13 +154,21 @@ Elle supporte une grande variété de formats.
La configuration se fait par deux fichiers : La configuration se fait par deux fichiers :
\texttt{/etc/libao.conf} surchargeable par \texttt{/etc/libao.conf} surchargeable par
\texttt{\$HOME/.libao.conf}, et scématiquement, nous pouvons \texttt{\$HOME/.libao.conf}, et schématiquement, nous pouvons
voir qu'elle est à deux niveaux. voir qu'elle est à deux niveaux.
https://www.xiph.org/ao/doc/drivers.html https://www.xiph.org/ao/doc/drivers.html
%------------------------------------------------------------------ %------------------------------------------------------------------
\section{Portaudio} \label{Portaudio} \index{Portaudio}
Une suggestion de Wargreen pour avancer un peu dans la construction
de ma DAW\footnote{Digital Audio Workstation, aka machine à sons}
\textsl{custom-made} à mon idée\dots
%------------------------------------------------------------------
\section{Ladspa} \section{Ladspa}
\index{ladspa} \index{ladspa}

62
chap/webserver.tex Normal file
Näytä tiedosto

@ -0,0 +1,62 @@
%
%
%
\chapter{Web servers}
% ==============================================================
\section{Apache} \index{Apache}
Le grand classique.
% ==============================================================
\section{Lighttpd} \index{Lighttpd}
Un outsider ?
\begin{verbatim}
root@ramen:~# lighty-enable-mod userdir
Enabling userdir: ok
Run "service lighttpd force-reload" to enable changes
root@ramen:~# service lighttpd force-reload
root@ramen:~#
\end{verbatim}
% ==============================================================
\section{Custom made}
\begin{verbatim}
tth@ramen:~/Houba/Fractales90$ apt show libmicrohttpd12
Package: libmicrohttpd12
Version: 0.9.72-2
Priority: optional
Section: libs
Source: libmicrohttpd
Maintainer: Daniel Baumann <daniel.baumann@progress-linux.org>
Installed-Size: 211 kB
Depends: libc6 (>= 2.17), libgnutls30 (>= 3.7.0)
Homepage: https://www.gnu.org/software/libmicrohttpd/
Tag: role::shared-lib
Download-Size: 109 kB
APT-Sources: http://deb.debian.org/debian bullseye/main amd64 Packages
Description: library embedding HTTP server functionality
GNU libmicrohttpd is a small C library that is supposed to make it
easy to run an HTTP server as part of another application.
Key features that distinguish GNU Libmicrohttpd from other
projects are:
* C library: fast and small
* API is simple, expressive and fully reentrant
* Implementation is HTTP 1.1 compliant
* HTTP server can listen on multiple ports
* Four different threading models (select, poll, pthread, thread pool)
* Support for IPv6
* Support for SHOUTcast
* Support for incremental processing of POST data (optional)
* Support for basic and digest authentication (optional)
* Support for SSL3 and TLS
\end{verbatim}
% ==============================================================

45
code/debug/spy_getenv.c Normal file
Näytä tiedosto

@ -0,0 +1,45 @@
/*
*
* spy_getenv.so: spy_getenv.c Makefile
* gcc -Wall -shared -fPIC $< -ldl -o $@
*
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define __USE_GNU
#include <dlfcn.h>
typedef char * (*original_getenv)(const char *envname);
char *getenv(char *envname)
{
static char *arrow = "--getenv--> ";
static char *wtf = " --> (nil)";
char *content;
original_getenv orig_getenv;
orig_getenv = (original_getenv)dlsym(RTLD_NEXT, "getenv");
write(STDERR_FILENO, arrow, strlen(arrow));
write(STDERR_FILENO, envname, strlen(envname));
content = orig_getenv(envname);
if (NULL != content) {
write(STDERR_FILENO, "=", 1);
write(STDERR_FILENO, content, strlen(content));
}
else {
write(STDERR_FILENO, wtf, strlen(wtf));
}
write(STDERR_FILENO, "\n", 1);
return content;
}
/* j'adore quand un plan se déroule sans accrc */

Näytä tiedosto

@ -139,7 +139,6 @@ en ligne sur le site du Tetalab. Your mileage may vary\dots
\input{chap/plugins} \input{chap/plugins}
\input{chap/Bonjour} \input{chap/Bonjour}
\input{chap/ioctl} \input{chap/ioctl}
\input{chap/debug} \input{chap/debug}
\input{chap/buzybox} \input{chap/buzybox}
\input{chap/gif89a} \input{chap/gif89a}
@ -148,11 +147,12 @@ en ligne sur le site du Tetalab. Your mileage may vary\dots
\input{chap/Usenet} \input{chap/Usenet}
\input{chap/DNS} \input{chap/DNS}
\input{chap/ssh} \input{chap/ssh}
\input{chap/webserver}
\input{chap/hardware} \input{chap/hardware}
\input{chap/gadgets} \input{chap/gadgets}
\input{chap/sdr} \input{chap/sdr}
% \input{chap/slang} \input{chap/slang}
\input{chap/curses} \input{chap/curses}
\input{chap/openwrt} \input{chap/openwrt}
\input{chap/WiFi} \input{chap/WiFi}