Quick and dirty log file cleanup with python

I have a problem, my co-workers like to make tons of different log files for their web services and they don’t like to clean them up! Ok, so maybe I’m to blame too, but I hate that day every few months where my log partition fills up and I have to clean up after us. So I cobbled together a small script to solve this problem once and for all (or at least until we all agree on how to solve this problem).

I’ve wanted to write something in python for a good lone while now. I just was never in a position to give the language a try. So I decided this was a perfect opportunity to give it a try. I used this example and a few other websites to get started. Overall I really enjoy writing python and I hope to find a way to use more of it in my day to day tasks.
Read the rest of this entry »

Chrome URL Expander name change.

Chrome URL Expander is dead! Long live Tactical URL Expander. I changed the name to meet google naming guidelines. Other changes in this release is a new backend for expansion and general code cleanup.

The source code can be found at here.

Disable that annoying OSX dashboard.

I finally got around to figuring out how to disalbe the OSX dashboard. It was actually very simple and can be done from the terminal. I wrote a quick applescript to enable and disable the dashboard in case anyone would like to use that. It is very simple and you can just run the shell commands by hand if you wanted to. This is old news in the OSX world, but useful none the less.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
set question to display dialog "Do you wish to start or stop the dashboard?" buttons {"Start", "Stop"} default button 1
set answer to button returned of question
 
if answer is equal to "Start" then
	do shell script "defaults write com.apple.dashboard mcx-disabled -boolean NO"
	do shell script "killall Dock"
	display alert "Dashboard has been started"
end if
 
if answer is equal to "Stop" then
	do shell script "defaults write com.apple.dashboard mcx-disabled -boolean YES"
	do shell script "killall Dock"
	display alert "Dashboard has been stopped"
end if

Nginx-manager: A tool for managing Nginx on Ubuntu/Debian Linux.

Last week we setup Nginx as a reverse proxy/load balancing/ssl endpoint. As with all of our projects, we selected Ubuntu Linux. We put this in place to replace a older server running pound. We wanted more web server features, and Nginx fit the bill perfectly. So far the server has been an overwhelming success.

Just like Ubuntu/Debian does with Apache, they chose to setup Nginx with a “sites-avaliable” and “sites-enabled” folders for enabling and disabling vhosts. However unlike Apache, there seems to be no tools to make enabling and disabling a quick single command. So we are forced to make and delete the links from the “sites-available” folder to the “sites-enabled” folder and then reload the Nginx service.

I really liked the concept of having a tool to enable and disable sites (vhosts) for me, so I took the liberty of quickly writing up a tool that does just that.
Read the rest of this entry »

Chrome URL Expander 1.5.4 released!

Just a quick update to Chrome URL Expander. There are not many changes in this release. I removed caching as it did not improve the extensions speed and increased memory usage. I also started staging the code for the next update with an improved UI.

You can install the extension from here: Chrome URL Extension – chrome.google.com/extensions. If you already have version 0.9.3 or newer installed you should be automatically upgraded.

Feel free to use this as a springboard for your projects and leave me a comment so I can follow your progress. I’m also not adverse to anyone helping me make this extension better. So feel free to fork it, fix it, or just comment on it. You can find the source on GitHub.

Chrome URL Expander 1.5.2 is live and source is published.

Well it’s a good day. I released Chrome URL Expander 1.5.2 today. Nothing really has changed on the user side of things. I just cleaned up the code so I could get to doing something I’ve wanted to do for a while now. The source code for Chrome URL Expander is now published. I have chosen to dual license this project under both the GPLv2 and the MIT License.

Feel free to use this as a springboard for your projects and leave me a comment so I can follow your progress. I’m also not adverse to anyone helping me make this extension better. So feel free to fork it, fix it, or just comment on it. You can find the source on GitHub.

I’m not done with this thing yet. I have a few more features to add and more code to cleanup still.

I hope you like it!

Chrome URL Expander 1.5.1 is now live.

Version 1.5.1 of the Chrome URL Expander is now live. It supports a ton of shortening services. This extension simply expands shortened urls found on web pages you visit. It does this automatically as you browse the internet.

This is done by using the API found at: http://therealurl.appspot.com/. I know this is the second time I have switched backends. This new backend is even faster and supports every single url shortening service I have tried. If you find a service it does not support, please let me know and I will add it.

New features:
Version 1.5.1 now allows options to take effect without reloading the page. It also supports changing the link’s text to reflect the title of the expanded URL.

Coming Soon:
The next release will finally have the long awaited rollover feature!

You can install the extension from here: Chrome URL Extension – chrome.google.com/extensions. If you already have version 0.9.3 or newer installed you should be automatically upgraded.

Enjoy!

Chrome URL Expander Version 1.2.1 is now live!

Version 1.0 of the Chrome URL Expander is now live. It supports a ton of shortening services. This extension simply expands shortened urls found on web pages you visit. It does this automatically as you browse the internet.

This is done by using the API found at: http://www.untiny.com

New features:
Version 1.2.1 now supports an improved on/off button. Turning off URL Expander will re-shorten all links back to their original form. This version also supports caching of expanded URLs. This should reduce the network traffic used and speed up sites like twitter where a refresh would cause the same queries to be made over and over again. You can control how many URLs are cached in the options.

You can install the extension from here: Chrome URL Extension – chrome.google.com/extensions. If you already have version 0.9.3 or newer installed you should be automatically upgraded.

Enjoy!

The following shortening services are supported:
.tk, 1u.ro, 1url.com, 2pl.us, 2tu.us, 3.ly, a.gd, a.gg, a.nf, a2a.me, abe5.com, adjix.com, alturl.com, atu.ca, awe.sm, b23.ru, bacn.me, bit.ly, bkite.com, blippr.com, blippr.com, bloat.me, bt.io, budurl.com, buk.me, burnurl.com, c.shamekh.ws, cd4.me, chilp.it, chs.mx, clck.ru, cli.gs, clickthru.ca, cort.as, cuthut.com, cuturl.com, decenturl.com, df9.net, doiop.com, dwarfurl.com, easyurl.net, eepurl.com, eezurl.com, ewerl.com, fa.by, fav.me, ff.im, fff.to, fhurl.com, flic.kr, flq.us, fly2.ws, fuseurl.com, fwd4.me, gl.am, go.9nl.com, go2.me, golmao.com, goo.gl, goshrink.com, gri.ms, gurl.es, hellotxt.com, hex.io, href.in, htxt.it, hugeurl.com, hurl.ws, icanhaz.com, icio.us, idek.net, is.gd, it2.in, ito.mx, j.mp, jijr.com, kissa.be, kl.am, korta.nu, l9k.net, liip.to, liltext.com, lin.cr, linkbee.com, liurl.cn, ln-s.net, ln-s.ru, lnkurl.com, loopt.us, lru.jp, lt.tl, lurl.no, memurl.com, migre.me, minilien.com, miniurl.com, minurl.fr, moourl.com, myurl.in, ncane.com, netnet.me, nn.nf, o-x.fr, ofl.me, omf.gd, ow.ly, oxyz.info, p8g.tw, parv.us, pic.gd, ping.fm, piurl.com, plurl.me, pnt.me, poll.fm, pop.ly, poprl.com, post.ly, posted.at, ptiturl.com, qurlyq.com, rb6.me, readthis.ca, redirects.ca, redirx.com, relyt.us, retwt.me, ri.ms, rickroll.it, rly.cc, rsmonkey.com, rubyurl.com, rurl.org, s3nt.com, s7y.us, short.ie, short.to, shortna.me, shoturl.us, shrinkster.com, shrinkurl.us, shrtl.com, shw.me, simurl.net, simurl.org, simurl.us, sn.im, sn.vc, snipr.com, snipurl.com, snurl.com, sp2.ro, spedr.com, starturl.com, stickurl.com, sturly.com, su.pr, takemyfile.com, tcrn.ch, thrdl.es, tighturl.com, tiny.cc, tiny.pl, tinyarro.ws, tinytw.it, tinyurl.com, tl.gd, tnw.to, to.ly, togoto.us, tr.im, tr.my, trcb.me, tumblr.com, tw0.us, tw1.us, tw2.us, tw5.us, tw6.us, tw8.us, tw9.us, twa.lk, twi.gy, twit.ac, twitthis.com, twiturl.de, twitzap.com, twtr.us, twurl.nl, u.mavrev.com, u.nu, ub0.cc, updating.me, ur1.ca, url.co.uk, url.ie, url.inc-x.eu, url4.eu, urlborg.com, urlbrief.com, urlcut.com, urlhawk.com, urlkiss.com, urlpire.com, urlvi.be, urlx.ie, uservoice.com, ustre.am, virl.com, vl.am, wa9.la, wapurl.co.uk, wipi.es, wkrg.com, wp.me, x.hypem.com, x.se, xeeurl.com, xr.com, xrl.in, xrl.us, xurl.jp, xzb.cc, yatuc.com, ye-s.com, yep.it, yfrog.com, zi.pe, zz.gd

Chrome URL Expander Version 1.0 is now live!

Version 1.0 of the Chrome URL Expander is now live. It supports a ton of shortening services. For the complete list check out http://www.longurlplease.com. This extension simply expands shortened urls found on web pages you visit. It does this automatically as you browse the internet.

This is done by using the API found at http://www.longurlplease.com.

New features:
Version 1.0 now supports a on/off button that can be found to the right of your address bar. As my testing is limited to only myself. Please let me know if you find any bugs with this new feature.

Upcoming features:
Rollover expanding – This will allow you a different method of expanding links. Rather then expanding them on page load or update, this feature will only temporarily expand links you hover your cursor over.

You can install the extension from here: Chrome URL Extension – chrome.google.com/extensions. If you already have version 0.9.3 installed you should be automatically upgraded.

Enjoy!

Special thanks to my friend @hazard_2gnt for designing the new icon!

Chrome URL Expander 0.9.3 released.

Not much to say about this one. Version 0.9.3 is released. Version 1.0 is still in the works. I put this out now to add support for DOM changes. Previously, if the web page contents changed you would need to refresh the page for the extension to expand URLs. Now with version 0.9.3 Chrome URL Expander will detect this and automatically expand any URLs in the changed content.

You can download Chrome URL Expander here.

←Older