Skip to content

Instantly share code, notes, and snippets.

View stefanproell's full-sized avatar

Stefan stefanproell

View GitHub Profile
@stefanproell
stefanproell / mysql2sqlite.sh
Created December 4, 2023 11:59 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@stefanproell
stefanproell / Dockerfile
Last active December 30, 2021 14:25
Run a Facebook Prophet Forecast in a Docker Container
# Run a python script using FB Prophet in a Docker container
# Build image: docker build -f Dockerfile-Debian -t forecast:R1 .
FROM python:3.4.6-wheezy
MAINTAINER Stefan Proell <[email protected]>
RUN apt-get -y update && apt-get install -y \
python3-dev \
libpng-dev \
apt-utils \
@stefanproell
stefanproell / circle.yml
Last active April 24, 2017 15:05
Use the official Oracle MySQL 5.6 / MySQL 5.7 server version in Circle CI with Environment Variables (or any other fork).
machine:
environment:
# JVM options
_JAVA_OPTIONS: "-Xms512m -Xmx2048m -XX:MaxMetaspaceSize=256M"
TERM: dumb
java:
version: openjdk8
dependencies:
pre:
@stefanproell
stefanproell / GetMostRecentCommit.java
Created October 1, 2015 12:04
Get the most recent commit from a sorted list of commits
/**
* Get the latest commit before a specified date.
* @param execDate
* @param path
* @return
*/
public RevCommit getMostRecentCommit(Date execDate, String path){
TreeMap<DateTime,RevCommit> allCommits = this.getAllCommitsBefore(execDate,path);
RevCommit lastCommit = allCommits.lastEntry().getValue();
return lastCommit;
@stefanproell
stefanproell / AllCommitsBeforeADate
Last active October 1, 2015 12:02
Get all commits from repository, which have been commited before a given date
/**
* Get all commits of a file which have been issued before a specified date
* @param commitMap
* @param execDate
* @return
*/
private TreeMap<DateTime,RevCommit> getAllCommitsBefore(Date execDate, String path){
RevWalk walk = new RevWalk( this.repo );
TreeMap<DateTime, RevCommit> commitsByDate = new TreeMap<DateTime, RevCommit>();
try {