Linux Blog

Cleaning Up Files & Directories

Filed under: Shell Script Sundays — TheLinuxBlog.com at 8:30 am on Sunday, August 19, 2012

While not really a shell script as such, this is shell related and  it just so happens to be Sunday.

Find Empty Directories:

find . -type d -empty > empty_folders.txt

Find Empty Files

find . -type f -empty > empty_files.txt

The issue with these two commands is that within my jumble of unorganized mess I have an abundance of version control repositories (mostly SVN) and tons of source code with empty, but needed directories. Fear not if you have the same problem, you can filter them out by using:

grep -v empty_files.txt svn

Duplicate File Removal

There are multiple ways to remove duplicate files. I used to think a  recursive md5sum script was the way to go but that was before I found the utility fdupes.
Install via your package manager if it’s available and use recursively like:

fdupes -r [directory] > duplicates.txt

With fdupes you also have the ability to symlink or delete files, although because of the amount of source code, I’d rather review it manually.


With these utilities I was able to merge copies of photos remove a bunch of old files and empty directories and am one step closer to being digitally organized. If you have the same problem, hopefully they will help you too. If you have any cleanup or organization tools, please comment and let me know.

PulseCaster

Filed under: Linux Software — TheLinuxBlog.com at 6:30 am on Wednesday, January 26, 2011

pulsecasterI stumbled upon PulseCaster while searching through Fedoras repositories, I was intrigued and had to give it a try. By the website this is the description:
“PulseCaster is a simple PulseAudio-based tool for making podcast interviews. It is designed for ease of use and simplicity. The user makes a call with a preferred PulseAudio-compatible Voice-over-IP (VoIP) softphone application such as Ekiga or Twinkle, and then starts PulseCaster to record the conversation to a multimedia file. The resulting file can be published as a podcast or distributed in other ways.”
It works really well for phone interviews or just recording that call you want to remember. I wouldn’t advise recording conversations without the other parties permission. I don’t know what the law is on that, but if you’re using it for its intended purpose (podcasting) then it serves its purpose. I actually used it to record the Asterisk Area Code Lookup Script.

Remotely Changing Windows Volume

Filed under: Shell Script Sundays — TheLinuxBlog.com at 2:41 pm on Sunday, October 18, 2009

This is not really “shell scripting” but the end result is some more bash scripts in my bin directory so what the hell? It’s going in the shell script section because its Sunday. So what?

I like to listen to music on my Windows box while I work on my Linux box. Online radio and other sounds, just get in the way too much. One of the things I wanted to do for a while was remotely control my volume so I didn’t have to use my KVM to switch over to change the volume when ever anyone came in my office.

Its actually pretty easy to control your windows volume from Linux.

At first I thought, I’d create a dummy audio device, and some how map it over. Then I figured that was overkill and I’d try something a bit easier. I have SSH via Cygwin, so all I needed was a way to control the volume locally, and I could execute the command with SSH. Having no volume utilities jump at me when I looked through the Cygwin repositories I went to look for something else.

NirCmd is an awesome utility, giving me and other Windows users the ability to do things that Linux users may take for granted, you can read about it here: http://www.nirsoft.net/utils/nircmd.html after installing it, and making sure that my corporate AV didn’t throw a hissy, it was just a matter of dumping some scripts in my bin directory and chmodding them so they would run.

Here is what they look like:

Volume Down Script: ssh windowsbox -l owen -C “nir changesysvolume -2000″

Volume Up Script: ssh windowsbox -l owen -C “nir changesysvolume 2000″

Mute: ssh windowsbox -l owen -C “nir mutesysvolume 1″

Unmute: ssh windowsbox -l owen -c “nir mutesysvolume 0″

Real simple, and the mute/unmute really comes in handy for when some one walks into my office.

Throw a rave when you work too hard

Filed under: Linux Software — TheLinuxBlog.com at 7:36 pm on Wednesday, December 3, 2008

Workrave

Workrave is an awesome little utility that I just found out about almost a week ago now. Basically what it does is sits in your tray and bugs you when you should take breaks. Its really simple to use, and is in the Fedora repositories. Since, my Open SUSE laptop is at home and off, I can’t tell you if it is in there but my guess is that Debian / Ubuntu also have this package. Once you’ve got it installed by whatever means possible, run it. Its very easy to use, but I would advise setting up your defaults. If you don’t you’ll be taking a short rest break once every 3 minutes, which I find to be a bit excessive. You also get rest breaks, which advise you to stand up and walk around, and do stretches. It has some great statistics such as how many keystrokes you make, how many breaks you’ve taken. It also accounts for “natural” rest breaks, so if there is no activity on your computer, it thinks you are idle. Although I have not tried it there is network support for Workrave. Perhaps one day I will try it. If you spend a long time in front of the computer at home or work (like I’m doing today) then this may be the application for you, especially if you are trying to avoid doing work. getting fatigued. Talking of work, I had better get back to what I was doing; oh yea, taking a break.

Recent Software Updates.

Filed under: The Linux Blog News — TheLinuxBlog.com at 8:53 am on Monday, September 8, 2008

The 2.6.26.4 Kernel was released at 11:47UTC with a lot of fixes. Notably the eeepc-laptop module got a fix that should stop it from failing to unload if anyone has an eeepc and had that problem. There were 40 unique commits to this update and I think that everyone involved should be thanked for their hard work.

A new Wine was released on Friday the 5th putting Wine on version 1.1.4, so those of you that use Wine may want to update to see if your apps run better. They’ve fixed a lot of applications and reimplemented parts of WinHTTP. Unless you’ve been under a rock, you’ll know about Google Chrome, and this Wine version includes several fixes to better support this. I might do a writeup of getting Google Chrome to work under Linux.

In security its just about the usual, SQL injections and XSS holes everywhere. Tomcat has some information disclosures that if your running the newest versions will not affect you.

Wireshark has some denial of service attacks and possibly arbitrary code execution, but only the DOS attacks have been confirmed. Your distribution probably has an older version in its repositories so, unless your running 1.0.3 which was released on September 3rd, you may want to update if your mission relies on this.

If you run postfix and notice your mail servers load is unusually high, look out for a denial of service against that also.

This ones an oldie but a good one: Get Pwnd by your Coffee machine of course its just one coffee machine, but as we see more household appliances being connected to the web. Which might get you thinking about Linux on Household Appliances.

Are You Funding Open Source?

Filed under: General Linux — TheLinuxBlog.com at 8:24 am on Friday, August 29, 2008

I was using a piece of software that I had heard about a while back that manages collections. Its called Tellico and is actually quite good. While using Tellico I discovered that when you click on the “Amazon link” for the product, it has an affiliate code in it.

For those of you who don’t know what an affiliate program is, its basically a way for people to make money just by refering people to products. Most of the big guys have these sorts of “programs” including Amazon. Affiliate programs are very popular in the triple X industry.

What frustrates me is that this is included in Tellico, so in effect when you visit a product from your own personal collection, Tellico gets a percentage of sales from Amazon for any other items you purchase. While the affiliate link doesn’t bother me so much as it can be changed (and I also participate in the program), its the fact that it came right out of the Fedora repositories like this.

What about if Ubuntu reworked its software and included affiliate links for everything? Perhaps a FireFox plugin that manipulated all Amazon requests to include Mandriva’s affiliate link. I think that this is against Amazons terms of service but this method is a potential way for open source developers and organizations to get some additional funding. But is it right? Preying on your end users ignorance for profit? Although it doesn’t harm anything is it moral?

Post Source: http://www.TheLinuxBlog.com

Yakuake – The Nifty Terminal

Filed under: General Linux,Linux Software — TheLinuxBlog.com at 12:47 pm on Friday, July 25, 2008

Yakuake – “Pronunciation Key: yuh-kweyk”

Yakuake is a terminal emulator for KDE
“Why do we need another terminal emulator?”
I hear you ask.

Well, the Yakuake terminal emulator resembles the terminal from Quake (hence the name), except the only thing that gets owned when you run Yakuake is your to-do list.

Have you ever been fragged in Quake because you hit the Tilda key by accident?
Ever used this to your advantage while playing two player by pressing your opponents tilda key?

Have no idea what I’m talking about?
envision a terminal that magically pops up when you press a shortcut, hides when your not using it but retains the output / processes and does not show up in the task bar.

Sure there are old school ways of achieving the same thing, but Yakuake is convenient. It is based on Kommander so its highly configurable and customizable but it works right out of the package.

I use it on most of my machines and for quick tasks I find myself using a regular xterm less. If you want a quick easy access to a terminal I’d recommend trying Yakuake out, take a look at all of the keyboard shortcuts and see if there is any way you can make it work better for you.

I have my keyboard shortcuts set up so I can add new sessions, close sessions, rename sessions, move sessions and resize the terminal. It works great with the switch to session shortcuts that I also set up.

Its in the Fedora repositories, I’m sure its included in Debians 18,000 or so packages and probably Gentoo’s too, so give it a shot!

I’ll see what I can do about a video tutorial in the future to demonstrate the power of Yakuake.