Outils pour utilisateurs

Outils du site


blog

Curl cookies trac

Voir aussi :

Enregistrer le cookie

curl -k --show-error --verbose -c cookies.txt https://trac.acme.fr/login --anyauth --user USER:PASSWD
curl -k --show-error --verbose -b cookies.txt https://trac.acme.fr/query | html2text | grep ^#

cookies.txt

# Netscape HTTP Cookie File
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

#HttpOnly_trac.acme.fr	FALSE	/	FALSE	0	trac_auth	ab2cf34d1b293f508218fdea4d5d2abe

Sur le serveur

sqlite3 trac/projet1/db/trac.db
.header ON
SELECT * FROM auth_cookie ORDER BY TIME DESC LIMIT 1;
cookie|name|ipnr|time
ab2cf34d1b293f508218fdea4d5d2abe|jibe|127.0.0.1|1444221567
DELETE FROM auth_cookie WHERE cookie='ab2cf34d1b293f508218fdea4d5d2abe';
curl -k -b cookies.txt https://trac.acme.fr/query 2>/dev/null | html2text | grep '^#' | awk '{print "\t<td>"$1"</td>\t<td>"$2"</td>"}' | sed -e 's/^/<tr>/' -e 's/$/<\/tr>/' -e '1i\<table>' | sed -e '$a</table>' | xmllint --format - | sed '1d' | sed -e 's%#\([0-9][0-9]*\)%<a href="https://trac.acme.fr/ticket/\1">\1</a>%'

Notes cookies

curl -I -c cookies.txt http://notre-dame-des-rencontres.com
 
curl -b cookies.txt 'http://www.notre-dame-des-rencontres.com/testcookie.php?passwd=Passw0rd&user=Pseudo&css=' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3' --compressed -H 'Referer: http://www.notre-dame-des-rencontres.com/?out=1' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Sec-GPC: 1'
 
curl -b cookies.txt 'http://www.notre-dame-des-rencontres.com/site/securit.php?fgp=1ab3e259a81f5d20d98289aa9ab2764e&cook=1&passwd=Passw0rd&user=Pseudo' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3' --compressed -H 'Referer: http://www.notre-dame-des-rencontres.com/?out=1' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Sec-GPC: 1'
 
curl -b cookies.txt 'http://www.notre-dame-des-rencontres.com/site/delogger.php' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3' --compressed -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Referer: http://www.notre-dame-des-rencontres.com/?fgp=c3584c3ecbfccd0cc2b2d92a392d3b16' -H 'Upgrade-Insecure-Requests: 1' -H 'Sec-GPC: 1'
2025/03/24 15:06

Crypto - Découper ses clefs en plusieurs morceaux grâce au secret reparti

m of n

Découper une clef de chiffrement en plusieurs morceaux

Voir aussi:

Install

apt-get install libgfshare-bin

Découpage (split)

gfsplit -n 3 -m 5 plop.key

Découpe le ficher plop.key en 5 morcaux. Seulement 3 morcaux suffit pour recomposer la clef en entier

Réassemblage (combine)

gfcombine plop.key.186 plop.key.184 plop.key.007 -o plop.key
2025/03/24 15:06

Créer un patch - diff

Voir aussi :

  • JSON RFC 6902 patch

Source: https://docs.moodle.org/dev/How_to_create_a_patch

diff -Naur standard_moodle my_moodle > patch.txt

Avec git

The easiest way to create a patch for the last commit is

Créer un patch pour le dernier commit

git show > patch.txt

If you want to create a patch between 2 specific commits you can use git diff

git diff commitid1 commitid2 > patch.txt

Il existe aussi git format-patch pour pouvoir facilement envoyer un patch par mail

git format-patch -n
#git format-patch -1 <sha1> --stdout > <name>.patch

Autre

Défaire / inverser un patch (Undo patch)

interdiff -q file.patch /dev/null > reversed.patch
2025/03/24 15:06

Création d'un dépôt RedHat RPM pour Yum

Voir :

  • createrepo_c

Voir aussi pour Debian :

Conf dépots

yum install createrepo repoview
mkdir -p /var/www/repo
#mkdir -p /var/www/repo/SRPMS
cp *.rpm /var/www/repo/
createrepo /var/www/repo/el7
repoview /var/www/repo/el7
chown -R apache:apache /var/www/repo

Conf Apache

/etc/httpd/conf.d/repo.conf

<VirtualHost *:81>
        DocumentRoot /var/www/repo/el7/
 
<Directory /var/www/repo/el7/>
        Options +Indexes
</Directory>
 
<Location />
        Allow from all
</Location>
 
</VirtualHost>

/etc/httpd/conf/httpd.conf

Listen 80
Listen 81
apache -t && systemctl reload httpd

Conf client

/etc/yum.repos.d/mon.repo

[interne]
name=Dépôt interne
enabled=1
gpgcheck=0
baseurl=http://localhost:81/
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Pour tester la conf du client

yum clean all
yum list
2025/03/24 15:06

CPU 32 ou 64 bits

Voir limites :

uname -a
getconf LONG_BIT
grep flags /proc/cpuinfo
grep -o -w 'lm' /proc/cpuinfo | sort -u

OS 32 ou 64 bits ?

arch
echo $HOSTTYPE
 
hostnamectl

FIXME

2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki