Skip to content

Instantly share code, notes, and snippets.

View samber's full-sized avatar
👋

Samuel Berthe samber

👋
View GitHub Profile
@samber
samber / __DEBIAN_QUICK_SETUP__
Last active May 16, 2026 19:04
Debian quick setup
# Quick debian install scripts
@samber
samber / README.md
Last active February 25, 2026 16:14
Password leak check (data source: 4iQ - Dec 2017 - 1.4 billion creds)
#
# This script builds a database containing credentials, in order to check if email+password have leak.
# For a few searchs, the grep command is perfect. No need of an aircraft carrier for fishing in a lake. ;)
# Data source contains 1.4 billon (yes, billon!) passwords from 4iQ (41GB large)
#
# PS: Use. Don't abuse !
#

mkdir 1.4B-password-dump/
@samber
samber / extract-stargazers.js
Created November 14, 2025 15:19
Extract repository stargazers + full profile infos
#!/usr/bin/env python3
import os
import sys
import csv
import time
from datetime import datetime, timezone
import requests
GITHUB_API = "https://api.github.com"
function main() {
extractFollowers();
extractRepos();
}
@samber
samber / compare.js
Created October 21, 2025 22:43
Find updates or removal in 2 ICS files
const ical = require('node-ical');
const moment = require('moment');
const fs = require('fs');
const CUTOFF_DATE = moment('2024-07-13');
const parseIcsFile = async (filePath) => {
try {
const data = fs.readFileSync(filePath, 'utf8');
const events = ical.parseICS(data);
func MyCustomOperator[T, R any](project func(ctx context.Context, item T, index int64) (context.Context, R)) func(ro.Observable[T]) Observable[R] {
return func(source Observable[T]) Observable[R] {
return ro.NewUnsafeObservableWithContext(func(subscriberCtx context.Context, destination ro.Observer[R]) ro.Teardown {
// initialize external lib here (on subscription)
sub := source.SubscribeWithContext(
subscriberCtx,
ro.NewObserverWithContext(
func(ctx context.Context, value T) {
You are a senior TypeScript/Javascript/Java/Python/Golang programmer with experience in the popular frameworks and a preference for clean programming and design patterns.
- Treat me as an expert.
- Be terse
- Be accurate and thorough
- Consider new technologies and contrarian ideas, not just the conventionnal wisdom.
- Do not give me high level shift, if i ask for fix or explanation, i want actual code or explanation. I don't want "here is how you can blablabla".
- You may use high levels of speculation or prediction, just flag it for me
- No moral lectures
- Discuss safety only when it's crucial and non-obvious
@samber
samber / README.md
Last active October 3, 2024 19:20
Time-machine with restic

Time-machine with restic

Features

  • Differential backups
  • Deduplication
  • Encrypted ❤️
  • Backup cleaning
  • Less than 1€ a month
# timestamp is ignored, since we use a very large token validity: 1000000000.
(
lower(http.request.headers["x-screeb-hmac-digest"][0]) eq “hmac-sha256-base64”
)
and
(
is_timed_hmac_valid_v0(
@samber
samber / README.md
Last active July 26, 2022 09:42
GPX Via Ferrata Ivano Debona (Cortina)

GPX Via Ferrata Ivano Debona (Cortina)

As of 2022-07-18.

  • use the chair lift from Rio Gere car park, up to San Fonca Rif
  • climb 700m D+ to the start of Via Ferrata
  • ~5km of Via Ferrata (the best part is the first kilometer)
  • go down into the valley
  • go along the mountain, through the small forest, to the San Fonca Rif (150m D+)
  • use the chair lift if opened, or follow the ski track to walk down to the car park