Skip to content

Instantly share code, notes, and snippets.

@repomaa
repomaa / batch-convert.sh
Created November 20, 2012 04:51
shell script for batch image resizing/converting using imagemagick
#!/bin/bash
status=0;
function help
{
echo "batch-convert: converts all images in source recursively"
echo " "
echo "WARNING:"
echo "If you do not define dest and omit the -s option"
echo "your images will be _overwritten_!"
echo ""
-----BEGIN PGP MESSAGE-----
hQIMA2397x+2y2d5ARAAqMJWVs2RR1vUgbQhQ5lfmDVKTmA7XIgg7pOL5EMFIy8W
1j+/5JIiuxDhyAWqs8rWQHnYiJ1Q6muhYH1IzCaq31U0d6bNWK8nn3+gAWuQ9Mtc
rSsq0g8j9B+P5qSqammKqhTlgeB2YYelG59WMnrargYRm0int8YNdBHg0BcOfc8i
uVrOpwxN1t3Ks6Pwv4XqOgyPuUFqiLPUMCYmVczlXx1VpRegbn25AvBZEwxm9k3H
y6Qf5C6ygOPwqsJbU7Krg68ctPi/ZLXwdgvqFM+hxwrm1HeNZOJIvWaHUSatGLUU
OcwvE03MftNblFpPSRrc/Kj3Z9Xn7R9ai4Mj1YOkofqPbntVTwecYjFMpO11qXEc
VYMjVIy+KAUjGio7oPtZfqa/W/+UBQBiiAvIsIj6z3G7gRI0gnMmTNdUzZECj4BI
R6mGUFQfoFWVk2bPb9Ir0SUDKcr/GEtbj6FKECoNuqSUQbf70+E+uWupXEnFREiL

Keybase proof

I hereby claim:

  • I am repomaa on github.
  • I am repomaa (https://keybase.io/repomaa) on keybase.
  • I have a public key ASDI5hL8d_ibNHlzfqtjCYIFwlQ0AjW_8TMr9raBrg232Ao

To claim this, I am signing this object:

#!/usr/bin/bash
# Copyright (c) Joakim Reinert. All rights reserved.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
API_URL='https://api.domrobot.com/xmlrpc/'
TMPDIR='/tmp/inwx-acme'
class AError < Exception
getter foo
def initialize(@foo : String, message)
super(message)
end
end
class BError < Exception
getter foo
def initialize(@foo : String, message)
OPERATIONS_ORDER = %i[crop scale grayscale]
alias CropTuple = NamedTuple(x_coord: Int32, y_coord: Int32, width: Int32, height: Int32)
abstract struct Operation
end
struct Crop < Operation
getter x_coord : Int32, y_coord : Int32, width : Int32, height : Int32
def initialize(**args)
# Generated by iptables-save v1.6.1 on Tue Feb 6 12:36:16 2018
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [152:12393]
:POSTROUTING ACCEPT [152:12393]
-A POSTROUTING -s 10.8.0.0/24 -o ens3 -j MASQUERADE
COMMIT
# Completed on Tue Feb 6 12:36:16 2018
# Generated by iptables-save v1.6.1 on Tue Feb 6 12:36:16 2018
##########################################################################
# Netscan detected from host 94.130.183.208 #
##########################################################################
time protocol src_ip src_port dest_ip dest_port
---------------------------------------------------------------------------
Mon Feb 5 19:01:11 2018 TCP 94.130.183.208 4001 => 10.1.3.172 55780
Mon Feb 5 19:01:13 2018 TCP 94.130.183.208 4001 => 10.1.3.172 55780
Mon Feb 5 19:01:17 2018 TCP 94.130.183.208 4001 => 10.1.3.172 55780
Mon Feb 5 19:00:24 2018 TCP 94.130.183.208 4001 => 10.240.0.11 44269
# Generated by ferm 2.4.1 on Sun Jan 28 17:59:33 2018
*filter
:OUTPUT ACCEPT [0:0]
-A OUTPUT --out-interface ens3 --match owner --uid-owner ipfs --destination 10.0.0.0/8 --jump DROP
-A OUTPUT --out-interface ens3 --match owner --uid-owner ipfs --destination 192.168.0.0/8 --jump DROP
-A OUTPUT --out-interface ens3 --match owner --uid-owner ipfs --destination 172.16.0.0/24 --jump DROP
COMMIT
##########################################################################
# Netscan detected from host 94.130.183.208 #
##########################################################################
time protocol src_ip src_port dest_ip dest_port
---------------------------------------------------------------------------
Sun Jan 28 12:57:52 2018 TCP 94.130.183.208 1024 => 172.16.9.111 43864
Sun Jan 28 12:57:53 2018 TCP 94.130.183.208 1024 => 172.16.9.111 43864
Sun Jan 28 12:57:55 2018 TCP 94.130.183.208 1024 => 172.16.9.111 43864
Sun Jan 28 12:57:59 2018 TCP 94.130.183.208 1024 => 172.16.9.111 43864