From 59f0e9a65639c3aff85ea84aafb5ce8943445334 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 24 Nov 2018 16:51:02 +0100 Subject: Add some cheat commands --- cheat/.cheat/cryptsetup | 11 +++++++++++ cheat/.cheat/ports | 9 +++++++++ cheat/.cheat/qemu | 14 ++++++++++++++ cheat/.cheat/system_ingo | 1 + cheat/.cheat/tty | 5 +++++ 5 files changed, 40 insertions(+) create mode 100644 cheat/.cheat/cryptsetup create mode 100644 cheat/.cheat/ports create mode 100644 cheat/.cheat/qemu create mode 100644 cheat/.cheat/system_ingo create mode 100644 cheat/.cheat/tty diff --git a/cheat/.cheat/cryptsetup b/cheat/.cheat/cryptsetup new file mode 100644 index 0000000..a5ccc69 --- /dev/null +++ b/cheat/.cheat/cryptsetup @@ -0,0 +1,11 @@ +# open encrypted partition /dev/sdb1 (reachable at /dev/mapper/backup) +cryptsetup open --type luks /dev/sdb1 backup + +# open encrypted partition /dev/sdb1 using a keyfile (reachable at /dev/mapper/hdd) +cryptsetup open --type luks --key-file hdd.key /dev/sdb1 hdd + +# close luks container at /dev/mapper/hdd +cryptsetup close hdd + +# create encrypted disk +cryptsetup luksFormat --type luks2 /dev/sdd diff --git a/cheat/.cheat/ports b/cheat/.cheat/ports new file mode 100644 index 0000000..e7ac9a7 --- /dev/null +++ b/cheat/.cheat/ports @@ -0,0 +1,9 @@ +#Trouver un port sans utiliser internet mais le système linux installé +#/etc/services Liste les ports par defauts utilisé + +# Pour avoir des infos sur les entrées de tels ou tels service +# La configuration ce trouve: /etc/nsswitch.conf +getent +# Ex: +getent services 80 + diff --git a/cheat/.cheat/qemu b/cheat/.cheat/qemu new file mode 100644 index 0000000..f749c29 --- /dev/null +++ b/cheat/.cheat/qemu @@ -0,0 +1,14 @@ +# Prepare folder for images + +mkdir ~/.qemu_imgs + +# Creating hard disk + +qemu-img create -f qcow2 ~/.qemu_imgs/image_file.cow 4G + +# Install operating system + +qemu-system-x86_64 -cdrom ~/Download/image.iso -boot order=d -drive file=/home//.qemu_imgs/image_file.cow,format=qcow2 + +tips: Get the mouse after grabbed by qemu: Ctrl+Alt+g + diff --git a/cheat/.cheat/system_ingo b/cheat/.cheat/system_ingo new file mode 100644 index 0000000..caa4f9b --- /dev/null +++ b/cheat/.cheat/system_ingo @@ -0,0 +1 @@ +sudo inxi -Fxxxdfilmopru diff --git a/cheat/.cheat/tty b/cheat/.cheat/tty new file mode 100644 index 0000000..4e2e538 --- /dev/null +++ b/cheat/.cheat/tty @@ -0,0 +1,5 @@ +Message d'erreur : Cannot open your terminal '/dev/pts/0' - please check. +C'est parceque un autre utilisateur (soit même) à initié le terminal +actuel - Problament en utilisant `sudo su` pour lancer screen. +Pour régler le problème sans se connecter avec le bon user : script /dev/null +plus d'info : https://serverfault.com/questions/116775/sudo-as-different-user-and-running-screen/116830#116830 -- cgit v1.2.1