Script to Rename Files in UNIX / Linux

This is a simple script that will rename files. Takes an absolute path as input, and looks for files with a specific string in its name. Will not traverse up the specified path. It will keep a log of the last run in the script’s directory.

I have more than 500 files that need to be renamed, but I am too lazy to do it manually, so I wrote this script to do it for me. All of the files follow two specific patterns in the name as indicated below.
Continue reading

Share

Keyboard Backlight Not Working in Linux (Fedora 18 Spherical Cow/Fedora 19 Schrödinger’s Cat) – ASUS N56V

Backlit keyboards are pretty usual these days, beside being cool looking, they are very useful at night. When I first installed Fedora 18 ‘Spherical Cow’ in my new ASUS N56V, the keyboard backlight was working perfectly. After updating to (I believe) kernel version 3.8.x the keyboard backlight stopped working, bummer. I did my research and was able to find the solution for this problem.

Continue reading

Share

ASUS N56VJ Subwoofer in Linux

So I bought an ASUS N56VJ to install linux on it, and as expected, not everything worked right out of the box with Linux. This laptop in particular comes with premium audio which includes a small subwoofer, (great for watching movies) and to my disappointment, it was not working with Linux. Had to make some configuration changes to make it work.

Continue reading

Share

Righteous Living – From Joseph’s Life

From the life of Joseph, we can see that he was a righteous young man, well rooted in his beliefs at 17 years of age, when he was sold into slavery by his own brothers. (Genesis 37) Later on in Genesis 39, Joseph finds himself serving under Potiphar’s command, an officer of Pharaoh. It was here when Potiphar’s wife tempted Joseph to perform a wicked act, Joseph responded “How then can I do this great wickedness, and sin against God?” (Genesis 39:9) and in verse 12 “he left his garment in her hand, and fled, and got him out”.

Continue reading

Share

What is your life’s vision?

When there is no specific vision, man lives to please himself. When there is a God given vision, every decision of one’s life should be to fulfill that vision. Take Nehemiah’s life, his God given vision was to rebuild Jerusalem’s walls and every decision was taken with that vision in mind. Ultimately man’s goal should be to serve God.

Continue reading

Share

IntelliSense in Eclipse

By setting up some preferences in Eclipse, we can achieve an IntelliSense-like behavior in Eclipse. If you have ever used Microsoft Visual Studio, then let me explain what IntelliSense is. IntelliSense can speed up your coding by auto-completing your words as you type, lets say you have aVeryLongVariable in your code, as soon as you start typing aV, a box will pop-up with the suggestions for auto-completion, you can either continue typing or just press enter and your variable will be auto-completed.
Continue reading

Share

Cleaning Up GNU GRUB – Removing Old Kernels

I had Fedora 17 installed and decided to upgrade to Fedora 18, upon upgrading I noticed in GRUB menu options Fedora 17 was still listed. As a good and organized computer user, I started looking and asking how to clean this messy looking GRUB and found the solution.

Update: Now I know these are the old kernels. When you update to latest Linux kernel, the previous one stays there and you could boot from it if you wanted to. This way you could test the new kernel and later delete the previous one with the below command.

This is how my GRUB menu looked like after the upgrade:

grub_blog
Continue reading

Share

Wait For Trigger File – Unix Shell Snippet

So recently I was doing doing some bash scripting and required a functionality that would allow my script to wait for for a trigger file in order to execute. After some thinking, I was able to some up with a function to perform the required action.

Basically, how this works is that a function will be looping constantly looking in a specific directory for a specific file to arrive, the function will loop ‘n’ times looking for that specific trigger file, sleeping ‘n’ seconds in between tries. Once found, it fires off the next portion of the script (or a separate script). If the file is not found in ‘n’ times, then will exit with an exit code of 1. You can also set it so it will keep looking for the trigger file indefinitely.

This snippet will also send an email if the trigger file is not found in ‘n’ times.

Code after the jump.
Continue reading

Share