diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-04-22 22:24:24 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-04-22 22:24:24 +0200 |
commit | 2a5f8639fcc21add3f9161d4986542005d4b1833 (patch) | |
tree | 16e9f0e4d64bfd1c2f0f8bb4008d0949497af968 | |
parent | 31da047b3c06927bd80b78071119678004371098 (diff) | |
download | bin-2a5f8639fcc21add3f9161d4986542005d4b1833.tar.gz bin-2a5f8639fcc21add3f9161d4986542005d4b1833.tar.xz |
misc
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | backup.sh | 2 | ||||
-rwxr-xr-x | fb-test | 3 | ||||
-rwxr-xr-x | gen-perl-pkg | 4 | ||||
-rwxr-xr-x | inwx-add-record.pl | 17 | ||||
-rw-r--r-- | setup-arch-vm | 2 | ||||
-rwxr-xr-x | vpn-connect | 6 |
6 files changed, 23 insertions, 11 deletions
@@ -121,7 +121,7 @@ backup_borg() { fi borg create "${options[@]}" "$dst::backup-$(date "+%Y%m%d-%H%M%S")" "$src" - borg prune --keep-within 7d --keep-daily 7 --keep-weekly 12 --keep-monthly 12 --keep-yearly 3 -v "$dst" + borg prune --keep-within 7d --keep-daily 7 --keep-weekly 12 --keep-monthly 6 --keep-yearly 0 -v "$dst" } ### support functions below ### @@ -2,8 +2,11 @@ ret=0 +echo "Testing MYSQL" ~/git/filebin/run-tests.sh "$@" ret+=$? + +echo "Testing POSTGRES" TESTSUITE_DB=postgres ~/git/filebin/run-tests.sh "$@" ret+=$? diff --git a/gen-perl-pkg b/gen-perl-pkg index 1e34216..46e5d18 100755 --- a/gen-perl-pkg +++ b/gen-perl-pkg @@ -12,7 +12,7 @@ for pkg in "$@"; do for target in "${targets[@]}"; do if [[ -f "$target/$pkg/trunk/PKGBUILD" ]]; then found_pkg=1 - vimdiff "$HOME/pkg/dest/$pkg/PKGBUILD" "$target/$pkg/trunk/PKGBUILD" + vimdiff "$target/$pkg/trunk/PKGBUILD" "$HOME/pkg/dest/$pkg/PKGBUILD" fi done @@ -23,7 +23,7 @@ for pkg in "$@"; do fi echo "Package not found, creating new in '$target_new/$pkg/trunk'" - mkdir -p "$target/$pkg/"{trunk,repos} + mkdir -p "$target_new/$pkg/"{trunk,repos} cp "$HOME/pkg/dest/$pkg/PKGBUILD" "$target_new/$pkg/trunk/" cd "$target_new" svn add "$pkg" diff --git a/inwx-add-record.pl b/inwx-add-record.pl index 135c0b7..c4bcf2d 100755 --- a/inwx-add-record.pl +++ b/inwx-add-record.pl @@ -9,6 +9,7 @@ use File::Basename; use HTTP::Cookies; use Try::Tiny; use XMLRPC::Lite; # +trace => 'all'; +use JSON; # FIXME: put this in a config file @@ -27,10 +28,16 @@ my $name = shift @ARGV; my $type = shift @ARGV; my $content = shift @ARGV; -my $client = DomRobot->proxy($addr, cookie_jar => HTTP::Cookies->new(ignore_discard => 1)); -$client->call('account.login', { user => $usr, pass => $pwd }); -my $TFAToken = getInput("Enter 2FA token (press enter if 2FA is not used)"); -$client->call('account.unlock', { tan => $TFAToken }) if $TFAToken ne ''; +my $client = DomRobot->proxy($addr, cookie_jar => HTTP::Cookies->new(file => "$ENV{HOME}/.inwx-add-record.cookies", autosave => 1, ignore_discard => 1)); + +sub login { + $client->call('account.login', { user => $usr, pass => $pwd }); + my $TFAToken = getInput("Enter 2FA token (press enter if 2FA is not used)"); + $TFAToken =~ s/ //g; + $client->call('account.unlock', { tan => $TFAToken }) if $TFAToken ne ''; +} + +#login(); #open(my $fh, '<', 'domains') or die "Failed to open: $!"; @@ -46,7 +53,7 @@ $client->call('account.unlock', { tan => $TFAToken }) if $TFAToken ne ''; #} #close $fh; -$client->logout; +#$client->logout; exit 0; sub getInput { diff --git a/setup-arch-vm b/setup-arch-vm index 226956e..d7913da 100644 --- a/setup-arch-vm +++ b/setup-arch-vm @@ -104,7 +104,7 @@ Match Group "ssh-password" PasswordAuthentication yes EOF -arch-chroot /mnt mkinitcpio -p linux +arch-chroot /mnt mkinitcpio -p linux || true arch-chroot /mnt syslinux-install_update -aim arch-chroot /mnt useradd -m -g users -G wheel $newuser mkdir /mnt/root/.ssh diff --git a/vpn-connect b/vpn-connect index fef8fea..8f9ea4a 100755 --- a/vpn-connect +++ b/vpn-connect @@ -13,7 +13,9 @@ for i in 128.130.0.0/15 192.35.240.0/24 193.170.3.0/24 193.170.72.0/21; do sudo ip route add $i dev vpntun0 done -hostnames=(ieeexplore.ieee.org dl.acm.org) +hostnames=(ieeexplore.ieee.org dl.acm.org +proquest.tech.safaribooksonline.de +) for ip in $(dig +short "${hostnames[@]}"); do - sudo ip route add dev vpntun0 "$ip" + sudo ip route add dev vpntun0 "$ip" || true done |