speedtest cli

To test your speed you can use speetest-cli. Here is the description:

Command line interface for testing internet bandwidth using speedtest.net

and to install and test:

sudo yum install speedtest-cli

#Run
speedtest-cli

The output is like below:

speetest-cli

speedtest-cli

shell script for some quick tests on Linux

Head over to the link and grab the script. Just run it and make yourself a little bit more safe :)

https://github.com/rebootuser/LinEnum

colorize your logs

CCZE is a robust and modular log colorizer with plugins for apm, exim, fetchmail, httpd, postfix, procmail, squid, syslog, ulogd, vsftpd, xferlog, and more.

For installation

sudo yum install ccze

and to use it:

tail -f -n 50 /var/log/firewalld | ccze
#or better yet
cat  /var/log/firewalld | ccze|more

apache in docker to serve local website

I have some backup’s of website on my laptop, which I occasionally want to view. Now, I could have setup apache to serve them directly with VirtualHost or alias but wanted a better solution. So, docker comes to rescue.

First, I installed fedora-dockerfiles and then made some modifications, here they are :

sudo yum install fedora-dockerfiles

After this is done, go to /usr/share/fedora-dockerfiles/apache and make some modification to Dockerfile.  After the modifications, the file looks like this

FROM fedora
MAINTAINER “Scott Collier” <scollier@redhat.com>

RUN yum -y update; yum clean all
RUN yum -y install httpd; yum clean all
RUN echo “Apache” >> /var/www/html/index.html

EXPOSE 80

# Simple startup script to avoid some issues observed with container restart
ADD run-apache.sh /run-apache.sh
ADD php.conf /etc/httpd/conf.d/php.conf
RUN chmod -v +x /run-apache.sh
RUN yum -y install php

CMD [“/run-apache.sh”]

 

Now copy the php.conf file to current directory.

sudo cp /etc/httpd/conf.d/php.conf .

#Build the docker image
docker build --rm -t apache .

#and then quickly test the image like this -
docker run -t -i --rm -p 80:80 apache

#open the site in firefox
firefox -new-tab http://loccalhost

Once you see that the docker is running fine, time to create a script to do this in your desired directory.
I always have “~/bin” in $PATH, so I created ~/bin/docker.sh file with the following contents:

#!/bin/bash -
#===============================================================================
#
#          FILE: docker_firefox.sh
#
#         USAGE: ./docker_firefox.sh
#
#   DESCRIPTION:
#
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka)
#      REVISION:  ---
#===============================================================================

dir="your/desired/directory/with/content/for/website"
echo "Run Ubu website:::"
CID=$(docker run  -d -p 80:80  -v $dir:/var/www/html:ro apache)
echo docker CID is $CID
firefox -new-tab http://localhost/index.php

After this time to test:

Just run this script and you should have the contents of current directory in your browser.

Nice discussion on Control Panel ( free ) for VPS.

http://xmodulo.com/free-control-panel-for-vps.html

 

Enjoy the discussion and information if you are looking for free control panel for VPS or some other host.

repotrack and repoquery -commands to resolve dependencies.

To get all the depencies of a package, you can try:

repoquery -a --requires --resolve 

Example output:
glibc-0:2.20-5.fc21.i686
bash-0:4.3.30-2.fc21.x86_64
chkconfig-0:1.3.63-1.fc21.x86_64
glibc-0:2.20-5.fc21.x86_64
openssl-libs-1:1.0.1j-1.fc21.x86_64

and then to query in nice tree format, you can use :

 repoquery -a --tree-requires PACKAGE_NAME

And finally use that with repotrack:

repotrack -a x86_64 -p . $(repoquery --qf=%{name} -g --list --grouppkgs=all 'Office Suite and Productivity' |tr '\n' ' '
)

Now for the fun part, why use all the above when you can simply use:
yumdownloader --resolve 

So, if you have reached this line then you don't need repotrack/repoquery, simply use yumdownloader :)

PHP Image gallery with fancybox.

So, I was looking for some quick to setup PHP Image gallery file. I found couple but none of them suited my needs too well. So I had to write my own.

Very simple PHP script to show all the images under ‘images’ folder.

Shows some details in the images.

 

That is all that I wanted and that is all that this script does. So pretty simple single php file. Dependency is on fancybox so you will need the jquery and all but nothing else is required.

https://github.com/raj77in/PHP-ImagaeGallery.git