Skip to content

Instantly share code, notes, and snippets.

Avatar
😸
Cuddling the cat

François M. francoism90

😸
Cuddling the cat
View GitHub Profile
View qemu-gtk-test
#!/bin/sh
qemu-system-x86_64 -display gtk \
-boot c \
-enable-kvm -machine q35,accel=kvm \
-object rng-random,id=rng0,filename=/dev/urandom \
-device virtio-rng-pci,rng=rng0 \
-cpu host \
-smp $(nproc) \
-m 4G \
-drive id=disk,file=/run/media/archie/Data/Images/droid,if=none,format=raw \
@francoism90
francoism90 / README.txt
Last active May 31, 2019
Reset MySQL 8.0 password (and use mysql_native_password)
View README.txt
# Adjust /etc/mysql/my.cnf when needed (see example)
# Create /tmp/mysql-init (see example) and make sure it can only be read by 'mysql'
# Stop MySQL service, e.g. 'mysqld'
# Use the correct (non-root) MySQL user to init mysqld, e.g. 'mysql'
shell> sudo systemctl stop mysqld
shell> sudo -u mysql mysqld --init-file=/tmp/mysql-init
# You should be able to login with your password set in /tmp/mysql-init.
@francoism90
francoism90 / power-on
Last active Jun 19, 2019
Prevents Thunderbolt/USB 3.1C suspend on my NUC
View power-on
#!/bin/sh
# force Thunderbolt/USB 3.1C power
# doc: https://www.kernel.org/doc/html/v5.1/admin-guide/thunderbolt.html
echo 1 > /sys/bus/wmi/devices/86CCFD48-205E-4A77-9C48-2021CBEDE341/force_power; \
echo "on" > /sys/bus/wmi/devices/86CCFD48-205E-4A77-9C48-2021CBEDE341/power/control
@francoism90
francoism90 / 99-sysctl.conf
Created Mar 28, 2019
Linux performance tweaks (TCP/UDP, swap, VFS)
View 99-sysctl.conf
# https://docs.continuent.com/tungsten-clustering-5.0/performance-networking.html
# https://wiki.archlinux.org/index.php/Sysctl
# https://pubs.vmware.com/continuent/tungsten-replicator-3.0/performance-networking.html
# https://www.vultr.com/docs/how-to-setup-tcp-optimization-on-linux
# https://russ.garrett.co.uk/2009/01/01/linux-kernel-tuning/
fs.file-max = 2097152
net.core.netdev_max_backlog = 250000
net.core.somaxconn = 1024
net.core.rmem_max = 67108864
@francoism90
francoism90 / chromium-flags.conf
Last active Jun 1, 2019
Chromium Linux flags to enable VA-API decoding, GPU-rending and hopefully some other useful stuff as well
View chromium-flags.conf
--allow-insecure-localhost
--autoplay-policy=document-user-activation-required
--enable-accelerated-2d-canvas
--enable-accelerated-mjpeg-decode
--enable-accelerated-video
--enable-features=AutomaticPasswordGeneration,NativeNotifications,PictureInPicture,SoundContentSetting,UseSurfaceLayerForVideo,WebRtcHideLocalIpsWithMdns,google-password-manager,SingleClickAutofill
--enable-gpu-async-worker-context
--enable-hardware-overlays
--enable-native-gpu-memory-buffers
--enable-oop-rasterization
@francoism90
francoism90 / PKGBUILD
Created Feb 23, 2019
firejail-apparmor
View PKGBUILD
pkgname=firejail-apparmor
pkgver=0.9.58.2
pkgrel=1
pkgdesc="Apparmor support for Firejail"
arch=('i686' 'x86_64')
url="https://firejail.wordpress.com/"
license=('GPL2')
depends=('apparmor')
provides=('firejail')
conflicts=('firejail')
@francoism90
francoism90 / gist:4e1e52b969747e86ab942a745a6724af
Last active Dec 14, 2018
Self-signed certificate (SAN) on Linux and accept this in Chrome/Chromium
View gist:4e1e52b969747e86ab942a745a6724af
$ openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout server.key -out server.crt -subj '/CN=internal' -addext 'subjectAltName=DNS:internal,DNS:example.internal,DNS:project.internal,IP:192.168.1.100'
$ certutil -d sql:$HOME/.pki/nssdb -A -t "TCu,Cu,Tuw" -n internal -i server.crt
@francoism90
francoism90 / 88XXau@.service
Created Nov 16, 2018
Set txpower and monitor mode
View 88XXau@.service
[Unit]
Description=Set 88XXau txpower and monitor-mode
After=systemd-udevd.service systemd-sysusers.service systemd-sysctl.service
Before=network-pre.target multi-user.target shutdown.target
Conflicts=shutdown.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=sh -c 'iw %i set txpower fixed 3000'
@francoism90
francoism90 / init-start
Last active Nov 11, 2020
Change country to unlock channels, increase TX-power
View init-start
#!/bin/sh
nvram set 0:maxp2ga0=114
nvram set 0:maxp2ga1=114
nvram set 0:maxp2ga2=114
nvram set 1:maxp2ga0=0x72
nvram set 1:maxp2ga1=0x72
nvram set 1:maxp2ga2=0x72
nvram set wl_txpower=500
nvram set wl0_txpower=500
nvram set wl1_txpower=500
View gist:8d5b35721a17a756f0ac777f395d3354
https://color.firefox.com/?theme=XQAAAAIUAQAAAAAAAABBqYhm849SCia2CaaEGccwS-xNKliFu97x_iFQjmbD_6TqqbqcXJHtbn8GxEVqbIM4AEampNJCrE4OuHENWFnRfkKle_bR7WuNhPRzUll4VOPFkPYDe3hHEKTL__Ym-RTF9CErTXygBg6AqkTVajlBTawxcxm-WPLQZJ3Y1mCLtXNCHxGpRdL46OhzxGGcEmZwNAz96KxHIFCmUU2M6gkX8p1WSawFhFsqGGtOnAwP_96YYAA