Skip to content

Instantly share code, notes, and snippets.

View slomo's full-sized avatar

Yves Müller slomo

View GitHub Profile
@slomo
slomo / read-result.java
Last active December 1, 2015 14:57 — forked from miguelcardo/read-result.java
Check operation result
// handles response from the Read MIFARE Data message
post(new Route(Constants.readBlockCallbackUrl) {
@Override
public Object handle(Request request, Response response) {
JSONObject jsonParameters = (JSONObject) JSONValue.parse(request.body());
String operationId = (String) jsonParameters.get("operationId");
String sessionId = pendingOperations.get(operationId);
pendingOperations.remove(operationId);
int statusCode = ((Long)jsonParameters.get("statusCode")).intValue();
if (statusCode != HTTP_OK)
#!/bin/bash
TARGET="/backup/mysql"
egrep -v "^(#|\\s*$)" /etc/duply/default/enabledDBs | while read DATABASE ; do
# this works securly for all tables in this database. It locks all tables (no read or write) and dumps them.
# Inculding creat db-statment. The quick options dumps to ram, and flushes then. This leads to less locktime.
mysqldump --lock-tables --quick --databases ${DATABASE} | gzip > ${TARGET}/${DATABASE}.mysql.gz
done