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/bash | |
# author: bert2002 | |
# script: install a ait3 devnet node for Aptos | |
# notes: | |
# - docker must be installed | |
# - dont run as root ; the user needs to be able to run docker (aka in the docker group) | |
# - the monitoring port is at port 80 and not port 8080 as default in the registration | |
# - run the script in a screen session | |
# - the key informations are in $BASE/$WORKSPACE/keys | |
# - to reset, rm -rf testnet |
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 | |
use Mojolicious::Lite; | |
use Net::Facebook::Oauth2; | |
my $config = { | |
facebook => { | |
app_id => '', | |
secret => '', | |
redirect_url => 'http://mojo.dev:3000/redirect_from_fb', | |
}, |
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
Alias /munin /var/cache/munin/www | |
<Directory "/var/cache/munin/www"> | |
AuthUserFile /etc/apache2/munin.pw | |
AuthName "Restricted" | |
AuthType Basic | |
require valid-user | |
</Directory> | |
RewriteEngine On |
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/bash | |
# script: block xmlrpc attacks | |
# author: Steffen Wirth <s.wirth@itbert.de> | |
LOGFILE="/var/log/apache2/access.log" | |
LASTLINES="20" | |
MAXCOUNT="5" | |
LIST=$(tail -n$LASTLINES $LOGFILE |grep "xmlrpc.php" | awk '{print $1}' | sort -n | uniq -c) |
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 | |
# script: download favorite songs from your soundcloud stream | |
# author: Steffen Wirth <s.wirth@itbert.de> | |
use WebService::Soundcloud; | |
use XML::Simple; | |
use HTTP::Cookies; | |
use LWP::Simple; | |
use Encode qw(encode_utf8); | |
no warnings 'utf8'; |
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 | |
# script: download favorite songs from your soundcloud stream | |
# author: Steffen Wirth | |
use WebService::Soundcloud; | |
use XML::Simple; | |
no warnings 'utf8'; | |
# create a new app -> soundcloud.com/you/apps/new | |
my $client_id = "YOUR_CLIEND_ID"; |
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/bash | |
# script: convert AC3 to MP3 in MKV container | |
# author: bert2002 <s.wirth@itbert.de> | |
FILE=$1 | |
FILENAME=$(basename $FILE mkv) | |
AC3AUDIO=$(mkvmerge --identify $FILE |grep "AC3" | awk -F':' '{print $1}' | awk '{print $3}') | |
mkvextract tracks $FILE $AC3AUDIO:${FILENAME}ac3 | |
ffmpeg -i ${FILENAME}ac3 -acodec libmp3lame -ab 160k -ac 2 ${FILENAME}mp3 |
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
<?php | |
// global binary | |
$NAGIOS_DISK = "/usr/lib/nagios/plugins/check_disk"; | |
$DISK_KEY = "Uvg2kFMfy3DU"; | |
if (isset($_GET['key'], $_GET['w'], $_GET['c'])) { | |
// okay | |
$key = $_GET['key']; | |
$warning = $_GET['w']; |
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/bash | |
# Description: Show current ssh client connections and | |
# establish further one if requested. | |
set -e | |
# Define optional exclude regex. | |
EXCLUDE_RE="" | |
count=1 | |
ssh_client_pids=$( lsof -n -iTCP -sTCP:ESTABLISHED | awk '/^ssh/{print |
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 | |
# script: publish article to a wordpress blog using XMLRPC interface. Uploading a picture and setting this as a featured image. Additionally add custom fields. | |
# author: <bert2002> | |
use strict; | |
use utf8; | |
use XMLRPC::Lite; | |
use IO::Socket::SSL; | |
my ($buf,$contents); |