Skip to content

Instantly share code, notes, and snippets.

View Horgix's full-sized avatar
🔧
Automating stuff

Alexis "Horgix" Chotard Horgix

🔧
Automating stuff
View GitHub Profile
@Horgix
Horgix / prep.sh
Created September 24, 2022 18:07
SystemDebug
cryptsetup open /dev/disk/by-partlabel/encryptedsystem system
cryptsetup open --type plain --key-file /dev/urandom /dev/disk/by-partlabel/encryptedswap swap
export o=defaults,x-mount.mkdir
export o_btrfs=$o,compress=lzo,ssd,noatime
mount -t btrfs -o subvol=@root,$o_btrfs LABEL=system /mnt
mount -t btrfs -o subvol=@home,$o_btrfs LABEL=system /mnt/home
mount -t btrfs -o subvol=@snapshots,$o_btrfs LABEL=system /mnt/.snapshots
@Horgix
Horgix / hugo-algolia-sample.json
Last active March 12, 2018 11:12
Hugo Algolia JSON Samplle
{
"title": "Latency: from a dream to nightmare in 100ms",
"uri": "meetups/perf-ug_2016-04-26",
"content": "Meetup Performance User group 31 28 avril 2016 Latency dream nightmare 100ms OCTO Technologies It s network reflex every software engineer often right Internet alive think when applications online work unpredictable latency optimise it operating Algolia s servers 38 different datacenters around world across various head scratching events we ll share interesting ones Adam Surak DevOps Security engineer algolia Intro perfug github io Next 19 mai 3e anniversaire adam surak algolia com AdamSurak Algolia Split racks avoid failure increase latency 1ms latency 2 racks speed light 300km Now talk Internet New York Paris i e AWS multiple regions us east vs europe 39ms speed light reality 85ms 2 randoms points earth maximum expected latency 133ms take reality Paris Sidney 322ms Fiber not going shortest path devices middle things etc millisecondsm
@Horgix
Horgix / example_config.go
Last active August 11, 2017 11:09
Packer configuration defaults?
type Config struct {
common.PackerConfig `mapstructure:",squash"`
BoolParam bool `mapstructure:"boolparam"`
IntParam int `mapstructure:"intparam"`
ctx interpolate.Context
}
type Builder struct {
@Horgix
Horgix / main.go
Created August 1, 2017 12:35
Packer custom builder fail
package main
import (
"fmt"
"github.com/hashicorp/packer/common"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer/plugin"
)
@Horgix
Horgix / test_invalid_json.js
Created May 30, 2017 07:18
Test invalid JSON with chakram
describe("POST on /endpoint with invalid JSON", function() {
var apiResponse;
before(function (){
// Note the missing closing curly bracket and the fact that it's a string
data = '{"name": "this JSON is invalid"';
apiResponse = chakram.post(
"http://127.0.0.1:5000/endpoint",
data,
param = {
@Horgix
Horgix / dotscale_2017-morning.md
Last active July 23, 2017 15:42
Summary of DotScale 2017
@Horgix
Horgix / viminstall.log
Created August 3, 2015 09:27
Log of salt minion on pkg.installed vim
2015-08-03 05:24:23,095 [salt.state ][INFO ][12843] Executing state pkg.installed for vim
2015-08-03 05:24:23,096 [salt.loaded.int.module.cmdmod][INFO ][12843] Executing command "repoquery --plugins --queryformat '%{NAME}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-%{REPOID}' -
-all --pkgnarrow=installed" in directory '/root'
2015-08-03 05:24:23,415 [salt.loaded.int.module.cmdmod][INFO ][12843] Executing command "repoquery --plugins --queryformat '%{NAME}_|-%{ARCH}' --pkgnarrow=all --all" in directory '/
root'
2015-08-03 05:24:25,420 [salt.loaded.int.module.cmdmod][INFO ][12843] Executing command "repoquery --plugins --queryformat '%{NAME}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-%{REPOID}'
--all --quiet --whatprovides vim" in directory '/root'
2015-08-03 05:24:25,756 [salt.state ][ERROR ][12843] Package 'vim' not found (possible matches: vim-enhanced)
2015-08-03 05:24:25,756 [salt.state ][INFO ][12843] Completed state [vim] at time 05:24:25.756017
2015-08-03 05:24:25,757 [salt.min