- render a pdf as png files, to remove all hidden information:
gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -r600 -dDownScaleFactor=3 -sDEVICE=png16m -sOutputFile=new-%01d.png original.pdf
- rebuild a pdf file to remove errors:
gs -dPDFA -dBATCH -dNOPAUSE -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile=repariert.pdf original.pdf
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
AWS_PROFILE=XXX | |
AWS_DEFAULT_REGION=YYY | |
echo -e "Stack Name\t\tRessource Count"; for name in $(aws cloudformation list-stacks --stack-status-filter UPDATE_COMPLETE CREATE_COMPLETE | jq --raw-output ".StackSummaries[].StackName"); do echo -ne "${name}\t"; aws cloudformation list-stack-resources --stack-name ${name} | jq ".StackResourceSummaries | length"; done |
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 | |
export WORKDIR=$( cd $(dirname $1) ; pwd -P ) | |
export FILENAME=$( basename $1 ) | |
for x in `boot2docker shellinit`; do if [ $x != 'export' ]; then export $x; fi; done | |
docker inspect xelatex > /dev/null && docker rm xelatex > /dev/null | |
echo "Starting dockerized XeLaTeX in $WORKDIR on $FILENAME" |
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
# clean all temporary stuff | |
port clean --all all | |
# remove all inactive ports | |
port -f uninstall inactive | |
# update all installed ports and remove the outdated ones | |
port -u upgrade outdated | |
# get all the dependecies for… |
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
# NIST AES 256 CTR test vector | |
key = "\x60\x3d\xeb\x10\x15\xca\x71\xbe\x2b\x73\xae\xf0\x85\x7d\x77\x81\x1f\x35\x2c\x07\x3b\x61\x08\xd7\x2d\x98\x10\xa3\x09\x14\xdf\xf4" | |
counter = (0xf0f1f2f3, 0xf4f5f6f7, 0xf8f9fafb, 0xfcfdfeff) | |
counter = ("\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff") | |
nist = {'block1': {'plain': "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a", |
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 python2.7 | |
from operator import itemgetter | |
import sys, pickle, os | |
def normalisiere_text(text): | |
""" | |
1. Buchstaben sollen zu Kleinbuchstaben werden |
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 python2.6 | |
import commands | |
domains = ['meine-domain.de', 'meine-andere-domain.com'] | |
def slice_domain(o): | |
ergebnis = "UNDEFINED" | |
count = 0 | |
for line in o.split("\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
#!/usr/bin/awk -f | |
# ics2rem by Hinnerk Haardt <hinnerk@randnotizen.de> | |
# | |
# Converts output of iCalendar to remind | |
# usage: cat FILENAME.ics | rem2ics > reminders.rem | |
# | |
# THE FOLLOWING CODE IS RELEASED INTO THE PUBLIC DOMAIN | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
from random import random | |
from datetime import datetime | |
def simulate_dart(x=None): | |
point_x = random() | |
point_y = random() | |
distance = (point_x**2 + point_y**2)**.5 # x**0.5 == sqrt(x) | |
return (distance < 1) and 1 or 0 |
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
import hashlib | |
from backup import hashes | |
import timeit | |
import cProfile | |
def rechne_sha(filename): | |
block = open(filename, "rb").read() | |
for i in range (512,len(block)): | |
[hashlib.sha1(block[i:i+512]).hexdigest()] |
NewerOlder