RabbitMQ & docker
I just publish Dockerfile for RabbitMQ which use Ubuntu 14.04 as base image
Usage and details can be viewed at https://bitbucket.org/yuks/rabbitmmq
I just publish Dockerfile for RabbitMQ which use Ubuntu 14.04 as base image
Usage and details can be viewed at https://bitbucket.org/yuks/rabbitmmq
In this post I will describe how to use SwipeRefreshLayout which is part from support library too.
Using this new layout is pretty easy and this is a standard way to implement common Pull to refresh pattern.
We must know: SwipeRefreshLayout is a ViewGroup layout which can hold only one scrollable view as children.
Example layout file with Swipe Refresh
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/swipe" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> .............................................. </ScrollView> </android.support.v4.widget.SwipeRefreshLayout> </RelativeLayout>
mSwipeLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipe); mSwipeLayout.setOnRefreshListener( new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { System.out.println("Updated"); mSwipeLayout.setRefreshing(false); } });
mSwipeLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipe); mSwipeLayout.post(new Runnable() { @Override public void run() { mSwipeLayout.setRefreshing(true); } });
I'm using DigitalOcean for my VPS's, they provide local mirror for ubuntu.
With this simple command we can replace default ubuntu apt urls with their mirror. It's usefull for docker images.
sudo sed -i "s/archive\.ubuntu/mirrors.digitalocean/g" /etc/apt/sources.list
According to documentation installation process of docker on Ubuntu/Debian based OS's is pretty easy. We can install it with apt-get:
sudo apt-get update && apt-get install docker.io
docker pull ubuntuor if you want only last ubuntu version
docker pull ubuntu:14.04We can check downloaded images with
docker imagesResult will be like:
root@atom:~# docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ubuntu 14.04 2d24f826cb16 3 days ago 188.3 MBAnd after that we can create some ubuntu container with
docker run -i -t ubuntu /bin/bash
I want to get out from my current hosting provider - Superhosting servers but I'm super lazy and instead of making tar.gz / zip archives and moving them via wget for example I prefer to use rsync. Everything is good until I realize that Superhosting is using non standard SSH port, fortunately I can still using rsync with setting "-e" parameter
rsync -avz -e "ssh -p 1022" user@server.net:~/www/ /tmp/copyThis will copy all content from account www directory to /tmp/copy on new machine.