This commit is contained in:
gbrochar 2020-11-22 17:17:08 +01:00
parent 5f6f929393
commit d3527cdd00
42 changed files with 80 additions and 0 deletions

1
network/01 Normal file
View File

@ -0,0 +1 @@
ifconfig -l

2
network/02 Normal file
View File

@ -0,0 +1,2 @@
ifconfig en0 | grep broadcast | cut -d " " -f6
arp -a | cut -d "(" -f2 | cut -d ")" -f1

1
network/03 Normal file
View File

@ -0,0 +1 @@
ifconfig en1 | grep "ether"

1
network/04 Normal file
View File

@ -0,0 +1 @@
netstat -nr | grep default | head -1

1
network/05 Normal file
View File

@ -0,0 +1 @@
nslookup slash16.org | grep Server

1
network/06 Normal file
View File

@ -0,0 +1 @@
/etc/resolv.conf

1
network/07 Normal file
View File

@ -0,0 +1 @@
nslookup slash16.org 8.8.8.8

4
network/08 Normal file
View File

@ -0,0 +1,4 @@
whois slash16.org
Je regarde la ligne name server, ici AwS => Amazon Web Services.
Il y a aussi chez qui le nom de domaine a ete achete.

3
network/09 Normal file
View File

@ -0,0 +1,3 @@
Address: 163.172.250.12
Address: 163.172.250.13
Address: 163.172.250.11

1
network/10 Normal file
View File

@ -0,0 +1 @@
traceroute slash16.org

1
network/11 Normal file
View File

@ -0,0 +1 @@
nat-1 (10.60.1.11)

1
network/12 Normal file
View File

@ -0,0 +1 @@
ipconfig getifaddr en0

1
network/13 Normal file
View File

@ -0,0 +1 @@
e1r5p9.42.fr

1
network/14 Normal file
View File

@ -0,0 +1 @@
/etc/resolv.conf

4
network/15 Normal file
View File

@ -0,0 +1,4 @@
open /etc/hosts
add these two lines :
46.19.122.85 42.fr
46.19.122.85 intra.42.fr

1
scripts/01 Normal file
View File

@ -0,0 +1 @@
awk -F: '{printf("%-24s%-24s%-24s\n", $1, $3, $6)}' /etc/passwd

5
scripts/02 Normal file
View File

@ -0,0 +1,5 @@
for var in "$@"
do
pkill -u $var
userdel -f $var
done

12
scripts/03 Normal file
View File

@ -0,0 +1,12 @@
((nbr=$RANDOM % 100 + 1))
guess=-1
echo "Find the mystery number (between 1 and 100) !!!"
while ((guess != nbr)); do
read -p 'Enter a number : ' guess
if (( guess < nbr )); then
echo "Mystery number is superior to the input number."
elif (( guess > nbr )); then
echo "Mystery number is inferior to the input number."
fi
done
echo "Congrats ! You found the mystery number !"

1
system/01 Normal file
View File

@ -0,0 +1 @@
/etc/os-release

1
system/02 Normal file
View File

@ -0,0 +1 @@
hostname newname

2
system/03 Normal file
View File

@ -0,0 +1,2 @@
/etc/hostname
/etc/hosts

1
system/04 Normal file
View File

@ -0,0 +1 @@
uptime

1
system/05 Normal file
View File

@ -0,0 +1 @@
systemctl status ssh

1
system/06 Normal file
View File

@ -0,0 +1 @@
systemctl restart ssh

1
system/07 Normal file
View File

@ -0,0 +1 @@
cat /var/run/sshd.pid

1
system/08 Normal file
View File

@ -0,0 +1 @@
~/.ssh/authorized_keys

1
system/09 Normal file
View File

@ -0,0 +1 @@
w

1
system/10 Normal file
View File

@ -0,0 +1 @@
lsblk

1
system/11 Normal file
View File

@ -0,0 +1 @@
df -h

1
system/12 Normal file
View File

@ -0,0 +1 @@
du -h /var

1
system/13 Normal file
View File

@ -0,0 +1 @@
top

1
system/14 Normal file
View File

@ -0,0 +1 @@
tail -f /var/log/syslog &

1
system/15 Normal file
View File

@ -0,0 +1 @@
kill -9 %1

1
system/16 Normal file
View File

@ -0,0 +1 @@
The service cron located in /etc/init.d/cron

1
system/17 Normal file
View File

@ -0,0 +1 @@
ssh user@127.0.0.1 -p 22

1
system/18 Normal file
View File

@ -0,0 +1 @@
systemctl stop ssh

4
system/19 Normal file
View File

@ -0,0 +1,4 @@
console-setup.sh dbus irqbalance kmod procps rsyslog sudo
cron hwclock.sh keyboard-setup.sh networking rsync ssh udev
ce sont des daemons/run commands, on peut les afficher avec ls /etc/init.d

1
system/20 Normal file
View File

@ -0,0 +1 @@
cut -d : -f1 /etc/passwd

1
system/21 Normal file
View File

@ -0,0 +1 @@
grep -E "home|root" /etc/passwd | cut -d : -f1

1
system/22 Normal file
View File

@ -0,0 +1 @@
adduser user

11
system/23 Normal file
View File

@ -0,0 +1,11 @@
ssh :
ssh user@ip -p 22
puis taper son mdp
session graphique :
Allumer l'ordinateur
Entrer son login
Entrer son password

1
system/24 Normal file
View File

@ -0,0 +1 @@
dpkg -l