Skip to content

Instantly share code, notes, and snippets.

View FedericoCeratto's full-sized avatar

Federico Ceratto FedericoCeratto

View GitHub Profile

$argon2id$v=19$m=8192,t=2,p=4$DOKxAr8GAIRQbMJt6zYuCw$e957IMLuZX6smWZv+RRvsNWYUJ/FB41a

@FedericoCeratto
FedericoCeratto / comp.sh
Last active July 25, 2020 11:10
Reproducible filesystem creation - trivial test
#!/bin/bash
set -eu
gen() {
img="fs-test-$2.img"
rm -f $img
fallocate -l 150M $img
sudo mkfs.$1 $img >/dev/null 2>&1
}
for fs in btrfs jffs2 ext2 ext3 ext4 xfs fat vfat f2fs nilfs2; do
gen $fs 1
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FedericoCeratto
FedericoCeratto / fabric_file_monitor.py
Last active August 29, 2015 14:16
Fabric - Monitor files for change and execute tasks using inotify (like inotifywait) #1295
import inotifyx
from glob import glob
def _run_monitoring_loop(fd, globs, tasks):
"""Setup file monitoring and run Fabric tasks
"""
fnames = [fn for g in globs for fn in glob(g)]
if len(fnames) > 5:
print("Monitoring %d files..." % len(fnames))
# ssh-multi
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
multimux() {
readarray hosts < "$1"
tmux new-window "ssh $1@${hosts[0]}"
#! /bin/sh
#
# Author: Andreas Olsson <andreas@arrakis.se>
# Version: @(#)autossh_tunnel.foo 0.1 27-Aug-2008 andreas@arrakis.se
#
# For each tunnel; make a uniquely named copy of this template.
## SETTINGS
#