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
zoneid=<<zoneid>> | |
bearer=<<bearer>> | |
curl \ | |
--header "Authorization: Bearer $bearer" \ | |
-s "https://api.cloudflare.com/client/v4/zones/$zoneid/dns_records?per_page=50000" \ | |
| jq -r '.result[].id' \ | |
| xargs -n 1 -I {} -P 20 -- curl --silent --request DELETE \ | |
--header "Authorization: Bearer $bearer" \ | |
"https://api.cloudflare.com/client/v4/zones/$zoneid/dns_records/{}" |
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
# Bash array cheatsheet | |
Declare declare -a array=('a' 'b' 'c') | |
Length ${#array[@]} | |
Indices ${!array[@]} | |
Push n (append) array+=('i_0' ... 'i_n') | |
Pop n (bash>=4) unset 'array[-n]' | |
Pop n (bash<4) unset 'arr[${#arr[@]}-n]' |
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
:%!xmllint --format - |
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 |
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
# 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
## 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
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
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
#!/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; |
NewerOlder