How To Install Redis 2.x on Red Hat

Redis 2.4
1. Install using yum. The current yum version as of this writing is Redis 2.4.

> yum install redis php-pecl-redis

2. Edit redis.conf. Comment out the bind configuration to bind Redis on all IPs.

> vi /etc/redis.conf

3. Start Redis manually and on startup.

> service redis start
> chkconfig redis on

Redis 2.8

1. Download Redis 2. The latest Redis 2 version as of this writing is Redis 2.8.22.

> mkdir redis; cd redis
> wget
> tar xzf redis-2.8.22.tar.gz
> cd redis-2.8.22

2. You need to compile Redis. In case you don’t have Make, use yum to install it.

> yum update
> yum install gcc make

3. Compile Redis. Do an initial distclean just in case.

> make distclean
> make

4. Install Redis under the default /usr/local/bin directory.

> make install

5. Copy the Redis init.d script.

> cp utils/redis_init_script /etc/init.d/redis

6. Start Redis manually and on startup.

> service redis start
> chkconfig redis on


Redis will give out warnings on startup. Here are the commands used to get rid of these warnings.

1. Enable kernel virtual memory overcommit.

> sysctl vm.overcommit_memory=1
> vi /etc/sysctl.conf

2. Disable Transparent Huge Pages (THP).

> echo never > sys/kernel/mm/transparent_<wbr />hugepage/enabled

3. Increase system wide open files limit.

> sysctl -w fs.file-max=10032
> vi /etc/sysctl.conf

4. Increase backlogged sockets count.

> sysctl -w net.core.somaxconn=512
> vi /etc/sysctl.conf

Setup a New BitBucket User on Windows

1. Create a new SSH key. Here we call it id_rsa, which is the default, but you can give it any name you want.

ssh-keygen %HOMEPATH%/.ssh/id_rsa 

2. Use PuTTYgen to create a private PuTTY key id_rsa.ppk, from id_rsa.


3. Create a new BitBucket account.

4. Click on the Manage Account button on the top right.

Bitbucket Manage Account








5. Click on SSH keys on the left, then on the Add key button.

Bitbucket SSH Keys








6. Copy the contents of id_rsa.ppk and paste it into the Add SSH key dialog.

7. Clone the Git repo with TortoiseGit using the PuTTY key id_rsa.ppk.

Common Docker Commands

Here are some common Docker commands.

1. Search the Docker repository (like Docker Hub) for Docker images.

docker search IMAGE

2. Pull an image from the Docker repository.

docker pull IMAGE

3. Print the image change history.

docker history IMAGE

4. List all images on the host system.

docker images

5. Create and run a container. A container is an instance of an image.

docker run --name CONTAINER IMAGE

6. Create and run an interactive container.

docker run -it --name CONTAINER IMAGE

7. Create and run a container, and remove container on exit.

docker run --rm --name CONTAINER IMAGE

8. Create and run a container with a mounted volume from the host.


9. Create and run a container as a daemon.

docker run -d --name CONTAINER IMAGE

10. Attach to a running container.

docker attach CONTAINER

11. Tail the container console.

docker logs -f CONTAINER

12. Stop, start or restart a container.

docker stop CONTAINER

docker start CONTAINER
docker restart CONTAINER

13. List running containers.

docker ps

14. List all containers.

docker ps -a

15. List container ports.

docker port CONTAINER

16. Print low-level information on a container or image.

docker inspect CONTAINER|IMAGE

17. Delete a container, stop it first if running.

docker rm -f CONTAINER

18. Delete an image.

docker rmi IMAGE

19. Create a new image based on a Dockerfile.

docker build -t IMAGE

20. Commit container changes made using an interactive shell into a new image.


21. Push an image to the Docker repository.

docker push IMAGE:TAG

22. Display Docker system information.

docker info

23. Display running processes inside the container.

docker top CONTAINER

24. Display the container’s resource usage.

docker stats CONTAINER

25. Link two containers, a web application connecting to a database, using a secure tunnel.

docker run -d --name DB_CONTAINER DB_IMAGE

26. Create a new Bash session inside the container.

docker exec -it CONTAINER bash

27. Update to the latest Docker image. This will remove the old Docker container.

docker pull IMAGE
docker stop CONTAINER
docker rm CONTAINER
docker run -d --name CONTAINER IMAGE

Bonus: Install Docker on Red Hat or CentOS.

yum install docker-io; service docker start; chkconfig docker on