Comandos úteis React Native

# get device id
adb devices

# refresh app
adb -s YOU_DEVICE_ID reverse tcp:8081 tcp:8081 && adb -s YOU_DEVICE_ID reverse tcp:9090 tcp:9090 && adb -s YOU_DEVICE_ID shell input text "RR"

# Forward port to you computer
adb reverse tcp:8081 tcp:8081

# Reload
adb shell input text "RR"

# Open react native menu developer on your device
adb shell input keyevent 82

Docker 01 – Comandos iniciais

# gerar uma nova imagem a partir de um docker em execução
docker commit 822da9494718 aj/ngnix-ubuntu:1.1

# executar o docker mandando a 80 do docker para a 8080 da máquina física
docker run -i -t -p 8080:80 aj/ngnix-ubuntu:1.1 /bin/bash

# executar o docker mandando a 80 do docker para a 8080 da máquina física sem abrir o shell
docker run -d -i -t -p 8080:80 aj/ngnix-ubuntu:1.1 /bin/bash

# para os dois dockers ficarem visível na rede um para o outro
docker run -it --name web02 --link inspiring_bose:web01 aj/ngnix-ubuntu:1.0 /bin/bash

# iniciar um docker que está parado
docker start 5aacdcd188f4

# obter as informações do docker
docker inspect 5aacdcd188f4

# executar um comando dentro do docker sem entrar nele
docker exec 5aacdcd188f4 /etc/init.d/nginx start

# executar um comando dentro do docker sem entrar nele
docker exec 5aacdcd188f4 ps -ef

# entrar no shell do docker
docker attach 27ed54219d4b

# executar um docker e abrir o shell nele
docker run -i -t ubuntu /bin/bash

# parar todos os dockers no powershell
docker ps -a -q | ForEach { docker stop $_ }

# cria o docker de acordo com o Dockerfile
docker-compose up -d

# cria o docker de acordo com o Dockerfile
docker build -t webserver:1.0 .

# redes
docker network ls

# obter detalhes da rede
docker network inspect laradock_backend

# Para sair do docker sem desliga-lo no powershell
CTRL+Z CTRL+C

# uso de recurso do docker
docker stats

# filtrar os dockers para a exibição
docker ps -f "status=exited"

# exibir todos os dockers
docker ps -a

# instalar o netstat
apt-get install net-tools

# confirmar se o apache está escutando a porta 80
netstat -atunp

# rodar o composer
docker-compose up --force-recreate

Exemplo de Dockerfile

FROM ubuntu
MAINTAINER adeilson@gmail.com
RUN apt-get update && apt-get install -y apache2 && apt-get install -y net-tools && apt-get clean
ENV APACHE_LOCK_DIR="/var/lock"
ENV APACHE_PID_FILE="/var/run/apache2.pid"
ENV APACHE_RUN_USER="www-data"
ENV APACHE_RUN_GROUP="www-data"
ENV APACHE_LOG_DIR="/var/log/apache2"

LABEL Description="Webserver"

VOLUME /var/www/html

# RUN /etc/init.d/apache2 start

EXPOSE 80

CMD apachectl -D FOREGROUND

Trabalhar com thread no C# utilizando o TaskFactory

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            //var buffer1 = new BlockingCollection<int>(10); //Qtd maxima de 10 na pilha
            //var buffer2 = new BlockingCollection<int>(10);
            var buffer1 = new BlockingCollection<int>(); //Sem qtd maxima na pilha
            var buffer2 = new BlockingCollection<int>();

            var f = new TaskFactory(TaskCreationOptions.LongRunning,
                                    TaskContinuationOptions.None);

            //List<Task> t = new List<Task>();
            //t.Add(f.StartNew(() => CreateInitialRange(buffer1)));

            Task[] tasks = new Task[3];

            //Start the phases of the pipeline
            //Task stage1 = f.StartNew(() => CreateInitialRange(buffer1));
            //Task stage2 = f.StartNew(() => DoubleTheRange(buffer1, buffer2));
            //Task stage3 = f.StartNew(() => WriteResults(buffer2));

            tasks[0] = f.StartNew(() => CreateInitialRange(buffer1));
            tasks[1] = f.StartNew(() => DoubleTheRange(buffer1, buffer2));
            tasks[2] = f.StartNew(() => WriteResults(buffer2));

            //wait for the phases to complete
            //Task.WaitAll(stage1, stage2, stage3);
            Task.WaitAll(tasks);

            Console.WriteLine("Pressione uma tecla...");
            Console.ReadLine();
        }



        static void CreateInitialRange(BlockingCollection<int> output)
        {
            try
            {
                for (int i = 1; i <= 50; i++)
                {
                    Console.WriteLine("Inicio {0}, qtd {1}", i, output.Count());

                    //Console.WriteLine("CreateInitialRange {0}", i);
                    Thread.Sleep(200);
                    output.Add(i);
                }
            }
            finally
            {
                output.CompleteAdding();
            }
        }


        static void DoubleTheRange(BlockingCollection<int> input, BlockingCollection<int> output)
        {
            try
            {
                foreach (var number in input.GetConsumingEnumerable())
                {
                    Console.WriteLine("Meio {0}, qtd input {1}, qtd output {2}", number * number, input.Count(), output.Count());
                    Thread.Sleep(400);
                    output.Add(number * number);
                }
            }
            finally
            {
                output.CompleteAdding();
            }
        }


        static void WriteResults(BlockingCollection<int> input)
        {
            foreach (var squaredNumber in input.GetConsumingEnumerable())
            {
                //Console.WriteLine("Result is {0}", squaredNumber);
                Console.WriteLine("Fim {0}, qtd {1}", squaredNumber, input.Count());
                Thread.Sleep(800);
            }
        }

    }
}

Fonte: Link