Author: Surendra Anne

Docker: How to start exited container

This is a small post on how to start an exited docker container. If you are in IT space for a couple of years, you will know how Docker disrupted IT. Docker just changed many things and simplified many people’s work. In this post, we will see how to start an exited docker container. If you are working on Docker containers, you may see some of your containers are excited. If you want to know how to start them, then this post is for you. List all exited docker containers Docker provide’s docker subcommands, one of that is ps. The ps command will show running containers(processes). To see only containers which are exited(killed) use below command. docker ps -f "status=exited" Output: [5666] sanne@Surendras-MacBook-Pro:~ > docker ps -f "status=exited" CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS                    PORTS               NAMES 6ac657c2e560        f6f26c66be5e                 "/bin/bash"              6 days ago          Exited (0) 2 days ago                         friendly_minsky 761978f8ed0f       ...

Read More

Linux/Unix: How to convert a video file to GIF file

The Linux OS can do many things for you at no cost. Only thing is you should know what tool(an open source tool?) you should use. Creating gif files from a video file is not an exception for this. When I tried to explain about watch command which requires some video for that. But I felt youtube is blocked in most of the IT companies. So I came with a plan to convert the video file to a GIF image so that I can bypass firewalls. This post is all about it on how I achieved it. Install ImageMagick and other tools in Linux ubuntu Image magic will not work out of the box; we have to install Mplayer and gtk-recordmydesktop for that. apt-get install imagemagick mplayer gtk-recordmydesktop Output: root@linuxnix:/home/surendra/Signed_Doc# apt-get install imagemagick mplayer gtk-recordmydesktop Reading package lists... Done Building dependency tree Reading state information... Done gtk-recordmydesktop is already the newest version (0.3.8-4.1ubuntu1). mplayer is already the newest version (2:1.2.1-1ubuntu1). The following packages were automatically installed and are no longer required: calibre-bin fonts-mathjax libbonoboui2-0 libbonoboui2-common libchm1 libclass-data-inheritable-perl libclass-method-modifiers-perl The following NEW packages will be installed: imagemagick The following packages will be upgraded: imagemagick-6.q16 1 upgraded, 1 newly installed, 0 to remove and 110 not upgraded. Need to get 432 kB of archives. After this operation, 151 kB of additional disk space will be used. Do you want to continue? [Y/n] y...

Read More

10 strace command examples in Linux/Unix

The strace command is useful for debugging any command or a script. Thachievedheived by using a concept called command on command. The strace command has some other sister commands like ps, pstree, lsof etc. What is Linux strace command do? The primary purpose of the strace command is to show system calls which are created by the kernel when working with some process. Say suppose you write a program and want to see how it interacts with the system when it is executed, strace is your friend. The strace command is just a light debugger for your programs and command. In below example, we tried to run the pwd command and showed you what steps will be taken place. Syntax of strace command strace <command> Example: root@linuxnix:~# strace pwd execve("/bin/pwd", ["pwd"], [/* 73 vars */]) = 0 brk(NULL) = 0x148c000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5f89746000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=162567, ...}) = 0 mmap(NULL, 162567, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5f8971e000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\t\2\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1868984, ...}) = 0 mmap(NULL, 3971488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5f89159000 mprotect(0x7f5f89319000, 2097152, PROT_NONE) = 0 mmap(0x7f5f89519000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7f5f89519000...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.