Skip to content

Instantly share code, notes, and snippets.

View aspyct's full-sized avatar

Antoine d'Otreppe aspyct

View GitHub Profile
@aspyct
aspyct / README.md
Last active October 29, 2019 21:05

Add this layout section to the symbols file, after the "bepo" entry. Apply the layout for each login with:

setxkbmap -layout fr -variant bepo_aspyct

Or if you modified the evdev.xml file, you can directly select the layout from Gnome. Tested on Ubuntu 19.10, YMMV.

@aspyct
aspyct / rsyslog.conf
Created October 25, 2019 12:09
rsyslog config to discard syslog messages with tag `fluentd`
# Put this before the other matching rules.
# Discard anything from fluentd
:syslogtag, isequal, "fluentd:" /dev/null
& stop
@aspyct
aspyct / query.sql
Last active February 25, 2020 12:54
Postgres database inspection queries
-- List big tables, materialized views and indices
SELECT relname AS objectname
, relkind AS objecttype
, reltuples AS entries
, pg_size_pretty(pg_table_size(oid)) AS size
FROM pg_class
WHERE relkind IN ('r', 'i', 'm')
ORDER BY pg_table_size(oid) DESC
LIMIT 10;
@aspyct
aspyct / setup.sh
Last active May 2, 2020 11:20
Quick ubuntu18.04 server python workstation setup
#!/bin/sh
byobu-enable
sudo apt install -y vim vim-addon-manager vim-python-jedi vim-ctrlp ranger ripgrep
vim-addons install ctrlp python-jedi
echo "set nu et nowrap ts=4 sw=4 ai" > ~/.vimrc
@aspyct
aspyct / gist:79666f7d1bc3472ffeb9d8e60ba49ff8
Created April 26, 2020 19:15
Ubuntu server expand lvm root volume
$ sudo lvm
lvm> lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
Size of logical volume ubuntu-vg/ubuntu-lv changed from 4.00 GiB (1024 extents) to 110.78 GiB (28360 extents).
Logical volume ubuntu-vg/ubuntu-lv successfully resized.
lvm> exit
Exiting.
$ sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
resize2fs 1.44.1 (24-Mar-2018)
Filesystem at /dev/ubuntu-vg/ubuntu-lv is mounted on /; on-line resizing required
@aspyct
aspyct / zfs.sh
Last active July 28, 2023 21:37
ZFS Essentials
# Create a ZFS pool (i.e. choose disks that are part of the storage)
# In this case, it's a two-disk mirror
# Make sure to use /dev/disk/by-id/* for a stable pool
sudo zpool create <pool_name> mirror /dev/disk/by-id/<disk1> /dev/disk/by-id/<disk2>
sudo zfs create <pool_name>/<dataset_name>
# Check status
sudo zpool status