Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

2012/07/09

#24. move a folder and compress it on-the-fly showing progress

2011/12/01

#11. Comtrend 536+ auto disable/enable wifi

I’ve got the comtrend 536+ from "telefonica", as I have it connected all day, I want to disable wi-fi at night, for some good reasons. The idea is to access to the router with my linux home server, use a script to disable it at certain hours and enable it at others. I opened access through ssh with the router web interface, with this manual you can get a brief idea of some commands, combining nmap and ifconfig in the router we can create a script to automatize this process.
In some days I’ll post the script if it works correctly for anyone to use it.

2010/11/01

#4. powershell recursive empty folder deletion script

I've been using powershell to automatize some tedious tasks done through visual interface, this is a powerful tool and I recommend everybody with some programmatic skills look into to it. The last task has been removing empty directories in hierarchy, so the deepest directory being empty will be deleted, the parent, when all children directories are deleted for being empty will be deleted if it's empty, that's the main idea.

I've taken an already posted script by Guy Ellis on his blog to delete empty folders and taken one step further, I've created a recursive function for this deletion that is being called before the check of the content of the directory.

The function  is this:



I've found some problem in the second get-childitem for some dir-names with strange character, probably can be changed to some other cmdlet to know if the current dir is empty. I will check it as soon as I can.