Skip to content

Instantly share code, notes, and snippets.

@guidolodetti
guidolodetti / SimpleFileReader.java
Last active May 17, 2017 21:24
Simple file reader for Android. Just add this file to your project!
// PUT YOUR PACKAGE HERE
// package com.mycompany.myproduct;
import android.content.Context;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
@eagafonov
eagafonov / add_floating_route.sh
Created March 14, 2016 12:33
[DigitalOcean] Simple script to route outgoing traffic through Floating IP
#!/bin/bash -x
set -e
# https://www.digitalocean.com/community/tutorials/how-to-use-floating-ips-on-digitalocean
DESTINATION_IP=$1
shift || (echo "E: Destination IP is not provided. Aborting"; exit 1)
ANCHOR_GW=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/gateway)