0

Docker Common Commands: 101 Part 2

The comprehensive Docker command line reference is located here. However we will cover some basic commands. Image Build an image docker build -rm=true . Install an image docker pull ${IMAGE} List of installed images docker images docker images –tree (tree view) docker images -no-trunc (detailed listing) Remove an image docker rmi ${IMAGE_ID} Remove all untagged images docker rmi $(docker images | grep “^” awk ‘{ print $3 }’) Remove all images docker rm $(docker ps -aq) Container Run a container docker run (many other options on this) List containers docker ps docker ps -a (list all containers) Stop a container… Continue Reading

0

Docker on CentOS/RHEL7 101 Part 1

My journey with Docker. Installing Docker on CentOS/RHEL7 $ sudo yum install docker $ sudo systemctl start docker $ sudo systemctl enable docker NOTE: if you are using firewalld make sure that firewalld is started before Docker. Also if firewalld is restarted please make sure to restart Docker afterwards. Now that Docker is installed lets pull a image and play with it a bit. $ sudo docker pull centos # pulls the latest centos7 container Trying to pull repository docker.io/centos … fd44297e2ddb: Download complete 6941bfcbbfca: Download complete 41459f052977: Download complete Status: Image is up to date for docker.io/centos:latest $ sudo… Continue Reading

0

shrink sparse qcow2 file

When a vm’s been running for a while the sparse file will get bigger and bigger. If a cleanup has been done and the space usage is back down to minimal the sparse file will remain the largest size it was before. you can shrink the sparse file back down to minimal space usage by issuing the following. Please note that VM should be off during this. mv myqcow2file.qcow2 myqcow2file.qcow2.bak qemu-img convert -O qcow2 myqcow2file.qcow2.bak myqcow2file.qcow2 start up the VM and everything should be back to normal and the space of the sparse qcow2 file should be much less.

3

Running the latest kernel CentOS7

I decided to start using the ML kernel for my kvm host for performance gains on my kvm guests. You can easily install the ML or the LT kernels easily on CentOS7 using the ELrepo. kernel-MT – mainline stable kernel kernel-LT – long term support kernel Steps: rpm –import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm yum remove kernel-headers kernel-tools kernel-tools-libs edit /etc/yum.repos.d/elrepo.repo and enable=1 the elrepo-kernel. change the ml to lt to install the long term support kernel. yum install kernel-ml.x86_64 kernel-ml-devel.x86_64 kernel-ml-headers.x86_64 kernel-ml-tools.x86_64 kernel-ml-tools-libs.x86_64 kernel-ml-tools-libs-devel.x86_64 time to get grub settled awk -F’ ‘$1==”menuentry ” {print $2}’ /etc/grub2.cfg it should list all… Continue Reading

0

Reset root password on RHEL/CentOS 7

much have changed since 4/5/6 days since RHEL/CentOS7 uses grub2 to boot. root password recovery is now very different than before. start/reboot the system and on the GRUB2 boot screen press the e key for edit. scroll down to the linux* line (could be linux/linux16/linuxefi) and remove rhgb and quiet and add init=/bin/sh to the end of the line. For some virtual hosts you might have to use rb.break instead of init=/bin/sh. Press CTRL-X to boot the system and it a shell prompt will be presented. Once booted the / filesystem will be in read only mode please issue mount… Continue Reading

1

ReadyMedia(miniDLNA) on CentOS7

I decided that I need a DLNA server on my network so that I can stream to my tablets/phones/smartTV’s with ease. I already have media PC’s at every TV however I wanted to test out the smart TV features on my TV. Unfortunately there are no known pre-builds of any light weight DLNA servers for CentOS7. I selected miniDLNA which is now called ReadyMedia. miniDLNA is a light weight DLNA compliant server and best of all it comes pre-compiled as a static binary which does not need anything else to run. Current version of miniDLNA at the time of writing… Continue Reading

3

removing ad’s from your home network with dd-wrt

A bit tired of too many ad’s poping up on various sites especially those links from facebook etc.. so I’ve combined multiple sources to block ad’s using my dd-wrt router. Place the following into Administration->Commands and save as startup rm /tmp/hosts mkdir /tmp/abc wget -qO /tmp/abc/addhosts http://szojox.ugu.pl/hosts wget -qO /tmp/abc/jansal http://jansal.googlecode.com/svn/trunk/adblock/hosts wget -qO /tmp/abc/malwaredomain http://www.malwaredomainlist.com/hostslist/hosts.txt wget -qO /tmp/abc/winhelp2002 http://winhelp2002.mvps.org/hosts.txt wget -qO /tmp/abc/adaway https://adaway.org/hosts.txt wget -qO /tmp/abc/ad_servers http://hosts-file.net/.%5Cad_servers.txt wget -qO /tmp/abc/gjtech http://adblock.gjtech.net/?format=unix-hosts wget -qO /tmp/abc/someone http://someonewhocares.org/hosts/hosts cat /tmp/abc/addhosts /tmp/abc/jansal /tmp/abc/malwaredomain/tmp/abc/winhelp2002 /tmp/abc/adaway /tmp/abc/ad_servers /tmp/abc/gjtech /tmp/abc/someone | sed -e ‘s/^[ t]*//’ | grep -v ^# | sort | uniq > /tmp/hosts rm -rf… Continue Reading

0

Colourful ! systemd vs sysVinit Linux Cheatsheet

systemd is the new init system, started with Fedora and now started adopted in many distributions like redhat, suse and centos. This long period we all been using traditional SysV init scripts usually residing in /etc/rc.d/init.d/ directory. These scripts invokes daemon binary which will then forks a background process. Even though shell scripts very are flexible buts other tasks like supervising processes and parallized execution ordering will be very hard to implement. With the introduction of systemd new-style daemons which makes easier to supervise and control them at runtime and simplifies their implementation. systemctl command is a very good initiative… Continue Reading

0

mount qcow2 with libguestfs

sometimes you have multiple qcow2 files sitting around from older upgrades and OS’s that you just need to grab a file or a config from and dont want to bother with booting it up. there is a way to mount the filesystem using libguestfs which can save time! This works with LVM and non LVM qcow2 files and also even if you dont know how the qcow2 partitions are laid out you can feed it a bogus partition and it will list it for you. # guestmount -a rhel5.qcow2 -m /dev/sdzz1 /mnt libguestfs: error: mount_options: mount_options_stub: /dev/sdzz1: No such file… Continue Reading