This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yaml2json | |
ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' < hello.yaml | |
# json2yaml | |
ruby -ryaml -rjson -e 'puts YAML.dump(JSON.load(ARGF))' < hello.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Dump AWS Cognito users as CSV output. | |
# | |
# Thu Jun 20 15:31:10 CEST 2019, Andrea Leofreddi | |
# | |
me="`basename $0`" | |
if [ $# != 1 ]; then | |
echo Usage: "$me" pool_id >&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Combine two non-duplex document feeder scansions into a single duplex pdf file. | |
# | |
# The input file should be procuded passing the document in the feeder (from the | |
# first page forward) and then passing it again on the backside (that is from | |
# the last page on backward). | |
# | |
# Tue Aug 8 20:41:26 CEST 2017, Andrea Leofreddi | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -p | |
# | |
# Perl implementation of envsubst for systems where it does not exist (eg. macOSX). | |
# | |
# Wed Apr 18 08:03:05 CEST 2018, Andrea Leofreddi | |
# | |
$_ =~ s/\Q${$1||$2}/$ENV{$1?$2:$4}/ while $_ =~ /(\$\{([^}]+)})|(\$(\w+))/g; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fio \ | |
--randrepeat=1 \ | |
--ioengine=libaio \ | |
--direct=1 \ | |
--gtod_reduce=1 \ | |
--name=test \ | |
--filename=random_read_write.fio \ | |
--bs=4k \ | |
--iodepth=64 \ | |
--size=4G \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sgdisk /dev/vda -e && | |
sgdisk -d 1 /dev/vda && | |
sgdisk -N 1 /dev/vda && | |
partprobe && | |
resize2fs /dev/vda1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 | |
@prefix : <#> . | |
@prefix fuseki: <http://jena.apache.org/fuseki#> . | |
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . | |
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I'm always scared of using easy_install and pip on the root python installation as it might screw up things! | |
# | |
# So this is a reminder that for pip & virtualenv will work fine on macOS | |
# | |
sudo easy_install pip && sudo pip install virtualenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update-alternatives --set editor /usr/bin/vim.basic | |
echo ':setlocal indentkeys=' > ~/.vimrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansible -i inventory -m setup -s -u user host |
OlderNewer