Skip to content

Instantly share code, notes, and snippets.

@oguya
oguya / docker-cleanup-resources.md
Created Dec 22, 2018 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@oguya
oguya / installing_onadata.md
Last active Feb 3, 2019
step-by-step notes for install Classic Ona(OnaData) on an Ubuntu 16.04 host
View installing_onadata.md

Installing OnaData(Classic ONA) on Ubuntu 16.04

The following are step-by-step instructions for installing Classic ONA(OnaData) on an Ubuntu 16.04 machine.

  • clone ona repo

      $ cd /opt
      $ git clone https://github.com/onaio/onadata.git
      $ mv onadata onadata-venv
      $ cd onadata-venv
    
@oguya
oguya / bioinformatics-workshop-apps.md
Last active Feb 6, 2017
Tools and software to be used in the CTLGH Bioinformatics workshop from Feb 13-17.
View bioinformatics-workshop-apps.md
View keybase.md

Keybase proof

I hereby claim:

  • I am oguya on github.
  • I am oguya (https://keybase.io/oguya) on keybase.
  • I have a public key ASA1_78svc9r8nnMc6vqP9OYXyJIPPPNIkVct4oWdkyuPAo

To claim this, I am signing this object:

@oguya
oguya / fah-config.xml
Created Sep 30, 2015
FAHClient config. file—/etc/fahclient/config.xml
View fah-config.xml
<config>
<!-- See sample config: /usr/share/doc/fahclient/sample-config.xml -->
<!-- Client Control
Don't fold anonymously, provide user info. -->
<fold-anon v='false'/>
<!-- Folding Slot Configuration -->
<gpu v='true'/> <!-- If true, attempt to autoconfigure GPUs -->
@oguya
oguya / install-go.md
Created May 20, 2015
install go to a custom location
View install-go.md
  • download & install go in your home dir

      mkdir ~/src
      wget "https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz"
      tar -xvf go1.4.2.linux-amd64.tar.gz
      export GOROOT="$HOME/src/go"
      export PATH="$PATH:$GOROOT/bin"
    
  • create a directory where go would download & install packages using go get

View ram_usage.md

RAM Info

  • RAM upgrade on glusterfs wingu nodes
  • There might be inconsistencies in Max RAM values provided by either dmi

Wingu0

  • model: X9DRL-3F/iF (Quad-Core Intel(R) Xeon(R) E5-2643 0 @ 3.30GHz)
  • Max RAM: 96GB *
  • No. of slots/banks: 8
  • Current RAM: 16GB
  • Quad Rank with 32GB: 96GB÷32GB = 3 banks
@oguya
oguya / parallel_sync.sh
Created Jul 9, 2014
backup studio projects, attempt to speedup/parallelize
View parallel_sync.sh
#!/bin/bash
#backup studio project files
#ignore build/ dir
SRC_DIR="/home/james/AndroidStudioProjects/"
DEST_DIR="/run/media/james/tank/Backups/studio/"
cd $SRC_DIR
View Activity.java
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layoutfab);
//Outline
int size = getResources().getDimensionPixelSize(R.dimen.fab_size);
Outline outline = new Outline();
You can’t perform that action at this time.