Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
o(≧▽≦)o

Stanislas angristan

:shipit:
o(≧▽≦)o
View GitHub Profile
View FileCalculatorKata.go
package main
import (
"bufio"
"fmt"
"log"
"os"
"strconv"
)
View plz_send_coin.md
Coin Address
NANO nano_1xuxqpmcbanibq55nfwft78tgzx9nyfwo1ahzq9e58hsiqcby74pgdhk7sn6
BTC 3A6Vch8sBCS7BSHfq2ugjNryjrxTAguGnn
ETH 0x0823895690e462aA53eD6748104bD8D5712D1272
BAT 0xB4DA4FF199e683c743ef8Bfb7430Eebc81B8c4a2
DAI 0x25a148E87D35CBBF1d1B0B78D9A220d52f427a5a
DASH XoJigFDigUdGdvGXbzyMxo83dEHqcLgrzY
UNI 0x5c436EF6cc9C90Abf53d849deAdF120dC9601a54
LTC MN2hTTPt1RqfBzUUy8DFDnLjhbi8c3JFL1
@angristan
angristan / fixpngdate.py
Created Sep 19, 2020
Fix PNG file date from file name
View fixpngdate.py
import datetime
import os
import re
import sys
import time
import piexif
def fix(directory):
View I'm a night 🦉
🌞 Morning 49 commits █▍░░░░░░░░░░░░░░░░░░░ 7.1%
🌆 Daytime 186 commits █████▌░░░░░░░░░░░░░░░ 26.8%
🌃 Evening 294 commits ████████▉░░░░░░░░░░░░ 42.3%
🌙 Night 166 commits █████░░░░░░░░░░░░░░░░ 23.9%
View tp.py
import ply.yacc as yacc
import ply.lex as lex
from genereTreeGraphviz2 import printTreeGraph
tokens = (
'NUMBER', 'MINUS',
'PLUS', 'TIMES', 'DIVIDE',
'LPAREN', 'RPAREN', 'PRINT',
'EQUALS', 'NAME', 'IF', 'SEMICOLON',
'GTH', 'LTH', 'GTHOREQUAL', 'LTHOREQUAL', 'EQUALEQUAL', 'NOTEQUAL', )
@angristan
angristan / install-arch.sh
Last active Feb 12, 2020
Install Arch Linux
View install-arch.sh
# Prepare env
timedatectl set-ntp true
timedatectl set-timezone Europe/Paris
# Partition disk
parted /dev/sda mklabel gpt
parted -a optimal /dev/sda mkpart primary fat32 0% 512MB
parted /dev/sda set 1 esp on
parted -a optimal /dev/sda mkpart primary linux-swap 512MB 2560MB
parted -a optimal /dev/sda mkpart primary ext4 2560MB 100%
View rpi_temp.json
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 1,
"gridPos": {
"h": 9,
"w": 12,
View rpi_cpu_freq.json
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 1,
"gridPos": {
"h": 9,
"w": 12,
@angristan
angristan / single-node-es.md
Last active Jul 16, 2021
Elasticsearch settings for single-node cluster (1 shard, 0 replica)
View single-node-es.md

Elasticsearch settings for single-node cluster

1 shard, 0 replica.

For future indices

Update default template:

curl -X PUT http://localhost:9200/_template/default -H 'Content-Type: application/json' -d '{"index_patterns": ["*"],"order": -1,"settings": {"number_of_shards": "1","number_of_replicas": "0"}}' 
@angristan
angristan / psql_migration.md
Last active Feb 16, 2019
Mastodon DB migration
View psql_migration.md

Migrating the Mastodon database

On the old server

postgres@postgresql:~$ pg_dump -Fc mastodon -f mastodon.dump

OR