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 -e | |
# | |
# Updater script for nextcloud + apps | |
# | |
# Designed for "maintenance" user different from "run" user | |
# eg: here php runs with _nextcloud:nextcloud and maintenance is done by nextcloud:nextcloud | |
# this way, an exploit cannot rewrite the code in place (datadir does not allow php execution) | |
# | |
# Needs curl, xpath (perl module XML::XPath), jq | |
# |
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/env perl | |
# | |
# surveilleur de logins sasl: compte les IP's de provenance d'un meme login | |
# | |
# needs geoip2 perl module and GeoLite2-Country.mmdb (use geoipupdate) | |
# | |
# run by cron on a daily-rotated maillog: | |
# 2 */1 * * * root /usr/local/admin/ssi/surveille-spam.pl /data/logs/serveurs/maillog | |
# 1 0 * * * root /usr/local/admin/ssi/surveille-spam.pl /data/logs/serveurs/maillog.0 | |
use strict; |
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 | |
# | |
# replace php version on FreeBSD | |
# | |
# usage: $0 [php56|php70|php71|php72|…] | sh | |
OVERS=$(pkg info -q |grep '^php[0-9][0-9]-[0-9]'| sed 's/-[0-9].*$//') | |
NVERS=${1:-php71} | |
echo "from $OVERS to $NVERS (CTRL+C ?)" >&2 | |
read nimp |
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 -e | |
# | |
# this script will take your ssh keypair (key and key.pub) to create a | |
# public certificate accepted by an aruba controller to be able to login | |
# with an ssh private key | |
# | |
if [ $# -ne 2 -o ! -f "$1" -o -z "$2" ]; then | |
echo "usage: $0 ssh_priv_key_file login" | |
exit 1 | |
fi |
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 | |
# edition "secure" de /etc/pf.conf | |
# première version: alias vipf='cp -f /etc/pf.conf /tmp/pf.conf.new && vim /tmp/pf.conf.new; diff /tmp/pf.conf.new /etc/pf.conf || ( pfctl -nf /tmp/pf.conf.new && (cp -f /etc/pf.conf /etc/pf.conf.bak; mv /tmp/pf.conf.new /etc/pf.conf; pfctl -f /etc/pf.conf))' | |
# | |
# si appele avec plusieurs arguments, ce sont des IP's des | |
# machines pf a syncroniser (la sienne comprise eventuellement) | |
# | |
# teste sous OpenBSD & FreeBSD | |
# | |
# usage: $0 [IP1 IP2] |
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/env perl | |
# | |
# un p'tit script pour lister les adresses liées à un domaine. | |
# | |
# algo: domaine -> DNS -> IP -> whois -> listes de blocs | |
# | |
use strict; | |
use warnings; | |
use 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
#!/usr/bin/env ruby | |
# ods-ksmutil key export --keystate ready -t KSK --all | ruby gandi.rb ready | |
# ods-ksmutil key export --keystate retire -t KSK --all | ruby gandi.rb retire | |
require 'pp' | |
require 'rubygems' | |
require 'dnsruby' | |
require 'xmlrpc/client' | |
QUOI = ARGV[0] |