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
public class trimShell | |
{ | |
public static void doShowTrim(String s, String regex) { | |
System.out.println("in: '"+s+"' out: '" +s.replaceAll(regex,"_").toLowerCase()); | |
} | |
public static void main (String[] args) | |
{ | |
String regex = "[^A-Za-z0-9_]"; | |
System.out.println("Regex used: '"+regex+"'"); |
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 | |
echo "About to remove the following images:" | |
docker images | awk '/^<none>/ {print}' | |
echo "press <ctrl+c> to abort! <enter> to continue" | |
read foo | |
docker images | awk '/^<none>/ {print $3}' | xargs --no-run-if-empty docker rmi |
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 | |
set -e | |
docker pull quay.io/letsencrypt/letsencrypt:latest | |
docker rm -f letsencrypt || true | |
for DOMAIN in foobar.de aceme.com ; do | |
docker run --rm --name letsencrypt \ | |
-v "/data/nginx/static:/webroot" \ | |
-v "/etc/letsencrypt:/etc/letsencrypt" \ |
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 datetime, sys | |
if len(sys.argv) != 3: | |
print "usage: ", sys.argv[0], "<in> <out>" | |
exit() | |
instr="00:01:57.640" | |
instr=sys.argv[1] | |
ints=datetime.datetime.strptime(instr, "%H:%M:%S.%f") |
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
docker run -d --name=pastebinit -e PASTEBINIT_USERNAME=foo -e PASTEBINIT_PASS=aceme -p 8081:8081 bjoern/pastebinit -b http://demo.fiteagle.org:8081/ -p 8081 | |
echo 'for cleanup run: docker exec -it pastebinit sh -c "find /files/ -mtime +10 | xargs echo rm"' |
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
sudo docker run --rm -it --env=XAUTHORITY=/tmp/.docker.xauth -v /tmp/.docker.xauth:/tmp/.docker.xauth -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY --device /dev/dri --name visualstudio jess/visualstudio |
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 jiyin@redhat.com | |
TEMP=`getopt -o vt: --long target -n 'example.bash' -- "$@"` | |
if [ $? != 0 ] ; then echo "getopt fail, terminating..." >&2 ; exit 1 ; fi | |
# Note the quotes around `$TEMP': they are essential! | |
eval set -- "$TEMP" | |
Usage() { |
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
#copied from http://ctfcrew.org/writeup/90 | |
f = open('openwrt-wrtsl54gs-squashfs.hex', 'r') | |
w = open('openwrt-wrtsl54gs-squashfs.bin', 'wb') | |
lines = f.readlines() | |
for l in lines: | |
w.write(l.strip('\n').decode('hex')) | |
w.close() |
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
#include <stdio.h> | |
void hexdump_bytes(unsigned char *src, unsigned cnt, unsigned addr) | |
{ | |
unsigned char *p = src; | |
int i; | |
while (cnt >= 16) { | |
printf("%08x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", addr, | |
p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]); | |
p += 16; |
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
git clone qt | |
git checkout stable | |
perl init-repository -no-webkit | |
./configure -opensource -confirm-license -no-accessibility -qt-sql-sqlite -qt-zlib -no-gif -no-libpng -no-libjpeg -nomake examples -no-gui -nomake tools -no-opengl -no-sm -no-xshape -no-xinerama -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-fontconfig -no-xkb -no-glib -openssl-linked -no-dbus -static -prefix /opt/Qt-5.3.1-static -no-xcb -no-eglfs -no-kms -no-directfb -no-linuxfb -no-cups -no-iconv -no-alsa | |
make -j 4 | |
cd qtbase | |
make install | |
cd ../qtscript | |
make -j 4 |