Skip to content

Instantly share code, notes, and snippets.

View foxsake's full-sized avatar
:octocat:

Paul Austian Alday foxsake

:octocat:
  • Science City of Muñoz, Philippines
View GitHub Profile
# Here's how to back up a named volume
# 1. Using a `ubuntu` image, we mount the named volume (`myproj_dbdata`) to a `/dbdata` folder inside the `ubuntu` container.
# 2. Then, we create a new folder inside the `ubuntu` container named `/backup`.
# 3. We then create an archive containing the contents of the `/dbdata` folder and we store it inside the `/backup` folder (inside the container).
# 4. We also mount the `/backup` folder from the container to the docker host (your local machine) in a folder named `/backups` inside the current directory.
docker run --rm -v myproj_dbdata:/dbdata -v $(pwd)/backups:/backup ubuntu tar cvf /backup/db_data_"$(date '+%y-%m-%d')".tar /dbdata
@foxsake
foxsake / FRESH_INSTALL_LOKI.md
Last active June 4, 2017 11:07
Things I do after a fresh install of a linux distro(elementary os loki)

Things I do after a fresh install of a linux distro(elementary os loki)

  • replace nano with your favorite text editor. (Like gedit)

Update system

sudo apt update && sudo apt -y upgrade
sudo apt dist-upgrade

Enable PPA

https://*-edge-chat.facebook.com
@foxsake
foxsake / README.md
Last active May 2, 2017 08:58
git remote push to >1 repos

Push to 2 different repository git

Step1: Create first remote

git remote add all git://original/repository.git

Step2: Add second remote

git remote set-url --add --push all git://another/repository.git
@foxsake
foxsake / ImagePicker.java
Created October 19, 2016 08:23 — forked from Mariovc/ ImagePicker.java
Utility for picking an image from Gallery/Camera with Android Intents
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;