IP Setting on CentOS6 using Shell Script Rumi, December 6, 2015 #!/bin/bash if [ $# -eq 5 ] then echo “” echo “Taking the backup and Changing the hostname from $(hostname) to $1 …” sed -i.bk “s/$(hostname)/$1/g” /etc/sysconfig/network echo “” echo “Backing up & Assigning the Static IP …” echo “” cp /etc/sysconfig/network-scripts/ifcfg-$2 /etc/sysconfig/network-scripts/$2.bk cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$2 DEVICE=$2 BOOTPROTO=static IPADDR=$3.$4… Continue Reading
Zimbra Domain Administration (Multi-tenant) Rumi, June 4, 2015 In order to create a multi tenancy in zimbra OSA, can be acheived through a bash script below. Thanks to Ahmad Imanuddin (http://www.imanudin.com) for sharing this very useful script. cd /srv/ vi admin-delegate.sh Fill with the following line : Continue Reading
Bash Shellshock fix with scripts for Debian, Ubuntu, CentOS and other distros. including old Rumi, October 3, 2014December 19, 2014 First check if your Bash is vulnerable, execute the following command- env x='() { :;}; echo vulnerable’ bash -c ‘echo this is a test’ If your system is vulnerable, you will see: vulnerable this is a test If your system is not vulnerable, you will see: bash: warning: x: ignoring… Continue Reading
Linux service restart shell script Rumi, June 6, 2014 I badly needed a script that would check if my running services (in this script it'll check varnish and apache2 services) are alive- if not, it'll restart the dead service and write a log. Pretty handy! #!/bin/sh STARTAPACHE="/etc/init.d/apache2 start" STARTVARNISH="/etc/init.d/varnish start" Continue Reading
CRON scripts to running in seconds interval Rumi, June 6, 2014 This problem can be solved with simple bash script. For example, if you need to run a PHP script on every 20 seconds, you can create a bash script like this: #!/bin/bash #Name:myscript.sh #Desc:Run script in every 20 seconds while (sleep 20 && php /path_to_your_script/your_script_name.php) & do wait $!… Continue Reading
Ozeki PHP Plugin Rumi, June 6, 2014 <?php $gatewayURL = 'http://192.168.1.100:9333/ozeki?'; $request = 'login=sendmail'; $request .= '&password=mypassword'; $request .= '&action=sendMessage'; $request .= '&messageType=SMS:TEXT'; $request .= '&recepient='.urlencode('01711673093'); $request .= '&messageData='.urlencode("PHP Hello World"); $url = $gatewayURL . $request; //Open the URL to send the message file($url); ?> Continue Reading
Send HTTP requests using cURL Rumi, June 6, 2014 Reading a URL via GET: curl http://example.com/ Defining any HTTP method (like POST or PUT): curl http://example.com/users/1 -XPUT Sending data with a request: curl http://example.com/users -d"first_name=Bruce&last_name=Wayne" If you use -d and do not set an HTTP request method it automatically defaults to POST. Performing basic authentication: curl http://user:password@example.com/users/1 All together… Continue Reading
PHP enable error reporting Rumi, December 11, 2013 You can set PHP error reporting on in php.ini file (in case you have access to this file). Set the following lines: error_reporting = E_ALL display_errors = On If you have no access to php.ini file but you can modify .htaccess file on your server (in root of your public_hml… Continue Reading
Linux service restart shell script Rumi, November 29, 2013November 29, 2013 I badly needed a script that would check if my running services (in this script it'll check varnish and apache2 services) are alive- if not, it'll restart the dead service and write a log. Pretty handy! Continue Reading
Using the DIV tag to display columns rather than tables Rumi, November 15, 2013 The TABLE element may be a convenient way of producing stable layouts, but the W3C WAI guidelines are pretty clear that tables are for displaying tabular information, not for arranging page content. The DIV element is used as the basic layout element as it does not add any extra meaning… Continue Reading