Shell Scripting
close

on 23rd October 2015 / by Anoop John
When you try to set up a local development environment from a drupal dump which includes just the code base and the database without the Drupal files folder you will run into the issue of missing files. Drupal would think that it still has all the files in the Drupal files folder and would create links / process images as usual. This would however lead to a lot of unexpected errors in a lot of unexpected places. If you really do not care about the content in these files and want to recreate the missing files here is how you do this. Drupal Drupal Development Shell Scripting Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 19th December 2014 / by sandeep.sasikumar
The following is the shell script that will shutdown all computers in the network. This script will be really help full for system administrators who need not want to check all systems, whether all the systems in the office has been shutdown properly when the employees leave the office. The script will check all the active ips in the network and write the those ips to a file. It also login to each system and execute the shutdown command. The things that are to be done before running the script is to 'Make sure your public-key has been added in the authorized_keys file in .ssh folder of root'. This allows the script to login to each system by the method of public-key authentication rather than prompting for password. And also the 'StrictHostKeyChecking no' will avoid all prompts during ssh. Shell Scripting Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 11th December 2014 / by sandeep.sasikumar
This is a small shell script that will help to detect ip conflicts in a network. The notify-send command, used in the script, will enable a popup if any ip conflict is detected. You can run this script in cron. You will get a notification as pop up, if there is any ip conflict in the network. Shell Scripting Bash GNU/Linux Leave a reply Your email address will not be published. Required fields are marker *
close

on 11th November 2014 / by webmaster
If you are a GNU Linux user it is very likely that you would already know about the command top that allows you to see the memory and processor usage by each process in your system. However you would see multiple processes for applications like Chromium or Firefox for each of the tabs that are open in them. Similarly you could see apache run multiple processes if you have it configured to do so. What if you want to see the total memory usage for each application and not by each process. Here is a small bash script to help you do the same. Shell Scripting GNU Linux BASH Scripting Leave a reply Your email address will not be published. Required fields are marker * Ershad (not verified) access_time 18 Jul 2019 - 21:53 for (j = 5; human_readable < 1; j--) human_readable = size_in_bytes / (2^(10*j)) division at this line fails when size_in_bytes is 0 with the following error, we could move this loop to a new else part of the succeeding if condition awk: cmd. line:9: (FILENAME=- FNR=221) fatal: division by zero attempted corrected version - https://gist.github.com/ershad/428514b68b4bdf2c570d webmaster access_time 18 Jul 2019 - 21:53 In reply to for (j = 5; human_readable < by Ershad (not verified) Thanks Ershad for the correction. Have updated the article with the corrected code. Bernardo (not verified) access_time 18 Jul 2019 - 21:53 In reply to Thanks for the correction by webmaster Did you break the script with your update? webmaster access_time 18 Jul 2019 - 21:53 In reply to Did you break the script with by Bernardo (not verified) Thanks for catching it. This has been fixed. Add new comment
more_horiz
close

on 10th August 2013 / by Anoop John
I was trying to get a list of MIDI files play in banshee 2.0 in an old computer. The system had Ubuntu 11.04 and banshee was able to play MIDI files except that it was not able to detect the end of each track and continued playing the same track with silence as the only output and infinitely playing the same track. So whenever there was a long silence I had to manually change to the next track. I did that a few times but then decided to write a small script to solve the problem. Ubuntu Utilities Free Software Shell Scripting GNU Linux BASH Scripting Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 14th May 2013 / by naveen.pl
I had a requirement where I had to execute shell command from PHP. The requirement was that I had to find details of a domain using commands like whois and then store this information into files in a folder. The only input parameter for the process was the name of the domain which was passed on from the Drupal site. The PHP function (shell_exec) was designed to do things like this. PHP Shell Scripting Leave a reply Your email address will not be published. Required fields are marker *