Skip to content

Instantly share code, notes, and snippets.

View MoriTanosuke's full-sized avatar

Carsten MoriTanosuke

View GitHub Profile
@MoriTanosuke
MoriTanosuke / flickr-organize.ps1
Last active November 10, 2018 13:46
Simple script to copy Flickr data export files into albums
$count = 0
$all = Get-ChildItem "." -Filter "photo_*.json"
Write-Progress -Activity "Copied" -PercentComplete 0
$all |
Foreach-Object {
$count += 1
$perc = $count / $all.Length
if($count % 50 -eq 0) {
Write-Progress -Activity "Copied" -PercentComplete $perc
@MoriTanosuke
MoriTanosuke / googlemusic.user.js
Created August 4, 2018 19:43
Dark mode for google music - modified for Tampermonkey
// ==UserScript==
// @name Google Play Music | Clean Simple Dark | CSD
// @namespace http://userstyles.org
// @description Keep it clean!
// @author Christian Krause
// @homepage https://userstyles.org/styles/126966
// @run-at document-start
// @version 0.20161029150930
// @match https://play.google.com/music*
// ==/UserScript==
@MoriTanosuke
MoriTanosuke / CamelTransformerExample.java
Last active February 2, 2017 12:29
Simple 1-file example for Apache Camel and two transformers in one route
package de.kopis.examples;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.Main;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CamelTransformerExample {
@MoriTanosuke
MoriTanosuke / README.md
Last active January 8, 2022 17:08
Example for haproxy+tomcat on docker

This gist is an example of a load balancing setup of tomcat, haproxy and docker.

To run the example, execute the following commands on the command line:

# start up the load balancer and one tomcat instance
docker-compose up -d
# open http://localhost and reload the page a couple of times

# now we start up another tomcat instance

docker-compose scale web=2

@MoriTanosuke
MoriTanosuke / ChangeSteamLoginPerUser.cmd
Last active September 2, 2019 20:20
Simple windows batch file for steam multiuser login on the same PC
@echo on
STEAMDIR=C:\Program Files (x86)\Steam
move "%STEAMDIR%\config\SteamAppData.vdf" "%STEAMDIR%\config\SteamAppData_backup.vdf"
copy "%APPDATA%\SteamAppData_%USERNAME%.vdf" "%STEAMDIR%\config\SteamAppData.vdf"
@MoriTanosuke
MoriTanosuke / Dockerfile
Last active July 29, 2016 06:10
Dockerfile to build qdirstat
FROM ubuntu:14.04
RUN apt-get update -y && apt-get install -y build-essential qtbase5-dev zlib1g-dev qttools5-dev-tools qt5-default gdb git
VOLUME ["/usr/target/"]
RUN cd /usr/src && git clone https://github.com/shundhammer/qdirstat.git
RUN echo "\
cd /usr/src/qdirstat/src\n\
qmake\n\
@MoriTanosuke
MoriTanosuke / Dockerfile
Last active June 1, 2016 08:50
Simple Dockerfile for pgweb - web UI for postgres database
FROM alpine
EXPOSE 8081
ENV POSTGRES=postgres \
PORT=5432 USER=postgres \
POSTGRES_PASSWORD=postgres \
POSTGRES_DB=postgres \
SSL=disable
@MoriTanosuke
MoriTanosuke / README.md
Last active February 9, 2016 21:24
Simple POM with override dependencies with pure dependencyManagement

The dependency hamcrest-core is overriden to version 1.2.1 with pure dependencyManagement entry. You don't have to specify a dependency for it.

Run mvn dependency:tree to check.

@MoriTanosuke
MoriTanosuke / _usr_lib_jvm_java-7-openjdk-amd64_jre_bin_java.1000.crash.gz
Last active November 19, 2015 12:38
Logfile from Jitsi which keeps crashing when I lock my screen
This file has been truncated, but you can view the full file.
@MoriTanosuke
MoriTanosuke / Apple.java
Last active August 29, 2015 14:20
Simple junit to demonstrate Predicates.
package de.kopis.java8;
public class Apple {
private String color;
private double weight;
public Apple(String color, double weight) {
this.color = color;
this.weight = weight;
}