Skip to content

Instantly share code, notes, and snippets.

View vpnwall-services's full-sized avatar

Vpnwall Services vpnwall-services

View GitHub Profile
@vpnwall-services
vpnwall-services / Linux-missing-firmware-rtl.md
Created August 7, 2023 21:13
[Linux missing rtl firmware] Linux missing rtl firmware #linux #debian #rtl #firmware #lavalise
  • Download files
#!/bin/bash
mkdir /tmp/fw && cd /tmp/fw
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/rtl8125b-2.fw
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/rtl8125a-3.fw
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/rtl8107e-2.fw
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/rtl8107e-1.fw
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/tl8168fp-3.fw
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/rtl8168h-2.fw
@vpnwall-services
vpnwall-services / PROXMOX-101.md
Created August 5, 2023 15:58
[PROXMOX 101] Proxmox 101 #debian #linux #virutalization #proxmox #pve

PROXMOX 101

  • Create template
#!/bin/bash
qm create 900 --name debian-10-openstack-amd64 --net0 virtio,bridge=vmbr0
qm importdisk 900 debian-10-openstack-amd64.qcow2 local-lvm
qm set 900 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-900-disk-0
qm set 900 --ide2 local-lvm:cloudinit
qm set 900 --boot c --bootdisk scsi0
@vpnwall-services
vpnwall-services / EASYRSA-101.md
Last active July 30, 2023 10:16
[EASYRSA 101] EASYRSA 101 #easyrsa #101
@vpnwall-services
vpnwall-services / DOCKER-101.md
Created July 29, 2023 23:31
[DOCKER 101] DOCKER 101 #docker #101 #debian

DOCKER 101

  • Stop compose and purge everything related docker-compose down --rmi all --volumes
@vpnwall-services
vpnwall-services / SALTSTACK-101.md
Last active July 20, 2023 13:05
[SALTSTACK 101] SALTSTACK 101 #linux #saltstack #salt-minion #salt-master #reactor #pillar #formula

SALTSTACK 101

  • Setup minion conf
# /etc/salt/minion
master: xxx.xxx.xxx.xxx
master_port: 4506
@vpnwall-services
vpnwall-services / htaccess-redirections.md
Created July 7, 2023 14:38
Common Htaccess redirections #php #htaccess #redirection #rewrite #url

Redirect if !_DEBUG=1

RewriteCond %{QUERY_STRING} !_DEBUG=1 #RewriteRule ^/(.)$ /$1?_DEBUG=1 [QSA,R,L] RewriteRule ^/(.)$ /$1?_DEBUG=1 [QSA,L]

#301 Redirects for .htaccess

#Redirect a single page: Redirect 301 /pagename.php http://www.domain.com/pagename.html

@vpnwall-services
vpnwall-services / MySQL_mydumper_myloader.md
Last active July 12, 2023 13:15
[MySQL mydumper/myloader] MySQL mydumper/myloader #bash #mysql #mydumper #myloader #backup #restore
  • Backup mydumper -B my_db -l 60 -o my_backup_temp_folder

  • Restore #-d for backup folder, -B for destination database, -t for threads count, -o for overwriting tables myloader -d ./ -B my_db -t 2 -o

  • Manually import massive datas without blocking

mysql -u root -p
set global net_buffer_length=1000000; # Set network buffer length to a large byte number
@vpnwall-services
vpnwall-services / S3-OBJECT-STORAGE-OVH.md
Created July 7, 2023 13:39
[S3 OBJECT STORAGE OVH] S3 Object Storage OVH #ovh #s3 #object #storage #filesystem #s3fs

S3 OBJECT STORAGE OVH

To mount it, Object storage must use s3 API (and not Openstack Swift) => need to associate user to bucket

  • Put crentials in file /root/.passwd-s3fs keeeeeeeeeeeeeeyy:seeeeeecreeeetkey

  • Perms chmod 600 /root/.passwd-s3fs

@vpnwall-services
vpnwall-services / HAPROXY-101.md
Last active July 13, 2023 15:38
[HAPROXY 101] Haproxy 101 #haproxy #debian #101

HAPROXY 101

  • Stop sending requests to node to enable maintenance on it echo "set server backend_name/svc_name state drain" | socat stdio /var/run/haproxy/admin.sock

  • Start sending requests to node to disable maintenance on it echo "set server backend_name/svc_name state ready" | socat stdio /var/run/haproxy/admin.sock

  • Show statistics

@vpnwall-services
vpnwall-services / CLONEZILLA-101.md
Created June 7, 2023 16:54
[CLONEZILLA 101] Clonezilla 101 #clonezilla #101 #debian

CLONEZILLA 101

  • Extract and mount image
gunzip -d image.gz
mount -o loop image.img /mnt -t ntfs -o ro