Skip to content

Instantly share code, notes, and snippets.

View lucatk's full-sized avatar

Luca Killmaier lucatk

View GitHub Profile
@lucatk
lucatk / LocationSerializable.java
Last active August 29, 2015 13:59
Class for serializing Locations (Bukkit)
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.util.NumberConversions;
public class LocationSerializable extends Location implements ConfigurationSerializable {
@lucatk
lucatk / YourPlugin.java
Created August 31, 2014 23:33
Save resource file to specific folder
public boolean saveResourceToPath(String resourcePath, String targetFolder) {
InputStream in = getResource(resourcePath);
if(in == null)
return false;
int lastIndex = resourcePath.lastIndexOf('/');
File outDir = new File(dataFolder, resourcePath.substring(0, lastIndex >= 0 ? lastIndex : 0));
if(!outDir.exists())
outDir.mkdirs();
File outFile = new File(targetFolder, resourcePath)
@lucatk
lucatk / imagemagick.rb
Last active February 8, 2017 17:47 — forked from asanchez75/ImageMagick 6.9.7-4 Homebrew Formula.md
Homebrew Formula for ImageMagick 6.9.7-7
require 'formula'
class Imagemagick < Formula
homepage 'http://www.imagemagick.org'
url 'http://www.imagemagick.org/download/ImageMagick-6.9.7-7.tar.bz2'
sha256 'c0454629e7d3cbced6df31c2c3b6cbfbe8088437e511c1e3a70de2f18d4e6694'
head 'https://www.imagemagick.org/subversion/ImageMagick/trunk',
:using => UnsafeSubversionDownloadStrategy

Keybase proof

I hereby claim:

  • I am lucatk on github.
  • I am lucatk (https://keybase.io/lucatk) on keybase.
  • I have a public key ASD57z4qgRo0jUsRjI0r60KcFv9XyIodP1R4f-40dqw3PAo

To claim this, I am signing this object:

This is just a wee little script for having automated backups of a single-node Rancher instance on docker. The script stops the container, backs its data up and simply uploads the backup file to S3 using s3cmd.

Made for and tested on Ubuntu 18.04.

You can then for example setup a simple cron job for it like this: (every day at 5a.m.)

0 5 * * * /usr/bin/bash /root/backup.sh