Skip to content

Instantly share code, notes, and snippets.

@lemajes
lemajes / rescue-chroot.sh
Last active June 1, 2023 08:09
[RESCUE CHROOT] Rescue chroot #rescue #chroot #ovh #debian
#!/bin/bash
TARGET_DIR=/mnt/chroot
mkdir ${TARGET_DIR}
mount /dev/sdb1 ${TARGET_DIR}
sudo mount -t sysfs /sys ${TARGET_DIR}/sys
sudo mount -t proc /proc ${TARGET_DIR}/proc
sudo mount --bind /dev ${TARGET_DIR}/dev
sudo mount -t devpts /dev/pts ${TARGET_DIR}/dev/pts
sudo mount --bind /tmp ${TARGET_DIR}/tmp
sudo chroot ${TARGET_DIR}/ /bin/bash
@lemajes
lemajes / secorder2.sh
Last active May 11, 2023 21:50
[Secorder2] Secorder2
#!/bin/bash
wget https://raw.githubusercontent.com/jschmid1/gopro_as_webcam_on_linux/master/gopro
#put cam in GoConnect mode
sudo bash gopro webcam -u debian -r 1080
# record
ffmpeg -nostdin -threads 1 -i 'udp://@0.0.0.0:8554?overrun_nonfatal=1&fifo_size=50000000' -f:v mpegts -fflags nobuffer -vf format=yuv420p -f v4l2 /dev/video42 -c copy fart.mkv
# re-encode later
ffmpeg -i mjpeg.mkv -c:v libx264 -crf 23 -preset medium -pix_fmt yuv420p out.mkv
@lemajes
lemajes / WEB-BENCHMARK-101.md
Last active May 10, 2023 08:56
[WEB BENCHMARK 101] Web Benchmark 101 #web #benchmark #101 #python #bash

WEB BENCHMARK 101

  • Locust (swarm website with thousands of users) (pip3 install locust)
#locustfile.py
from locust import HttpUser, between, task

class WebsiteUser(HttpUser):
 wait_time = between(5, 15)
@lemajes
lemajes / HASHICORP 101.md
Last active May 3, 2023 02:29
[HASHICORP 101] Hashicorp 101 #hashicorp #101 #consul #nomad #docker

HASHICORP 101

  • Install go see go installer

  • Download hashi-up

curl -sLS https://get.hashi-up.dev | sh
sudo install hashi-up /usr/local/bin/
@lemajes
lemajes / EPP-SEC-101.md
Last active May 4, 2023 14:13
[EPP SEC 101] EPP SEC 101 #epp #sec #101 #debian #web #vuln #scan #spider

EPP SEC 101

  • Skipfish check website skipfish --auth-form https://xxxxxxxxx/login --auth-user xxxxxx --auth-pass='xxxxxxx' -o skipfish_report/ https://xxxxxxx

  • Gospider gospider --cookie 'cookie_name=cookie_value' -s 'https://xxxxxxxx' -o xxxxx_spider.txt

  • Add session cookie to nikto configuration

@lemajes
lemajes / QEMU-101.md
Last active August 27, 2023 19:39
[QEMU 101] Qemu 101 #qemu #101

QEMU 101

  • Start default network sudo virsh net-start default

  • Shared copy/paste between host and guest sudo apt install spice-vdagent -y && sudo reboot

  • Convert vdi to qcow2

@lemajes
lemajes / ENCRYPTED_PORTABLE_VAULT_101.md
Last active May 1, 2023 13:11
[ENCRYPTED PORTABLE VAULT 101] Encrypted portable vault 101 #encrypted #portable #vault #file #linux #cryptsetup #luks

ENCRYPTED PORTABLE VAULT 101

  • Create empty file dd if=/dev/urandom of=vaultfile.img bs=1M count=512

  • Create LUKS volume cryptsetup --verify-passphrase luksFormat vaultfile.img

  • Open LUKS volume

@lemajes
lemajes / MARIABACKUP-101.md
Created April 25, 2023 00:57
[MARIABACKUP 101] Mariabackup 101 #mariadb #galera #backup #non #blocking

MARIABACKUP 101

  • Create backup mariabackup --backup --target-dir=/backups/

  • Prepare for restore mariabackup --prepare --target-dir=/backups/

  • Restoring

@lemajes
lemajes / Reload.sh
Last active April 22, 2023 23:14
[GDM CONF] GDM CONF #gdm #conf #debian #custom #login
dpkg-reconfigure gdm3
@lemajes
lemajes / compton.conf
Last active April 22, 2023 22:58
[Compton CONF] Compton CONF #compton #conf #gnome #terminal #transparency #i3wm
# Date : 24/07/2017
# Version : v5.0.0
####################################
####### BACK-END ########
####################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.