Outils pour utilisateurs

Outils du site


blog

Notes TCP/IP Jumbo Frame Trame géante MTU

Voir :

Peut être utile pour du SAN / NAS :

Connaître la MTU d'une interface

netstat -i
ip link |grep mtu

Changer provisoirement la MTU d'une inferface

#ifconfig eth1 mtu 9000 up
ip link set eth1 mtu 9000

Changer la MTU sur RedHat

/etc/sysconfig/network-scripts/ifcfg-enp0s9

HWADDR=08:00:27:D9:8B:E7
TYPE=Ethernet
BOOTPROTO=none
IPADDR=192.168.25.21
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=enp0s9
UUID=5f82629e-5117-4d41-902d-090d82053cb2
ONBOOT=yes
MTU=9000

Changer la MTU sous RedHat avec NetworkManager

nmcli connection modify eno2 802-3-ethernet.mtu 9000
nmcli connection show eno2 |grep mtu

Changer la MTU d'une interface sur Debian

/etc/network/interfaces.d/eth1

auto eth1

iface eth1 inet static
        address 192.168.56.12
        netmask 255.255.255.0
        mtu 9000

Appliquer les changements

systemctl restart networking

Connaitre la MTU entre deux points

# traceroute --mtu 192.168.56.1

traceroute to 192.168.56.1 (192.168.56.1), 30 hops max, 65000 byte packets
 1  192.168.56.1 (192.168.56.1)  0.223 ms F=1500 *  0.446 ms

F=1500

Tester

1472 = 1500 - 28

Voir aussi /proc/sys/net/ipv4/ip_no_pmtu_disc

# ping -M do -s 1472 192.168.6.130
PING 192.168.6.130 (192.168.6.130) 1472(1500) bytes of data.
1480 bytes from 192.168.6.130: icmp_req=1 ttl=255 time=0.095 ms
1480 bytes from 192.168.6.130: icmp_req=2 ttl=255 time=0.127 ms
^C
--- 192.168.6.130 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.095/0.111/0.127/0.016 ms

# ping -M do -s 1473 192.168.6.130
PING 192.168.6.130 (192.168.6.130) 1473(1501) bytes of data.
^C
--- 192.168.6.130 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms

Path MTUs are recorded in the routing cache. This can interfere with testing, and in particular, can make a remote MTU restriction appear to be a local one. You can clear the cache using the ip route command.

ip route flush cache
2025/03/24 15:06

Cherche rapide de fichier grâce à updatedb et locate

Voir aussi :

  • plocate (a vocation de remplacer le bon vieux mlocate)
Exemple 1
# systemd-run -p IOWeight=10 updatedb
updatedb -l 0 -o db_file -U source_directory
locate -d db_file NOM_FICHIER
Exemple 2
updatedb -l 0 --prunenames ".git .bzr .hg .svn .gz" --prunepaths "${HOME}/tmp ${HOME}/mnt" -U ~ -o ~/mlocate.db
locate -d ~/mlocate.db NOM_FICHIER
locate -d ~/mlocate.db NOM_FICHIER -0 | xargs -0 ls -ld

Note : prunepaths doit contenir des chemin absolus

http://fr.wikipedia.org/wiki/Locate http://www.thegeekstuff.com/2012/03/locate-command-examples/

Examples To create a private mlocate database as an user other than root, run

  updatedb -l 0 -o db_file -U source_directory

Source : http://linux.die.net/man/8/updatedb

2025/03/24 15:06

Notes TCL

tclsh

Equivalent de bash -c

runner.tcl

#!/usr/bin/tclsh
 
eval $argv
tclsh runner.tcl puts hello

FIXME

2025/03/24 15:06

Notes Tahoe-LAFS

https://www.digitalocean.com/community/tutorials/tahoe-lafs

Brouillon. (source http://killyourtv.i2p/tahoe-lafs/running/)

If you're not using a multi-introducer capable Tahoe installation, most are using killyourtv's introducer to connect to the grid so that would be a good choice to use as a primary introducer. Updating your Tahoe-LAFS installation is recommended. If you're using the multi-introducer build, copy and paste the following into ~/.tahoe/introducers:

apt-get install tahoe-lafs
tahoe --version
Warning: dependency 'cryptography' (version '0.6.1') found by pkg_resources not found by import.
Warning: dependency 'six' (version '1.8.0') found by pkg_resources not found by import.
Warning: dependency 'cffi' (version '0.8.6') found by pkg_resources not found by import.
Warning: dependency 'pycparser' (version '2.10') found by pkg_resources not found by import.

For debugging purposes, the PYTHONPATH was
  None
install_requires was
  ['setuptools >= 0.6c6', 'zfec >= 1.1.0', 'simplejson >= 1.4', 'zope.interface == 3.6.0, == 3.6.1, == 3.6.2, >= 3.6.5', 'Twisted >= 11.0.0', 'foolscap >= 0.6.3', 'pyOpenSSL', 'Nevow >= 0.6.0', 'pycrypto == 2.1.0, == 2.3, >= 2.4.1', 'pyasn1 >= 0.0.8a', 'mock >= 0.8.0', 'pycryptopp >= 0.6.0']
sys.path after importing pkg_resources was
  /usr/bin:
  /usr/lib/python2.7:
  /usr/lib/python2.7/plat-x86_64-linux-gnu:
  /usr/lib/python2.7/lib-tk:
  /usr/lib/python2.7/lib-old:
  /usr/lib/python2.7/lib-dynload:
  /usr/local/lib/python2.7/dist-packages:
  /usr/lib/python2.7/dist-packages:
  /usr/lib/pymodules/python2.7

Voilà ce qui se passe quand on install des paquets de Debian Stretch sur Debian Jessie. C'est moche. Vive les virtualenv

Activer les dêpots de Debian Stretch

apt-get install tahoe-lafs python-cryptography python-pyasn1  python-cffi python-ply python-pycparser python-numpy

Autre solution

virtualenv tahoenv
cd tahoenv
source bin/activate
pip install --upgrade allmydata-tahoe
tahoe create-node
Node created in '/home/exploit/.tahoe'
 Please set [client]introducer.furl= in tahoe.cfg!
 The node cannot connect to a grid without it.
 Please set [node]nickname= in tahoe.cfg

Client node

A client node is used to communicate with storage nodes in order to store and retrieve files on the grid. There is a web interface (default on http://127.0.0.1:3456/) and a command line interface (via tahoe) for accessing this data. Other interfaces are available, see the Tahoe-LAFS site for details.

tahoe --version

tahoe create-client

Specify a nickname for your node. This is shown to all nodes in the grid so choose the nickname carefully. Edit the configuration file ~/.tahoe/tahoe.cfg. Modify the following options, the other values should be left at the defaults for now:

[node] nickname = yourclientnodename web.port = tcp:3456:interface=127.0.0.1 http_proxy = 127.0.0.1:4444 tub.location =

~/.tahoe/tahoe.cfg

uncomment tub.location otherwise your (at worse external!) IP will be leaked to introducers: In client section remove None word in introducer.furl,

Uncomment tub.location but leave it empty. This will prevent your other interfaces besides 127.0.0.1 from being broadcast to the introducer. /!\ WARNING: Make sure that you do this to avoid leaking your IP address! /!\

[node] nickname = YourRandomNickname web.port = tcp:3456:interface=127.0.0.1 web.static = public_html http_proxy = 127.0.0.1:4444

  1. IMPORTANT
  2. You NEED to configure tub.location when running
  3. an I2P-enabled Tahoe-LAFS node. Otherwise your IP
  4. can be leaked to the introducers!
  5. Read the docs and/or come to #tahoe-lafs on Irc2P for assistence.
  6. tub.port =

tub.location =

  1. log_gatherer.furl =
  2. timeout.keepalive =
  3. timeout.disconnect =
  4. ssh.port = 8022
  5. ssh.authorized_keys_file = ~/.ssh/authorized_keys

[client]

  1. Which services should this client connect to?

introducer.furl = helper.furl =

  1. key_generator.furl =
  2. stats_gatherer.furl =

Create introducers file (without .txt extension) and paste the list of introducers from http://killyourtv.i2p/tahoe-lafs/introducers/

Upload

tahoe create-alias YOURALIAS

Upload your website into grid using tahoe cp command:

tahoe cp -r -v “C:\pathtoyourdeepsite” YOURALIAS

This is very time consuming process, uploading a single 50MB files could be faster than uploading 150 files of 5MB total, so consider for example converting all small images into base64 and embedding them into html file.

After uploading, check if all files are uploaded:

tahoe ls YOURALIAS

Type

tahoe list-aliases

or open .tahoe\private\aliases file to get your private keys, and go into website: http://127.0.0.1:3456/uri/URI:DIR2:<yourprivatekey>.

Click More info on this directory and copy your public key from Directory readcap, so your website address is: http://127.0.0.1:3456/uri/URI:DIR2-RO:<yourpublickey>/index.htm.

Never share address without URI:DIR2-RO (read only) otherwise others can vandalize/delete your site! Older files will be deleted from the network (grid). To prevent this, run the following command from time to time (once per 2 months):

tahoe deep-check -v --repair --add-lease YOURALIAS

Introducer

Setting up and running your own introducer on I2P involves a few simple steps. 
The first of these steps is to create the introducer node:

$ tahoe create-introducer ~/.tahoe/introducer

The introducer can exist anywhere on your filesystem. If you don't want it to be contained within your ~/.tahoe directory, simply specify a different directory.

Next, edit ~/.tahoe/introducer/tahoe.cfg. Fill out the web.port. In this example we'll use 3460:

[node]
web.port = tcp:3460:interface=127.0.0.1
web.static = public_html

Start your introducer:

$ tahoe start ~/.tahoe/introducer

$ cat introducer.port
17337


Choose Type: Standard (don't pick HTTP; it won't work). Point it to the port listed in introducer.port (in the example above, 17337). 
Start the server tunnel and take note of the Base32 destination. Edit ~/.tahoe/introducer/tahoe.cfg once more and set the tub.location to the introducer's Base32 destination. Restart your introducer node once more.

$ tahoe restart ~/.tahoe/introducer

At this point you have an introducer running and a tunnel pointing to it so it can be used on I2P. Of course, no one will be able to use your introducer without its existence being known. You will find the introducer.furl to give to others in the file ~/.tahoe/introducer/private/introducer.furl

$ cat ~/.tahoe/introducer/private/introducer.furl
pb://c6w5ernw7y7rp3uwmdyu5clujyt2y4m4@w2zrwz5gplkkufix7cb4gmxfbrkwg2abnsgk62bm5iifzlahe7kq.b32.i2p/introducer
Introducers on Tahoe-LAFS define the grid and their addresses should be published to everyone who wishes to connect to this grid. The example below points to a test introducer operated by KillYourTV. To use KYTV's introducer, add the following introducer.furl to tahoe.cfg.

[client]
introducer.furl = pb://c6w5ernw7y7rp3uwmdyu5clujyt2y4m4@w2zrwz5gplkkufix7cb4gmxfbrkwg2abnsgk62bm5iifzlahe7kq.b32.i2p/introducer

Add each introducer that you want to use to ~/.tahoe/introducers -- one per line! For example, I currently have

$ cat ~/.tahoe/introducers
pb://c6w5ernw7y7rp3uwmdyu5clujyt2y4m4@w2zrwz5gplkkufix7cb4gmxfbrkwg2abnsgk62bm5iifzlahe7kq.b32.i2p/introducer
pb://exupps5kk3amc5iq4q6f5ahggkm4s5fl@oj7cffq5fnk46iw3i3h2sdgncxrqbxm7wh6i4h2cbpmqsydygkcq.b32.i2p/introducer
pb://md2tltfmdjvzptg4mznha5zktaxatpmz@5nrsgknvztikjxnpvidlokquojjlsudf7xlnrnyobj7e7trdmuta.b32.i2p/introducer
pb://fmcbgy7zd6ubrbphilmrlocvb7f327z5@gdr3tt5uewgnm7r7xn54k2qikf2kuwwegjjsnkz44pjticcacsua.b32.i2p/introducer
pb://tq7rx35yopkvodmsxkqra4qqkbho3yaa@6ga2r2h2fyq6tzcyh6bf3hpio3i7r4edadbq7l4wnh4y62taj6ia.b32.i2p/introducer
pb://cys5w43lvx3oi5lbgk6liet6rbguekuo@sagljtwlctcoktizkmyv3nyjsuygty6tpkn5riwxlruh3f2oze2q.b32.i2p/introducer
pb://r3bs6joub24gtsofe7ohnnjcnwfmo2jy@qaihdh5z7osn7tc3326ahv3z46badiuaulff43wchmap7skg7euq.b32.i2p/42mrbm7zxmjemz6hzejo3i7aunx4eoun

You will need to restart your tahoe node after editing ~/.tahoe/introducers with tahoe restart. Any existing introducer.furl entries in tahoe.cfg will be automatically copied to ~/.tahoe/introducers.

Node Operation

To start your node as a daemon:

$ tahoe start

You can now access your node via the web interface at http://127.0.0.1:3456.

To stop your node if running as daemon:

$ tahoe stop

Storage node

~/.tahoe/tahoe.cfg

[node] tub.port = tcp:3459:interface=127.0.0.1 tub.location = n6k7tu37diq4obmcmv3f144oxxxnehp6njz5lwu4hllp5gp6hbga.b32.i2p

[storage] enabled = true

Optionally you may define how much disk space is reserved with reserved_space:

reserved_space = 5GB

2025/03/24 15:06

Notes SystemD

Voir :

Hardening Security focused systemd configuration

Lister les services

systemctl list-unit-files
systemctl list-units

Lister les services inactifs

systemctl list-units -all --state=inactive

Lister les services KO

systemctl -a |grep dead

Lister les services actifs

# SystemD
systemctl list-units --type service --state active
 
# Avant SystemD
chkconfig --list |grep -E '[1-5]:on'

Savoir si le service est activé ou désactivé

systemctl is-active httpd
systemctl is-enabled httpd

Relire la conf

systemctl daemon-reload

Les différents types de services

Runlevel et Target

Runlevel Target
0 poweroff.target
1 rescue.target
2, 3, 4 multi-user.target
5 graphical.target
6 reboot.target

Contrôler des services (Units) SystemD distants avec Hirte

Debug

systemctl show --property=Environment docker

Autres

If you don't like systemctl's auto-paging feature

export SYSTEMD_PAGER=
Logs entre deux date
journalctl --since "2019-10-16 06:00" --until "2019-10-16 10:00" 
Disable systemd redirection
export _SYSTEMCTL_SKIP_REDIRECT=1
tmpfile
[Service]
PrivateTmp=true

man -k tmpfiles

/etc/tmpfiles.d

/etc/tmpfiles.d/python.conf
x   /tmp/pymp-*
reboot
systemctl reboot
Lang Locale

Voir Notes langue lang locale - SystemD

#timedatectl list-timezones
timedatectl set-timezone Europe/Paris

Pb

RemoveIPC - Quand Poettering fait des siennes

Problème si compte UID > 1000 à cause de RemoveIPC

https://linuxfr.org/users/neologix/journaux/systemd-attention-a-removeipc

RemoveIPC Directive
A new option called RemoveIPC was introduced in RHEL 7.2 through Systemd v219. When set to yes, this option forces a cleanup of all allocated inter-process communication (IPC) resources linked to a user leaving his last session. If a daemon is running as a user with a uid number >=1000, it may crash.

This option should always be set to no by default but, due to the logic of package upgrade, it is highly advisable to set RemoveIPC=no in the /etc/systemd/logind.conf file followed by # systemctl restart systemd-logind (source).

Source : https://www.certdepot.net/rhel7-changes-between-versions/

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