Skip to content

Instantly share code, notes, and snippets.

View kbsali's full-sized avatar

Kevin Saliou kbsali

View GitHub Profile
@kbsali
kbsali / fixme.bash
Last active November 11, 2025 11:32
PAMAC update "Error: Failed to prepare transaction: invalid or corrupted database" on ArchLinux
```bash
pamac update --aur
...
Error: Failed to prepare transaction: invalid or corrupted database
sudo vim /etc/pacman.conf
```
```
# /etc/pacman.conf
@kbsali
kbsali / docker.md
Last active November 5, 2025 19:14
docker config on linux
import db from "./SQLITE-DB-FILE-PATH.db" with { type: "sqlite" };
const sqliteToTsType: Record<string, string> = {
// numeric
INT: "number",
INTEGER: "number",
TINYINT: "number",
SMALLINT: "number",
MEDIUMINT: "number",
BIGINT: "number",
@kbsali
kbsali / .env
Last active December 18, 2021 17:49
Simple Sveltekit / Crisp (chat box) integration
VITE_CRISP_WEBSITE_ID=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
@kbsali
kbsali / css-100-bytes.css
Last active October 28, 2021 10:42
Tiny little css to make plain html easier to read : https://www.swyx.io/css-100-bytes/
html {
max-width: 70ch;
padding: 3em 1em;
margin: auto;
line-height: 1.75;
font-size: 1.25em;
}
h1,h2,h3,h4,h5,h6 {
margin: 3em 0 1em;
{
"@context": "https://schema.org",
"@type": "Person",
"address": {
"@type": "PostalAddress",
"addressCountry": "France",
"addressLocality": "Nantes",
"postalCode": "44000"
},
"sameAs": [
#!/usr/bin/env bash
for a in $(find src/ -type f);do expand -t2 $a > tmp && cp tmp $a;done
for a in $(grep -P "\t" .* -l);do expand -t2 $a > tmp && cp tmp $a;done
for a in $(grep -P "\t" * -l --exclude-dir={node_modules,src,static});do expand -t2 $a > tmp && cp tmp $a;done
rm tmp
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
position;heure;dur�e;sog;cog;TWS;TWD;vit.courant;dir.courant;pression
33�08.280 N 025�33.800 W;13/11/2020 10:30:00;7200;18.24;174.9;37.6;44;0.00;0;1000000000000000019884624838656.00
32�31.947 N 025�29.958 W;13/11/2020 12:30:00;7200;16.72;173.9;33.9;23;0.00;0;1000000000000000019884624838656.00
31�58.696 N 025�25.771 W;13/11/2020 14:30:00;7200;18.49;218.9;37.4;345;0.00;0;1000000000000000019884624838656.00
31�29.926 N 025�53.088 W;13/11/2020 16:30:00;7200;19.31;211.9;36.9;332;0.00;0;1000000000000000019884624838656.00
30�57.154 N 026�16.964 W;13/11/2020 18:30:00;7200;20.90;204.9;31.1;329;0.00;0;1000000000000000019884624838656.00
30�19.249 N 026�37.434 W;13/11/2020 20:30:00;7200;22.06;205.9;27.9;330;0.00;0;1000000000000000019884624838656.00
29�39.569 N 026�59.702 W;13/11/2020 22:30:00;7200;21.58;211.9;21.8;334;0.00;0;1000000000000000019884624838656.00
29�02.939 N 027�25.883 W;14/11/2020 00:30:00;7200;19.80;218.9;17.4;337;0.00;0;1000000000000000019884624838656.00
28�32.138 N 027�54.265 W;14/11/2020 02:30:0

Keybase proof

I hereby claim:

  • I am kbsali on github.
  • I am kbsali (https://keybase.io/kbsali) on keybase.
  • I have a public key whose fingerprint is D36C 3DFC F82D D0A5 32E7 47E7 C04F 90E3 E72B DA66

To claim this, I am signing this object:

@kbsali
kbsali / migrate_sessions.php
Created November 29, 2017 16:08
Migrate php session from file to redis|memcache
#!/usr/bin/env php
<?php
$host = '127.0.0.1';
$port = null;
$oldPrefix = 'sess_';
$newPrefix = 'sess_';
$sessionDir = '/var/lib/php/session/';
$m = new \Redis();