Entries by smrutiblog

install ruby on centos 7

# yum install gcc-c++ patch readline readline-devel zlib zlib-devel # yum install libyaml-devel libffi-devel openssl-devel make # yum install bzip2 autoconf automake libtool bison iconv-devel sqlite-devel # curl -sSL https://rvm.io/mpapis.asc | gpg –import – # curl -L get.rvm.io | bash -s stable # source /etc/profile.d/rvm.sh # rvm reload # rvm requirements run rvm install 2.4.0 […]

install mongodb on ubuntu 14.04

#Step 1: Import the MongoDB public key sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv 7F0CEB10 #Step 2: Generate a file with the MongoDB repository url echo ‘deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen’ | sudo tee /etc/apt/sources.list.d/mongodb.list #Step 3: Refresh the local database with the packages sudo apt-get update #Step 4: Install the last stable MongoDB version and all […]

install angular drywall mean stack

Requirements Have these packages installed and running on your system. Node.js, and npm. MongoDB SASS Grunt-cli Bower We use bcrypt for hashing secrets. If you have issues during installation related to bcrypt then refer to this wiki page. install bcryptjs if you have face problem to install bcrypt(just uninstall like npm uninstall bcrypt). run npm install […]

shell script to create thumbnail

create sh file from shell(via putty) by following command sudo nano create_image_thumb.sh ======================================================== #!/bin/bash THUMBS_FOLDER=/home/path/public_html/images_thumb for file in /home/path/public_html/images/* do if [ -f “${THUMBS_FOLDER}/$(basename “$file”)” ] then echo “found.” else echo “${THUMBS_FOLDER}/$(basename “$file”) not found.” convert “$file” -resize 250×215^ “${THUMBS_FOLDER}/$(basename “$file”)” fi done ============================================================== press ctrl +x and press y to save you can used […]

reset password of vultr server debian 7

login into console from vultr console panel restart the server, while server start booting stop it by press esc key You will see a GRUB boot prompt – press “e” to edit the first boot option. Find the kernel line (starts with “linux /boot/”) and add init=”/bin/bash” at the end of the line Press CTRL-X […]

Protect Your Server Against the Dirty COW Linux Vulnerability

Check Vulnerability Ubuntu/Debian To find out if your server is affected, check your kernel version. uname -rv If your version is earlier than the following, you are affected: 4.8.0-26.28 for Ubuntu 16.10 4.4.0-45.66 for Ubuntu 16.04 LTS 3.13.0-100.147 for Ubuntu 14.04 LTS 3.2.0-113.155 for Ubuntu 12.04 LTS 3.16.36-1+deb8u2 for Debian 8 3.2.82-1 for Debian 7 […]

start apache2,mysql,nginx from shell script root crontab on ubuntu

in case Debian 3.2.68 distribution . all syntax will be working fine as per my live test. cd /usr/local/vesta/bin sudo nano apache-restart.sh type following.. =========================================================================.. #!/bin/sh ps auxw | grep apache2 | grep -v grep > /dev/null if [ $? != 0 ] then service apache2 start > /dev/null fi ====================================================================================== save it as apache-restart.sh […]

mysql restart from cron using shell script

check crontab -u root -l – list of cron for user root cd /home/smruti/ sudo nano mysql-check.sh ========================================================== #!/bin/bash /usr/bin/mysqladmin ping| grep ‘mysqld is alive’ > /dev/null 2>&1 if [ $? != 0 ] then sudo service mysqld restart fi ====================================== save as mysql-check.sh To make it executable chmod 0755 mysql-check.sh create cron job crontab […]

iframe youtube video responsive with css

just add this below div along with class video-container format like… <div class=”video-container”><iframe…….></iframe></div> then put the below css in your site header .video-container { position:relative; padding-bottom:56.25%; padding-top:30px; height:0; overflow:hidden; } .video-container iframe, .video-container object, .video-container embed { position:absolute; top:0; left:0; width:100%; height:100%; }