Benutzer-Werkzeuge

Webseiten-Werkzeuge


know-how:usefull_commands

ldmtool

  • Windows dynamische Datenträger zB: Software RAID lesen
  • zB: Debian Buster
apt-get install ldmtool

vlans

  • vconfig ist obsolete
  • BSP: Tagged VLAN40 interface hinzufügen (Schöne neue NIC Namen , leicht zu merken in Gegensatz zu eth0,eth1,eth2 usw.. - in diesem Fall - enx00e04c365a05 :)
 ip link add link enx00e04c365a05 name vlan40 type vlan id 40
  • /etc/network/interfaces zB: VLAN 10 / tagged / auf NIC eth1
  • vlan-raw-device obsolete
  • Getestet auf Ubuntu 18.04
...
#MANAGEMENT
auto eth1.10
iface eth1.10 inet static
      address 172.23.10.1
      netmask 255.255.255.0
..
  • VLAN 10 in Action:
root@firewall:~# ifup eth1.10
root@firewall:~# ip addr ls eth1.10
10: eth1.10@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:15:5d:3e:7e:10 brd ff:ff:ff:ff:ff:ff
    inet 172.23.10.1/24 brd 172.23.10.255 scope global eth1.10
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe3e:7e10/64 scope link 
       valid_lft forever preferred_lft forever
root@firewall:~# cat /proc/net/vlan/eth1.10
eth1.10  VID: 10	 REORDER_HDR: 1  dev->priv_flags: 1021
         total frames received            0
          total bytes received            0
      Broadcast/Multicast Rcvd            0

      total frames transmitted            7
       total bytes transmitted          586
Device: eth1
INGRESS priority mappings: 0:0  1:0  2:0  3:0  4:0  5:0  6:0 7:0
 EGRESS priority mappings: 

prips - IPs expandieren

  • CIDR IP Notationen expandieren
urnilxfgbez@mrChief:~$ prips 192.168.0.0/30
192.168.0.0
192.168.0.1
192.168.0.2
192.168.0.3
22

Use a format:

$ seq -f "10.20.30.%g" 40 50
10.20.30.40
10.20.30.41
10.20.30.42
10.20.30.43
10.20.30.44
10.20.30.45
10.20.30.46
10.20.30.47
10.20.30.48
10.20.30.49
10.20.30.50

Unfortunately this is non-obvious as GNU doesn't like to write man pages.

world of powershell

$currentObject | Get-Member
  • Hilfe für Funktion
help Funktionsname
Help Funktionsname -example
foreach ( $currentObject in   Function_that_returns_multiple_results )
{
  $currentObject.Property 
}
String="vorname.nachname@domain"

String.split("@")[0] -> vorname.nachname
  • Datei nicht vorhanden & Datei vorhanden (ohne -Not ())
$checkFile="C:\foo.txt"

if (-NOT (Test-Path $checkFile)) 
{

}
PS C:\WINDOWS\system32> Install-Module -Name ExchangeOnlineManagement -RequiredVersion 1.0.1

Der NuGet-Anbieter ist erforderlich, um den Vorgang fortzusetzen.
PowerShellGet erfordert die NuGet-Anbieterversion 2.8.5.201 oder höher für die Interaktion mit NuGet-basierten
Repositorys. Der NuGet-Anbieter muss in "C:\Program Files\PackageManagement\ProviderAssemblies" oder
"C:\Users\christian.czeczil\AppData\Local\PackageManagement\ProviderAssemblies" verfügbar sein. Sie können den
NuGet-Anbieter auch durch Ausführen von 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'
installieren. Möchten Sie den NuGet-Anbieter jetzt durch PowerShellGet installieren und importieren lassen?
[J] Ja  [N] Nein  [H] Anhalten  [?] Hilfe (Standard ist "J"): j

Nicht vertrauenswürdiges Repository
Sie installieren die Module aus einem nicht vertrauenswürdigen Repository. Wenn Sie diesem Repository vertrauen, ändern
 Sie dessen InstallationPolicy-Wert, indem Sie das Set-PSRepository-Cmdlet ausführen. Möchten Sie die Module von
'PSGallery' wirklich installieren?
[J] Ja  [A] Ja, alle  [N] Nein  [K] Nein, keine  [H] Anhalten  [?] Hilfe (Standard ist "N"): J
  • Achtung Powershell benutzt offenbar standardmäßig TLS1.0 - wird als obsolete betrachtet, undefinierbare Fehlermeldungen sind die Folge beim Versuch ein Modul zu installieren - kann Ziel nicht erreichen …

PS C:\Windows\system32> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
PS C:\Windows\system32> Install-Module -Name ExchangeOnlineManagement

Der NuGet-Anbieter ist erforderlich, um den Vorgang fortzusetzen.
PowerShellGet erfordert die NuGet-Anbieterversion 2.8.5.201 oder höher für die Interaktion mit NuGet-basierten
Repositorys. Der NuGet-Anbieter muss in "C:\Program Files\PackageManagement\ProviderAssemblies" oder
"C:\Users\christian.czeczil\AppData\Local\PackageManagement\ProviderAssemblies" verfügbar sein. Sie können den
NuGet-Anbieter auch durch Ausführen von 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'
installieren. Möchten Sie den NuGet-Anbieter jetzt durch PowerShellGet installieren und importieren lassen?
[J] Ja  [N] Nein  [H] Anhalten  [?] Hilfe (Standard ist "J"): j

Nicht vertrauenswürdiges Repository
Sie installieren die Module aus einem nicht vertrauenswürdigen Repository. Wenn Sie diesem Repository vertrauen, ändern
 Sie dessen InstallationPolicy-Wert, indem Sie das Set-PSRepository-Cmdlet ausführen. Möchten Sie die Module von
'PSGallery' wirklich installieren?
[J] Ja  [A] Ja, alle  [N] Nein  [K] Nein, keine  [H] Anhalten  [?] Hilfe (Standard ist "N"): j
  • Ausführungsverzeichnis bei powershell Start zB: Laufwerk Z:
powershell.exe -NoExit -command "& {Set-Location Z:\}"
  • Netzwerk Interface „Trust“ Level ändern / wenn zB: MAC des Gateways sich ändert
Get-NetConnectionProfile -> IndexNr des NW Interfaces

Set-NetConnectionProfile -InterfaceIndex IndexNr -NetworkCategory [Private|Public]

syslinux pxe menu password creation

openssl passwd -6 -salt 389asdkfj349 mypassword

awk - sum

grep and cut play  | awk '{sum += $1} END {print sum}' 

busybox - kill telnetd

#!/bin/bash


echo -e "IP1\nIP2\nIP3" | while read line ; do  ( echo "pid_telnet=\$(ps | grep -i telnetd | head -n 1 | awk '{ print \$1 }') ; kill -9 \$pid_telnet" ; sleep 1; ) | telnet  $line ; done

specific line from file

  • 4th line from file
sed :
$>sed -n 4p file.txt

head :
head -n 4 foo | tail -n 1

random line from file

  • single random entry from file
shuf -n 1 filename

log journal systemd

journalctl --vacuum-size=100M

runlevel systemd

  • „Targets“ keine „runlevel“ mehr
# systemctl get-default 
multi-user.target
# systemctl set-default  graphical.target
Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /lib/systemd/system/graphical.target.
Get current targets

The following should be used under systemd instead of running runlevel:

$ systemctl list-units --type=target

Create custom target

The runlevels that held a defined meaning under sysvinit (i.e., 0, 1, 3, 5, and 6); have a 1:1 mapping with a specific systemd target. Unfortunately, there is no good way to do the same for the user-defined runlevels like 2 and 4. If you make use of those it is suggested that you make a new named systemd target as /etc/systemd/system/your target that takes one of the existing runlevels as a base (you can look at /usr/lib/systemd/system/graphical.target as an example), make a directory /etc/systemd/system/your target.wants, and then symlink the additional services from /usr/lib/systemd/system/ that you wish to enable.
Mapping between SysV runlevels and systemd targets
SysV Runlevel 	systemd Target 	Notes
0 	runlevel0.target, poweroff.target 	Halt the system.
1, s, single 	runlevel1.target, rescue.target 	Single user mode.
2, 4 	runlevel2.target, runlevel4.target, multi-user.target 	User-defined/Site-specific runlevels. By default, identical to 3.
3 	runlevel3.target, multi-user.target 	Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.
5 	runlevel5.target, graphical.target 	Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.
6 	runlevel6.target, reboot.target 	Reboot
emergency 	emergency.target 	Emergency shell
Change current target

In systemd targets are exposed via target units. You can change them like this:

# systemctl isolate graphical.target

This will only change the current target, and has no effect on the next boot. This is equivalent to commands such as telinit 3 or telinit 5 in Sysvinit.
Change default target to boot into

The standard target is default.target, which is a symlink to graphical.target. This roughly corresponds to the old runlevel 5.

To verify the current target with systemctl:

$ systemctl get-default

To change the default target to boot into, change the default.target symlink. With systemctl:

# systemctl set-default multi-user.target

Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target -> /usr/lib/systemd/system/multi-user.target.

Alternatively, append one of the following kernel parameters to your bootloader:

    systemd.unit=multi-user.target (which roughly corresponds to the old runlevel 3),
    systemd.unit=rescue.target (which roughly corresponds to the old runlevel 1).

Default target order

Systemd chooses the default.target according to the following order:

    Kernel parameter shown above
    Symlink of /etc/systemd/system/default.target
    Symlink of /usr/lib/systemd/system/default.target

systemd components

memtester check ram

Type the command "memtester 100 5" to test the memory. Replace "100" with the size, in megabytes, of the RAM installed on the computer. Replace "5" with the number of times you want to run the test.

Type the command "echo $?" to show the exit code when you see a command prompt again. If the output is "0" the memory is working properly. The other possible outcomes are:

chromium

  • proxy spezifizieren zB: chromium –proxy-server=localhost:3000

ssh

  • Es konnte keine gemeinsame Krypto gefunden werden / Krypto manuell angeben:
zB:
ssh -oHostKeyAlgorithms=+diffie-hellman-group1-sha1 user@target

Unable to negotiate with x.x.x.x port 22: no matching host key type found. Their offer: ssh-dss

ssh -oHostKeyAlgorithms=+ssh-dss user@target
  • Aus RSA Private PEM Key Public Key exportieren - im OpenSSH kompatiblen Format
ssh-keygen -f private_key -y > /tmp/pub
  • SSH Port Forwarding in den Hintergrund legen und über Socket kontrollieren
Socket erstellen / Verbindung erstellen :
ssh -M -S /tmp/connection-backup-database.sock -fNT -LLOCAL_FORWARDING_PORT:HOSTNAME:REMOTE_PORT  USERNAME@SERVER 

Verbindung überprüfen:
ssh -S /tmp/connection-backup-database.sock -O check USERNAME@SERVER

Socket schließen / Verbindung beenden:
ssh -S /tmp/connection-backup-database.sock -O exit USERNAME@SERVER

apt / dpkg / debian / ubuntu based gpg trust add

  • wget quiet output to stdout | apt-key add gpg key from stdin
  • e.g. kali Repository (rolling release)
wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add -

checkrestart for restarting necessary Services after update

  • check for apt-get install debian-goodies (contains checkrestart)
checkrestart | grep -i service | while read foo ; do  $foo && echo "$foo successfully restarted" ; done

APT-GET

  • Depends on the names of the repositories should work under debian and ubuntu / security upgrades check
apt-get --dry-run dist-upgrade | grep -i security
  • Install only security Updates limit Repositories to „security“
https://www.eidenschink.eu/2014/04/install-security-patches-command-line-debian-ubuntu.html

The trick is then to pass apt-get an option to read the sources from the created file like this:

apt-get upgrade -oDir::Etc::SourceList=/etc/apt/security.sources.list
  • Download ONLY not actual installing
apt-get --download-only dist-upgrade

Device wipe + ETA

# cat /dev/zero | pv > /dev/sdb 
4.83GiB 0:00:18 [ 156MiB/s] [>                                 ]  0% ETA 1:55:23>

DNS capture

tshark -f "udp port 53" -Y "(dns.qry.type == 1 or dns.qry.type==28) and dns.flags.response == 0"

insert line prefix

# If you want to edit the file in-place
sed -i -e 's/^/prefix/' file

Parse Squid time Format

perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e' < squid.log >squid.log.time

Files from the last 7 days

find PATH -type f -ctime -7 

mail testmail

mail -a "From: <tester@test.com>" RECIPIENT_MAIL

Mutt

read Mailbox:
mutt -R -f /var/spool/mail/mailbackup/

send Mails:
echo "This is the message body" | mutt -a "/path/to/file.to.attach" -s "subject of message" -- recipient@domain.com

Mutt Bounce mails to:
l limit  messages to ~f (from) regex
http://perlcode.org/tutorials/mail/mutt-bounce.txt
Mutt Search : /

b - bounce message under cursor
t - tag message under cursor

;b - bounce tagged messages
;d - delete tagged messages


Proxy check URL w3m

http_proxy="http://IP:PORT" w3m http://URL

Vim

  • show non visible characters
:set list 
  • Disable auto mouse detection „i want to copy & paste like i used to“ (Debian 9)
vim /usr/share/vim/vim80/defaults.vim +69

" In many terminal emulators the mouse works just fine.  By enabling it you
" can position the cursor, Visually select and scroll with the mouse.
" if has('mouse')
"  set mouse=a
" endif
The delete ex command will work nicely.

:+,$d

ip add route/ip

Example:
192.168.24.0/24
ip route add 192.168.24.0/24 dev eth1 via 192.168.23.13 

IP-add/remove:
/sbin/ip addr add 10.1.1.1/24 brd + dev bond0
/sbin/ip addr del 10.1.1.1/24 dev bond0

git basics

-git status
-git diff 

Commit all changes
GIT_AUTHOR_NAME=cc GIT_AUTHOR_EMAIL=MAIL git commit -a 

Single File: 
GIT_AUTHOR_NAME=cc GIT_AUTHOR_EMAIL=MAIL git commit PATH_TO_FILE 

Command timeouts

timeout 20s 

Check latency with hping3

hping3 -p 80 -c 2 -S www.google.ca 

Bind dynmaic zones

server:/etc/bind/zones# rndc freeze zone 
server:/etc/bind/zones# vim zone
server:/etc/bind/zones# rndc thaw zone

MySQL

Repair MYISAM database:

 myisamchk --silent --force --fast --update-state --key_buffer_size=64M --sort_buffer_size=64M --read_buffer_size=1M --write_buffer_size=1M /path/to/datadir/*/*.MYI
 
Easy safe repair:
 myisamchk -r -q tbl_name 

Change database password for  User:
mysql> update user set password=PASSWORD("NEW-PASSWORD-HERE") where User='USER';

Solve umlaut troubles mysql:
http://blog.koehntopp.de/archives/3189-FAQ-Mein-mysqldump-zerstoert-meine-Umlaute.html
 
 Grant ACCESS:         
 GRANT ALL PRIVILEGES ON `testuser\_%` . * TO 'testuser'@'localhost';  

 MySQL Revoke u. Grant:
mysql> revoke  Trigger ON *.* from 'testdb'@'%';
Query OK, 0 rows affected (0.43 sec)

mysql> GRANT Trigger ON testdb.* to 'project'@'%';
Query OK, 0 rows affected (0.16 sec)

Tablenames case insensitive:
This depends on lower_case_table_names system variable in mysql.

Code:

mysql> SHOW GLOBAL VARIABLES LIKE 'lower_case_table_names';

If set to 0, table names are stored as specified and comparisons are case sensitive. If set to 1, table names are stored in lowercase on disk and comparisons are not case sensitive. If set to 2, table names are stored as given but compared in lowercase.

The default value is 0 on unix, 1 on windows and 2 on mac.

You can change this by specifying the option while starting mysqld (--lower-case-table-names=2 )

Change data type from column:
ALTER TABLE <table_name> MODIFY <col_name> VARCHAR(65536)

Get processlist:
database information_schema -> table processlist

If you use MySQL 5.1.7 or newer, you can use the PROCESSLIST table in the INFORMATION_SCHEMA. So you can query it with ordinary SELECT queries and apply filtering conditions in a WHERE clause.

This feature is not implemented in MySQL 5.0 and prior.


MySQL one line kill if TIME > xx
for count in $(echo "use information_schema; select ID from processlist where TIME>0" | mysql  --skip-column-names );  do echo "kill $count" | mysql; done

MySQL one line kill old:
for count in $(echo "show processlist" | mysql | awk '{ print $1 }'); do echo "kill $count" | mysql; done

MySQL determine database type:
http://stackoverflow.com/questions/1638070/how-can-i-determine-type-of-mysql-database-whether-it-is-innodb-or-myisam
show table status

Overcome ARG_MAX limit

find . -name '*.???.gz' -print0 | xargs -0 rm -f

OpenSSL

Create rsa key:
openssl genrsa -out privkey.pem 2048 

Create CSR:
openssl req -new -key privkey.pem -out cert.csr

Read CSR:
openssl req -in FILE.csr -text -noout 

Create Key and CSR:
openssl req -new -newkey rsa:2048 -nodes -keyout FILENAME.key -out FILENAME.csr

Public Key encryption
openssl rsautl -certin -encrypt -inkey publickey.pem -in foho -out encrypted.txt

SELF signed all in one:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -sha512


pkcs12 create:
openssl pkcs12 -export -in name-cert.pem -inkey private/name-key.pem -certfile cacert.pem -name "[friendly name]" -out name-cert.p12


CA Zertfifikat neu auststellen mit sha256 - Achtung Zeit muss auf die Minute genau stimmen/Serial muss auch stimmen :
openssl x509  -in ca.crt -CA ca-kombo.crt -set_serial 0xBB0844165013F013 -CAkey ca.key  -out ca-new -days 7200 -sha256

Überprüfen ob Zertifikat von bestimmter CA ausgestellt wurde:
$ openssl verify -verbose -CAfile cacert.pem  server.crt
server.crt: OK

Überprüfen ob CRL von bestimmter CA unterschrieben wurde und ok ist:
openssl crl -verify -CAfile ca.crt -in crl.pem  -noout
verify OK


Fingerprint anzeigen sha1 oder sha256:
openssl x509 -in cert.crt -noout -sha256 -fingerprint
openssl x509 -in cert.crt -noout -sha1 -fingerprint

Bash

for i in *.ENDING; do command < $i 2>&1 | grep -qi 'uninitial' && echo $i; done

strlen:
echo ${#PATH} 

redirect stderr to stdout:
echo "fooo" 2>&1


Bash read file per line:
 while read test ; do echo $test ; done < test
Bash c like for loop:
for ((i=0; i<10 ; i++)) ; do echo $i; done

cat file | xargs -I{} echo {}
or:

for line in (< /path/to/file); do
    echo "Line: $line"
done


https://stackoverflow.com/questions/17368067/length-of-string-in-bash

you could even have a look at stored chars:

myvar='Généralités'
chrlen=${#myvar}
oLang=$LANG oLcAll=$LC_ALL
LANG=C LC_ALL=C
bytlen=${#myvar}
printf -v myreal "%q" "$myvar"
LANG=$oLang LC_ALL=$oLcAll
printf "%s has %d chars, %d bytes: (%s).\n" "${myvar}" $chrlen $bytlen "$myreal"

will answer:

Généralités has 11 chars, 14 bytes: ($'G\303\251n\303\251ralit\303\251s').

Nota: According to Isabell Cowan's comment, I've added setting to $LC_ALL along with $LANG.
Length of an argument

Argument work same as regular variables

strLen()


   
   https://www.thegeekstuff.com/2010/07/bash-string-manipulation/

Bash String Manipulation Examples – Length, Substring, Find and Replace
by SASIKALAon JULY 23, 2010

In bash shell, when you use a dollar sign followed by a variable name, shell expands the variable with its value. This feature of shell is called parameter expansion.

But parameter expansion has numerous other forms which allow you to expand a parameter and modify the value or substitute other values in the expansion process. In this article, let us review how to use the parameter expansion concept for string manipulation operations.

This article is part of the on-going bash tutorial series. Refer to our earlier article on bash { } expansion.
1. Identify String Length inside Bash Shell Script

${#string}

The above format is used to get the length of the given bash variable.

$ cat len.sh
#! /bin/bash

var="Welcome to the geekstuff"

echo ${#var}

$ ./len.sh
24

To understand more about bash variables, read 6 Practical Bash Global and Local Variable Examples.
2. Extract a Substring from a Variable inside Bash Shell Script

Bash provides a way to extract a substring from a string. The following example expains how to parse n characters starting from a particular position.

${string:position}

Extract substring from $string at $position

${string:position:length}

Extract $length of characters substring from $string starting from $position. In the below example, first echo statement returns the substring starting from 15th position. Second echo statement returns the 4 characters starting from 15th position. Length must be the number greater than or equal to zero.

$ cat substr.sh
#! /bin/bash

var="Welcome to the geekstuff"

echo ${var:15}
echo ${var:15:4}

$ ./substr.sh
geekstuff
geek

Also, refer to our earlier article to understand more about $*, $@, $#, $$, $!, $?, $-, $_ bash special parameters.
3. Shortest Substring Match

Following syntax deletes the shortest match of $substring from front of $string

${string#substring}

Following syntax deletes the shortest match of $substring from back of $string

${string%substring}

Following sample shell script explains the above two shortest substring match concepts.

$ cat shortest.sh
#! /bin/bash

filename="bash.string.txt"

echo ${filename#*.}
echo ${filename%.*}

$ ./shortest.sh
After deletion of shortest match from front: string.txt
After deletion of shortest match from back: bash.string

In the first echo statement substring ‘*.’ matches the characters and a dot, and # strips from the front of the string, so it strips the substring “bash.” from the variable called filename. In second echo statement substring ‘.*’ matches the substring starts with dot, and % strips from back of the string, so it deletes the substring ‘.txt’
4. Longest Substring Match

Following syntax deletes the longest match of $substring from front of $string

${string##substring}

Following syntax deletes the longest match of $substring from back of $string

${string%%substring}

Following sample shell script explains the above two longest substring match concepts.

$ cat longest.sh
#! /bin/bash

filename="bash.string.txt"

echo "After deletion of longest match from front:" ${filename##*.}
echo "After deletion of longest match from back:" ${filename%%.*}

$ ./longest.sh
After deletion of longest match from front: txt
After deletion of longest match from back: bash

In the above example, ##*. strips longest match for ‘*.’ which matches “bash.string.” so after striping this, it prints the remaining txt. And %%.* strips the longest match for .* from back which matches “.string.txt”, after striping  it returns “bash”.
5. Find and Replace String Values inside Bash Shell Script
Replace only first match

${string/pattern/replacement}

It matches the pattern in the variable $string, and replace only the first match of the pattern with the replacement.

$ cat firstmatch.sh
#! /bin/bash

filename="bash.string.txt"

echo "After Replacement:" ${filename/str*./operations.}

$ ./firstmatch.sh
After Replacement: bash.operations.txt

Replace all the matches

${string//pattern/replacement}

It replaces all the matches of pattern with replacement.

$ cat allmatch.sh
#! /bin/bash

filename="Path of the bash is /bin/bash"

echo "After Replacement:" ${filename//bash/sh}

$ ./allmatch.sh
After Replacement: Path of the sh is /bin/sh

Taking about find and replace, refer to our earlier articles – sed substitute examples and Vim find and replace.
Replace beginning and end

${string/#pattern/replacement}

Following syntax replaces with the replacement string, only when the pattern matches beginning of the $string.

${string/%pattern/replacement}

Following syntax replaces with the replacement string, only when the pattern matches at the end of the given $string.

$ cat posmatch.sh
#! /bin/bash

filename="/root/admin/monitoring/process.sh"

echo "Replaced at the beginning:" ${filename/#\/root/\/tmp}
echo "Replaced at the end": ${filename/%.*/.ksh}

$ ./posmatch.sh
Replaced at the beginning: /tmp/admin/monitoring/process.sh
Replaced at the end: /root/admin/monitoring/process.ksh

Recommended Reading


https://stackoverflow.com/questions/3173131/redirect-copy-of-stdout-to-log-file-from-within-bash-script-itself
redirect output of script itself to file


#!/usr/bin/env bash

# Redirect stdout ( > ) into a named pipe ( >() ) running "tee"
exec > >(tee -i logfile.txt)

# Without this, only stdout would be captured - i.e. your
# log file would not contain any error messages.
# SEE (and upvote) the answer by Adam Spiers, which keeps STDERR
# as a separate stream - I did not want to steal from him by simply
# adding his answer to mine.
exec 2>&1

echo "foo"
echo "bar" >&2


Delimiter String durchiterieren:
https://stackoverflow.com/questions/918886/how-do-i-split-a-string-on-a-delimiter-in-bash09CFIQ4dUDCAU&uact=5

You can set the internal field separator (IFS) variable, and then let it parse into an array. When this happens in a command, then the assignment to IFS only takes place to that single command's environment (to read ). It then parses the input according to the IFS variable value into an array, which we can then iterate over.

IFS=';' read -ra ADDR <<< "$IN"
for i in "${ADDR[@]}"; do
    # process "$i"
done

Variante 2:

urnilxfgbez@mrWhiteGhost:~$ CURRENT_IFS=$IFS
urnilxfgbez@mrWhiteGhost:~$ db="db1,db2,db4"
urnilxfgbez@mrWhiteGhost:~$ IFS=","
urnilxfgbez@mrWhiteGhost:~$ for i in $db ; do echo "Foo: $i" ; done
Foo: db1
Foo: db2
Foo: db4
urnilxfgbez@mrWhiteGhost:~$ IFS=$CURRENT_IFS
urnilxfgbez@mrWhiteGhost:~$ db2=db1,db2,db4
urnilxfgbez@mrWhiteGhost:~$ echo $db2
db1,db2,db4

Numeric Increment +1 :
urnilxfgbez@mrWhiteGhost:~$ i=5
urnilxfgbez@mrWhiteGhost:~$ ((i++))
urnilxfgbez@mrWhiteGhost:~$ echo $i
6

Numeric add +x :
urnilxfgbez@mrWhiteGhost:~$ let "i=i+5"
urnilxfgbez@mrWhiteGhost:~$ echo $i
11

==========================
https://timmurphy.org/2012/03/09/convert-a-delimited-string-into-an-array-in-bash/
String into Array

#!/bin/bash

OIFS=$IFS;
IFS="|";

animals="dog|cat|fish|squirrel|bird|shark";
animalArray=($animals);

for ((i=0; i<${#animalArray[@]}; ++i)); do     echo "animal $i: ${animalArray[$i]}"; done

IFS=$OIFS;


=================================
Parameter in Bash als Variablen übergeben / als Array definieren damit die Quotes korrekt interpretiert werden

https://serverfault.com/questions/936426/call-rsync-with-args-stored-in-a-string/936461#936461

USERNAME_SSH="foo"
SERVER_HOSTNAME="123.server.at"
TARGET_BACKUP_LOCATION_WEBSITE="/srv/backups/website/"

SSH_COMMON_OPTIONS="-o PasswordAuthentication=no -o ServerAliveInterval=120 -o ServerAliveCountMax=5 -o Compression=yes"

RSYNC_COMMON_OPTIONS="-ax --delete --relative --delete-excluded --compress --timeout=3600 --perms --chmod=u+rwX --exclude=dev/ --exclude=var/tmp/ --exclude=usr/ --exclude=sess_* --exclude=logs/*"

RSYNC_COMMON_OPTIONS_ARRAY=($RSYNC_COMMON_OPTIONS)
RSYNC_COMMON_OPTIONS_ARRAY+=(-e "ssh $SSH_COMMON_OPTIONS")

rsync "${RSYNC_COMMON_OPTIONS_ARRAY[@]}" "$USERNAME_SSH@$SERVER_HOSTNAME:/" "$TARGET_BACKUP_LOCATION_WEBSITE"

===========
Zeilenweises einlesen aus Datei liste.txt

bsp while read foo ; do youtube-dl --extract-audio --audio-format mp3  "$foo" ; done < liste.txt 

RAM info

dmidecode --type 17

Ubuntu version

lsb_release -a

Traffic shaping

Show:
tc class ls dev DEVICE

Gratious ARP

iputils-arping
arping -U -I eth0 IP/Adresse

Socat

socat - unix:socketfilename

Screen

SHARE teilen/detachen:
strg+A :multiuser on ->"server"
screen -x ->client 
Ctrl+A+D for detaching the screen 
  • Screen resume nicht möglich da er es als „attached“ betrachtet
# screen -r 16894
There is a screen on:
	16894.pts-0.backup	(09/01/20 11:17:52)	(Attached)
There is no screen to be resumed matching 16894.
# screen -r -d 16894

Associated Clients hostapd/wpad

iw dev wlan0 station dump

Disassociate Client hostapd/wpad

The default wpad-mini package does provide the disassociate command but not the all_sta. So get the list of associated clients on card wlan1 with iwinfo wlan1 assoclist, select a MAC address and then "kick" it with (for example):

hostapd_cli disassociate -i wlan1 01:23:45:67:89:AB

Considering a client usually tries to reconnect when disconnected, this might just disconnect it for about 10s.
  • Mit iw getestet auf lede 17er Edition
  • Auf 4.19 Kernel (kali linux) probiert er nach ~20-30 Sekunden wieder einen reconnect
Usage:	iw [options] dev <devname> station del <MAC address> [subtype <subtype>] [reason-code <code>]

Remove the given station entry (use with caution!)
Example subtype values: 0xA (disassociation), 0xC (deauthentication)


-> iw dev wlan0 station del MAC-ADRESSE-HIER subtype 0xA

Harddisk shutdown

echo 1 > /sys/block/sdf/device/delete

Check tape

mt -f /dev/st0 status 
mt -f /dev/st0 rewind
mt -f "$TAPE_DEV" eject

postfix

list queue:
postqueue -p
flush queue:
postqueue -f 

Linux software mdadm

mdadm --assemble /dev/md0 --run /dev/sdb1 

Degraded raid1:
$ mdadm --create /dev/md0 -l raid1 -f -n 1 /dev/sda1

(Von Wiki Thomas Krenn: https://www.thomas-krenn.com/de/wiki/RAID_Controller#Software_RAID )
SDX1 hot remove:
root@ubuntumdraidtest:~# mdadm --manage /dev/mdN -r /dev/sdX1
mdadm: hot removed /dev/sdX1 from /dev/mdN

SDX1 add:
root@ubuntumdraidtest:~# mdadm --manage /dev/mdN -a /dev/sdX1
mdadm: added /dev/sdX1

Wenn degraded und status inactive e.g.

root@mrChief:/home/urnilxfgbez# mdadm --run /dev/md127
root@mrChief:/home/urnilxfgbez# cat /proc/mdstat 

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md127 : active (auto-read-only) raid1 sdb1[0]
      1953511936 blocks [2/1] [U_]
      bitmap: 0/15 pages [0KB], 65536KB chunk
  • RAID1 erstellen
root@mrWhiteGhost:/home/urnilxfgbez# fdisk /dev/sda

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-240353279, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-240353279, default 240353279): 

Created a new partition 1 of type 'Linux' and of size 114.6 GiB.

Command (m for help): t
Selected partition 1
          
Hex code (type L to list all codes): fd
Changed type of partition 'Linux' to 'Linux raid autodetect'.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

root@mrWhiteGhost:/home/urnilxfgbez# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-240353279, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-240353279, default 240353279): 

Created a new partition 1 of type 'Linux' and of size 114.6 GiB.

Command (m for help): t 
Selected partition 1
Hex code (type L to list all codes): fd
Changed type of partition 'Linux' to 'Linux raid autodetect'.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

-----

root@mrWhiteGhost:/home/urnilxfgbez# mdadm --create /dev/md0 --level=raid1 --raid-devices=2 /dev/sda1 /dev/sdb1 
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.


--- 
filesystem


root@mrWhiteGhost:/home/urnilxfgbez# mkfs.ext4 -L VAR_FS_RPI /dev/md0 
mke2fs 1.46.2 (28-Feb-2021)
Creating filesystem with 30027264 4k blocks and 7512064 inodes
Filesystem UUID: 1d7fa1a4-f88c-44f7-847b-4340b2f381af
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (131072 blocks): done
Writing superblocks and filesystem accounting information: done

done

done

--

speedup
echo "100000" > /proc/sys/dev/raid/speed_limit_min

stop raid
mdadm --stop /dev/md0

configuration erstellen für startup
/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf

VNC Viewer Hextile

  • Bei extrem schlechter Upload Bandbereite / Hohe Kompression und Zlib like Kompression einsetzen
xtightvncviewer -compresslevel 9 -encoding Tight TARGET
  • Bei Port Forwarding durch SSH Sitzung - Bandbreite grundsätzlich ok
xvncviewer -encoding Hextile localhost

NIC blink

ethtool -p ethx

ARP flux

prevent arp replies on different NICs
zB: echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter

LDAP queries

ldapsearch -h SERVER -D 'CN=Administrator,CN=Users,DC=DOMAIN,DC=local' -x -W -b 'DC=DOMAIN,DC=local' '(&(ATTRIBUTE=1)(objectCategory=Person))' dn ATTRIBUTE

Wget

download all files directory listening with ending .exe:
 wget -q -rl 1 -nd "http://PATH" -A*.exe

Ubuntu

Change keyboard layout:
sudo dpkg-reconfigure console-setup

Winbind

wbinfo - Query information from winbind daemon

Domain join linux server

root# net ads join -UAdministrator%password
http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/domain-member.html

Load Kernel module

make kernel module loadable
depmod -a  program to generate modules.dep and map filesi

less

http://www.thegeekstuff.com/2010/02/unix-less-command-10-tips-for-effective-navigation/

& -> matches only

:n – go to the next file.
:p – go to the previous file.
G – go to the end of file
g – go to the start of file

ddrescue

Disk to image

In this scenario the disk drive /dev/sdb is about to fail and we want to create an exact copy in the form of an image.

First, copy every block without read error and log the errors to /root/rescue.log.
Note
This requires at least as much disk space as the size of the failing disk drive.
root #ddrescue -f -n /dev/sdb /root/sdb_rescue.img /root/rescue.log

-f 
    Force ddrescue to run even if the destination file already exists.
-n 
    Skip the splitting phase to avoid spending a lot of time trying to rescue the most difficult parts of a file.

Second, copy only the bad blocks and try 3 times to read from the source before giving up:
root #ddrescue -d -f -r3 /dev/sdb /root/sdb_rescue.img /root/rescue.log

-d
    Use direct access to the drive and skip any cache.
-rN
    Try N times to rescue the block.

Now the image can be mounted as loop device and the file system checked for corruption.
Note
It can be helpful to not retry at all in cases where the USB controller disconnects the drive if certain blocks are read. Here you may want to skip any errored block.

lvm

  • Empfehlung falls lvm_volume ROOT von einer virtuellen Maschine über kvm - vorher herunterfahren!
  • Verkleinert direkt darunter liegendes Filesystem + LVM - getestet auf Debian stretch
# lvresize --size 150G --resizefs /dev/mapper/lvm_volume
  • LVM Resize - erweitern:
lvresize -L+500G /dev/mapper/foo-lvm
  • LVM Logical Volume anlegen:
lvcreate -n name-lvm  -L500G volume-group
  • LVM Snapshots:
lvcreate -L <LV size> -s -n <snapshot name> /dev/<VG name>/<LV name>
lvremove /dev/<VG name>/<snapshot name>
  • LVM Snapshots - Beispiele um an Filesystem zu kommen (offset mount - 2048*512, oder kpartx)
root@mrGodfather:/mnt# lvcreate  -L200M -s -n guest-mrscanner-root-snapshot /dev/mapper/mrGodfather-guest--mrscanner--root 
  Logical volume "guest-mrscanner-root-snapshot" created.
root@mrGodfather:/mnt# kpartx -av /dev/mapper/mrGodfather-guest--mrscanner--root--snapshot
add map mrGodfather-guest--mrscanner--root--snapshot1 (253:22): 0 136312832 linear 253:21 2048
root@mrGodfather:/mnt# mount -o ro /dev/mapper/mrGodfather-guest--mrscanner--root--snapshot1 /mnt/tmp
root@mrGodfather:/mnt# ls -al /mnt/tmp/
total 2097308
drwxr-xr-x  22 root root       4096 Jul 24 06:39 .
drwxr-xr-x   5 root root       4096 Mar 10  2018 ..
drwxr-xr-x   2 root root       4096 Jul  5 06:53 bin
drwxr-xr-x   3 root root       4096 Jul 25 06:47 boot
drwxr-xr-x   2 root root       4096 Mar 23  2016 dev
drwxr-xr-x 111 root root      12288 Aug  1 06:08 etc
drwxr-xr-x   2 root root       4096 Mar 23  2016 home
lrwxrwxrwx   1 root root         33 Jul 24 06:39 initrd.img -> boot/initrd.img-4.15.0-55-generic
lrwxrwxrwx   1 root root         33 Jul 24 06:39 initrd.img.old -> boot/initrd.img-4.15.0-54-generic
drwxr-xr-x  20 root root       4096 May 21 12:18 lib
drwxr-xr-x   2 root root       4096 May 21 11:59 lib64
drwx------   2 root root      16384 Mar  8  2016 lost+found
drwxr-xr-x   3 root root       4096 Mar  8  2016 media
drwxr-xr-x   2 root root       4096 Jun 25  2018 mnt
drwxr-xr-x   2 root root       4096 Feb 18  2016 opt
dr-xr-xr-x   2 root root       4096 Mar 23  2016 proc
drwx------   7 root root       4096 Aug  9 01:12 root
drwxr-xr-x   3 root root       4096 Oct 19  2016 run
drwxr-xr-x   2 root root      12288 May 21 12:21 sbin
drwxr-xr-x   2 root root       4096 Feb 18  2016 srv
-rw-rw----   1 root root 2147483648 Mar 18  2016 swap.img
dr-xr-xr-x   2 root root       4096 Mar 23  2016 sys
drwxrwxrwt  11 root root      40960 Aug 13 09:45 tmp
drwxr-xr-x  10 root root       4096 Mar  8  2016 usr
drwxr-xr-x  13 root root       4096 Oct 19  2016 var
lrwxrwxrwx   1 root root         30 Jul 24 06:39 vmlinuz -> boot/vmlinuz-4.15.0-55-generic
lrwxrwxrwx   1 root root         30 Jul 24 06:39 vmlinuz.old -> boot/vmlinuz-4.15.0-54-generic
root@mrGodfather:/mnt# umount /mnt/tmp/
root@mrGodfather:/mnt# kpartx -dv /dev/mapper/mrGodfather-guest--mrscanner--root--snapshot
del devmap : mrGodfather-guest--mrscanner--root--snapshot1
root@mrGodfather:/mnt# fdisk /dev/mapper/mrGodfather-guest--mrscanner--root--snapshot

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/mapper/mrGodfather-guest--mrscanner--root--snapshot: 70 GiB, 75161927680 bytes, 146800640 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe7f8c045

Device                                                         Boot Start       End   Sectors Size Id Type
/dev/mapper/mrGodfather-guest--mrscanner--root--snapshot-part1       2048 136314879 136312832  65G 83 Linux

Command (m for help): q

root@mrGodfather:/mnt# mount -o ro,offset=1048576 /dev/mapper/mrGodfather-guest--mrscanner--root--snapshot /mnt/tmp
root@mrGodfather:/mnt# ls -al /mnt/tmp/
total 2097308
drwxr-xr-x  22 root root       4096 Jul 24 06:39 .
drwxr-xr-x   5 root root       4096 Mar 10  2018 ..
drwxr-xr-x   2 root root       4096 Jul  5 06:53 bin
drwxr-xr-x   3 root root       4096 Jul 25 06:47 boot
drwxr-xr-x   2 root root       4096 Mar 23  2016 dev
drwxr-xr-x 111 root root      12288 Aug  1 06:08 etc
drwxr-xr-x   2 root root       4096 Mar 23  2016 home
lrwxrwxrwx   1 root root         33 Jul 24 06:39 initrd.img -> boot/initrd.img-4.15.0-55-generic
lrwxrwxrwx   1 root root         33 Jul 24 06:39 initrd.img.old -> boot/initrd.img-4.15.0-54-generic
drwxr-xr-x  20 root root       4096 May 21 12:18 lib
drwxr-xr-x   2 root root       4096 May 21 11:59 lib64
drwx------   2 root root      16384 Mar  8  2016 lost+found
drwxr-xr-x   3 root root       4096 Mar  8  2016 media
drwxr-xr-x   2 root root       4096 Jun 25  2018 mnt
drwxr-xr-x   2 root root       4096 Feb 18  2016 opt
dr-xr-xr-x   2 root root       4096 Mar 23  2016 proc
drwx------   7 root root       4096 Aug  9 01:12 root
drwxr-xr-x   3 root root       4096 Oct 19  2016 run
drwxr-xr-x   2 root root      12288 May 21 12:21 sbin
drwxr-xr-x   2 root root       4096 Feb 18  2016 srv
-rw-rw----   1 root root 2147483648 Mar 18  2016 swap.img
dr-xr-xr-x   2 root root       4096 Mar 23  2016 sys
drwxrwxrwt  11 root root      40960 Aug 13 09:45 tmp
drwxr-xr-x  10 root root       4096 Mar  8  2016 usr
drwxr-xr-x  13 root root       4096 Oct 19  2016 var
lrwxrwxrwx   1 root root         30 Jul 24 06:39 vmlinuz -> boot/vmlinuz-4.15.0-55-generic
lrwxrwxrwx   1 root root         30 Jul 24 06:39 vmlinuz.old -> boot/vmlinuz-4.15.0-54-generic
root@mrGodfather:/mnt# umount /mnt/tmp/
root@mrGodfather:/mnt# lvremove /dev/mapper/mrGodfather-guest--mrscanner--root--snapshot 
Do you really want to remove active logical volume mrGodfather/guest-mrscanner-root-snapshot? [y/n]: y
  Logical volume "guest-mrscanner-root-snapshot" successfully removed

  • LVM anzeigen volume groups / logical volumes:
vgdisplay
vgs
lvs

PHP

  • Beispiel für eine „pipe“ in PHP bei Skriptaufruf
...
#!/usr/bin/php
<?php

#Pipe Username\n and Password\n to php
$auth_data = file("php://stdin");


if(count($auth_data) != 2)
{
	exit(1);
}



$USERNAME=trim($auth_data[0]);
$PASSWORD=trim($auth_data[1]);

...
You can use the GLOB_BRACE constant

    GLOB_BRACE - Expands {a,b,c} to match 'a', 'b', or 'c'

e.g.

$dirname = 'uploads/';
glob("$dirname*.{png,jpeg,jpg,gif}", GLOB_BRACE);

See: http://php.net/manual/en/function.glob.php

qemu

  • Konvertieren von RAW nach VDI (VirtualBox)
 qemu-img convert -f raw -O vdi develop-firewall-debian.img develop-firewall-debian.vdi  

boot

Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
	
Quote:
Originally Posted by bts145 View Post
First you must activate the magic SysRq option:

echo 1 > /proc/sys/kernel/sysrq

When you are ready to reboot the machine simply run the following:

echo b > /proc/sysrq-trigger


http://www.linuxjournal.com/content/rebooting-magic-way


oder

the way, when you do init=/bin/sh (or bash), it isn't strictly necessary to reboot afterwards (well, depending on what you change I suppose), you can just do an 'exec /sbin/init' to continue the boot process. Make sure the state of the system is as it would normally be though (e.g. umount /usr, make / readonly again etc).

letsencrypt magic

  • apt-get install certbot
  • Hostname e.g. hostname.domain.at MUSS von extern über Port 80 für Challenge/Response zur Verfügung stehen
  • IP's lassen sich NICHT firewallen von let's encrypt - it's a feature :)
oot@firewall:/tmp# certbot certonly --webroot --webroot-path /var/www/letsencrypt/ -d hostname.domain.at
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): support@domain.at

-------------------------------------------------------------------------------
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel: A

-------------------------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o: N
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for hostname.domain.at
Using the webroot path /var/www/letsencrypt for all unmatched domains.
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/hostname.domain.at/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/hostname.domain.at/privkey.pem
   Your cert will expire on 2019-03-19. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

root@firewall:/tmp# certbot certonly --webroot --webroot-path /var/www/letsencrypt/ -d hostname.domain.at
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Cert not yet due for renewal

You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.
(ref: /etc/letsencrypt/renewal/hostname.domain.at.conf)

What would you like to do?
-------------------------------------------------------------------------------
1: Keep the existing certificate for now
2: Renew & replace the cert (limit ~5 per 7 days)
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): c
Operation canceled. You may re-run the client.
root@firewall:/tmp# certbot renew --quiet --post-hook "service apache2 restart"
root@firewall:/tmp# echo $?
0
Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information
know-how/usefull_commands.txt · Zuletzt geändert: 2021/05/06 11:12 von cc