Skip to content

Instantly share code, notes, and snippets.

View aspyct's full-sized avatar

Antoine d'Otreppe aspyct

View GitHub Profile
@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
@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 / 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 / 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 / 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 / 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 / wpa_supplicant.conf
Created September 17, 2018 13:10
Connect to a WPA2 Enterprise network with wpa_supplicant with this .conf file. I used this to connect to my university's wireless network.
# Connect to a WPA2 Enterprise network with wpa_supplicant with this .conf file.
# I used this to connect to my university's wireless network on Arch linux.
# Here's the command I used:
#
# wpa_supplicant -i wlan0 -c ./wpa_supplicant.conf
#
network={
ssid="YOUR_SSID"
scan_ssid=1
public static class BundleExtensions
{
const string SERIALIZED_KEY = "__JSONSERIALIZED__";
static List<IMapItem> typesMapping;
//TODO: put in order of preference (cf string/charseq , serializable/parcelable, ...) because the for loop will stop at the first recognized type
static BundleExtensions() {
typesMapping = new List<IMapItem>{
new TypeMap<IBinder> ((b, i, v) => b.PutBinder(i, v), (b, i) => b.GetBinder(i)),
@aspyct
aspyct / fr-dvorak-bepo-aspyct.keylayout
Created November 17, 2017 09:51
My custom bepo-based keylayout on OSX
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!-- French Dvorak Layout -->
<!-- http://www.clavier-dvorak.org/ -->
<!-- version 0.6.5 -->
<keyboard group="126" id="6542" name="Aspyct French Dvorak" maxout="5">
<!--
This layout is designed for ISO and ANSI keyboards. The extra
key on an ISO keyboard (next to the left Shift) is optional,
characters on it are also accessible through other keys.
@aspyct
aspyct / Project.Core.csproj
Created April 13, 2017 19:48
Enable debugging in .netstandard libraries for Xamarin
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>Full</DebugType>
+ </PropertyGroup>