SRE – Systems and Network

Tips and tricks

  • Here is a simple script with configuration file to generate a self-generated SSL certificate (cert/key pair). First define a config file openssl.cnf containing the certificate informations: [ req ] default_bits = 2048 encrypt_key = yes distinguished_name = req_dn x509_extensions =…

  • You can get standard information about the certificate directly by opening a connection to a website: openssl s_client -showcerts -connect python.org:443 </dev/null Answer will be like: CONNECTED(00000003) depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP…

  • You already probably noticed that if you want to update the ownership of a symbolic link on any UNIX system, a simple chown won’t do the job. Indeed, let’s suppose you have this: 8 lrwxr-xr-x 1 user1 group1 4 Jun…

  • It’s not easy to perform bulk DNS resolution when you have many DNS/IPs to control. Here is a simple script allowing you to perform DNS resolution over a list of DNS entries or IPs. Here is a list of DNS…

  • There is no easy way to remove a list of mails in queue with a same sender or domain in Postfix. But you can use some standard commands to get this working. First check the list of mails you want…

  • It is possible to modify a partition size on EXT filesystem thanks to some few commands. We will take here a simple example: We have a /dev/sda5 partition mounted on /home Its size is currently 150G and we want to reduce it to 100G Let’s check…

  • If you forgot what iLO IP has been defined on your linux server and you are working remotely on it, don’t worry, you can still retrieve it with a common tool called ipmitool – available on most of the distros with…

  • Stuck with a telnet session that refuses to give you hand back on console? No worries… You just have to know the correct command to sort this out! When you are opening a telnet connection, you probably got something like:…

  • When you are using the history command on a UNIX system, by default, you’re only getting an action list with numbers but no date and/or time to complete this history. For that, you have to define an environment variable HISTTIMEFORMAT that will describe how…

  • Let’s imagine that we have the following directory listing: $ ls -ls /data/db1/ total 4778688 1488 -rw-r–r– 1 dbmaster 760264 Feb 14 00:20 database_2016_file1 496 -rw-r–r– 1 dbmaster 251529 Dec 29 12:45 database_2016_file2 808960 -rw-r–r– 1 dbmaster 414187520 Jan 30…