Category: unix
-
Python – Headless Selenium Performance Tests with Google Chrome, Browsermob-Proxy and Xvfb
# -*- coding: utf-8 -*- “”” # Install xvfb sudo apt-get install -y xvfb # create build directory mkdir -p ~/build/selenium cd ~/build/selenium # Install API for browsermob-proxy and selenium sudo pip install selenium browsermob-proxy –upgrade # download browsermob proxy wget https://github.com/downloads/webmetrics/browsermob-proxy/browsermob-proxy-2.0-beta-6-bin.zip unzip browsermob-proxy-2.0-beta-6-bin.zip # copy browsermob-proxy to /var/lib sudo cp -r browsermob-proxy /var/lib/ sudo…
-
Python – Testing Selenium with Google Chrome
# use a custom directory for download and installation mkdir -p ~/build/selenium cd ~/build/selenium # Install Google Chrome wget -q -O- https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add – sudo sh -c ‘echo “deb http://dl.google.com/linux/chrome/deb/ stable main” > /etc/apt/sources.list.d/google.list’ sudo apt-get update sudo apt-get install -y google-chrome-stable # Download Selenium wget http://selenium-release.storage.googleapis.com/2.41/selenium-server-standalone-2.41.0.jar # Download Chrome Driver Selenium…
-
Ubuntu – Resolving Package Problems
One of the many ways to resolve package issues in ubuntu 🙂 sudo apt-get -f install sudo apt-get update # to update your package list. sudo apt-get autoclean # to clean up any partial packages. sudo apt-get clean # to clean up the apt cache. sudo apt-get autoremove # will clean up any unneeded dependencies.…
-
monit – FTP checks
check host ftp.redhat.com with address ftp.redhat.com if failed icmp type echo with timeout 15 seconds then alert if failed port 21 protocol ftp then exec “/usr/X11R6/bin/xmessage -display :0 ftp connection failed” alert foo@bar.com References 1. https://mmonit.com/monit/documentation/monit.html
-
monit – URL, HTTP and Elasticsearch checks
1. Simple URL Check check host elastic_health_check with address 0.0.0.0 if failed url http://0.0.0.0:9200/_cluster/health for 2 cycles then alert 2. URL with Basic Authentification # http://stackoverflow.com/questions/1115816/monit-and-apache-site-behind-http-basic-auth # It seems to be possible to include the credentials in the URL, have you tried this?: # (from http://mmonit.com/monit/documentation/monit.html#connection_testing ) # If a username and password is included…
-
Unix – Permanent SSH Tunnel – The easy way 🙂
OK, this is a dead easy instruction of setting up a permanent ssh tunnel through cron This establishes port forwarding to a remote server. Command crontab -e nc -z localhost || ssh @ -N -L :: & Example * * * * * nc -z localhost 15432 || ssh a@big-bad-server.net -N -L 15432:10.0.80.1:5432 -L 25432:10.0.80.2:5432…
-
Ubuntu – XnView – Installation – image viewer
XnView is a great image viewer popular under Windows and now available in Ubuntu 🙂 mkdir -p ~/build/xnview cd ~/build/xnview wget http://download.xnview.com/XnViewMP-linux-x64.deb sudo dpkg -i XnViewMP-linux-x64.deb sudo apt-get install -f References 1. XnView Home 2. http://download.xnview.com/
-
Ubuntu – Linux Process Explorer – GUI – Installation
A process monitoring tool which looks like Sysinternals Process Explorer # download directory mkdir -p ~/build/process-explorer cd ~/build/process-explorer # download wget http://optimate.dl.sourceforge.net/project/procexp/bin_v1/procexp_1.5.275-0ubuntu1_all.deb # install dependancies sudo apt-get install -y python-configobj # install process explorer sudo dpkg -i procexp_1.5.275-0ubuntu1_all.deb # start sudo /bin/sh /usr/bin/procexp.sh # => more errors, doesn’t work # => aaargh, i give up!…
-
Ubuntu – Installation of Great Little Radio Player
# install dependencies – gstreamer sudo add-apt-repository -y ppa:gstreamer-developers/ppa sudo apt-get update sudo apt-get install -y gstreamer1.0* sudo apt-get install -y libgstreamer* #sudo apt-get install -y libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev # download #wget http://downloads.sourceforge.net/project/glrp/v1.4.4/greatlittleradioplayer_1.4.4_i386.deb wget http://downloads.sourceforge.net/project/glrp/v1.4.4/greatlittleradioplayer_1.4.4_amd64.deb # install sudo dpkg -i greatlittleradioplayer_1.4.4_amd64.deb # start greatlittleradioplayer References 1. http://linuxg.net/how-to-install-great-little-radio-player-1-4-4-on-ubuntu-linux-mint-debian-and-derivates/ 2. http://ubuntuguide.org/wiki/Ubuntu_Precise_Media_Players 2. http://superuser.com/questions/124943/how-can-i-resolve-gstreamer-dependencies-in-ubuntu
-
Ubuntu – 64 bits or 32 bits – Determine the Computer Architecture using bash in the terminal
Using a bash function to determine the CPU architecture: amd64 or i386, x86_64 or i386 function os_cpu_bits() { if uname -a | grep “x86_64” 1> /dev/null then echo “amd64” elif uname -a | grep “i386” 1> /dev/null then echo “i386” else echo “unknown” fi } architecture=$(os_cpu_bits) echo “$architecture” # amd64 References 1. http://askubuntu.com/questions/41332/how-do-i-check-if-i-have-a-32-bit-or-a-64-bit-os 2. http://www.linuxjournal.com/content/return-values-bash-functions