Skip to content

Instantly share code, notes, and snippets.

Avatar

Antoine d'Otreppe aspyct

View GitHub Profile
@aspyct
aspyct / gist:79666f7d1bc3472ffeb9d8e60ba49ff8
Created Apr 26, 2020
Ubuntu server expand lvm root volume
View gist:79666f7d1bc3472ffeb9d8e60ba49ff8
$ 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
Quick ubuntu18.04 server python workstation setup
View setup.sh
#!/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 Feb 25, 2020
Postgres database inspection queries
View query.sql
-- 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 Oct 25, 2019
rsyslog config to discard syslog messages with tag `fluentd`
View rsyslog.conf
# Put this before the other matching rules.
# Discard anything from fluentd
:syslogtag, isequal, "fluentd:" /dev/null
& stop
View README.md

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 Sep 17, 2018 — forked from morgansoftware/wpa_supplicant.conf
Connect to a WPA2 Enterprise network with wpa_supplicant with this .conf file. I used this to connect to my university's wireless network.
View wpa_supplicant.conf
# 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
View BundleExtensions.cs
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 Nov 17, 2017
My custom bepo-based keylayout on OSX
View fr-dvorak-bepo-aspyct.keylayout
<?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 Apr 13, 2017
Enable debugging in .netstandard libraries for Xamarin
View Project.Core.csproj
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>Full</DebugType>
+ </PropertyGroup>
@aspyct
aspyct / Project.Droid.csproj
Created Apr 13, 2017
Increase java heap size while deploying Xamarin.Android project on device
View Project.Droid.csproj
+ <PropertyGroup>
+ <JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
+ </PropertyGroup>