Youtube does not allow audio files to be uploaded. However you can easily convert an audio file into a video file using the given audio file and a fixed image as a background. The following works on Ubuntu and any variants of GNU/Linux.
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.
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.
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.
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.
Lines of code is typically indicative of effort that goes towards software development. So how do you count lines of code in your PHP application (or for that matter any specific types of files in any application). You can't manually open and count files, that would be a big waste of time.
One of the challenges with working with dynamic websites is that you have to keep fighting malicious users who regularly sap your server capacity with rogue crawling of your site. To do this you would have to monitor and analyze the traffic patterns on the server regularly.
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.
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.
Here is a script to help you find empty directories located under a specified parent-folder. The file folders.txt contains the list of folders that are to be passed as input to the script. The script will now check all the folders mentioned in the file folders.txt, and give the list of folders that are empty.
This is a script to create a particular directory under all subdirectories in a parent directory. Consider the case when a parent directory consists of more than 100 folders and you want create a new folder under all these directories, with the same name. Doing this manually would be a mess. This script would help you do this in no time.
Asianet Dataline is an ISP in Kerala and they use a web browser based authentication system to log the user onto their network. One of their most popular plans the - Homenet 475 offers free unlimited downloads from 2AM to 8AM.
Recently we had to provide support on a Red Hat Server where there were hundreds of users and the user directories organized into hierarchies. Normally we change to a users directory using cd ~username. We had some extra time on our hands and wanted to play with the /etc/passwd file and tried to use awk to do the same thing. The following one liner will do this the hard way :-)