Posts

Showing posts from May, 2012

Oracle Drop All Tables, Views, Sequences, Triggers

Image
1. Drop All Views BEGIN FOR i IN (SELECT view_name FROM user_views) LOOP EXECUTE IMMEDIATE('DROP VIEW ' || user || '.' || i.view_name); END LOOP; END; 2. Drop All Triggers BEGIN FOR i IN (SELECT trigger_name FROM user_triggers) LOOP EXECUTE IMMEDIATE('DROP TRIGGER ' || user || '.' || i.trigger_name); END LOOP; END; 3. Drop All Sequences BEGIN FOR i IN (SELECT sequence_name FROM user_sequences) LOOP EXECUTE IMMEDIATE('DROP SEQUENCE ' || user || '.' || i.sequence_name); END LOOP; END; 4. Drop All Tables BEGIN FOR i IN (SELECT table_name FROM user_tables) LOOP EXECUTE IMMEDIATE('DROP TABLE ' || user || '.' || i._table_name); END LOOP; END;

SchemaSpy

Image
SchemaSpy is a very useful tool for database Administrators and Developers. The basic purpose of SchemaSpy is to auto-generate schema for any database. But it's evolved in a great tool that can give us so much valuable information about any database. The case in question is that of a complex database consisting of more than 30 tables with some tables having fields in excess of 50 and complex links. I won't go into details of everything here but rather I'll outline major points. After successfully running SchemaSpy on a database you are presented with an output of number of HTML files in the designated folder on your PC. The index.html file is the starting point for this output. After opening it you can see following tabs.   And that's a lot of information that you get about the database. The first tab - tables - lists all the tables, next one displays a relationship diagram, next lists Utility tables and details for them, the next one does constraints, after that

pwd

Image
Well, it ain't workin' as it should!!!

One more I post though having nothing to do with me

Image
Oh and I have given up on Linux's MTP support!!!

I have disabled Unity HUD!!!

Image
Thanks to this post I have disabled the pesky unity HUD!!! http://askubuntu.com/questions/122209/how-do-i-modify-or-disable-the-huds-use-of-the-alt-key

I think my mouse just died

Image

Online Syntax Highlighting

Image
This is an amazing website that can highlight your code in various color themes. It's really helps with readability of the code in documents. http://tohtml.com/

Of bugs and bees (especially annoying bees)

Image
Oftentimes a simple operation fails and screws a much complex operation; Well mostly though it's the complex operation that often fails and makes life miserable. "echo PASSPHRASE | gpg --yes --quiet --passphrase-fd 0 --simple-sk-checksum -c --no-use-agent SOURCE_FILE" This was the monkey wrench that I managed to throw in the wheel of the tractor! It all happened like this: I was tasked to design an encryption utility which will use gpg in the background and encrypt files with keys from a pool. So I wrote a small C program that would access the pool securely and encrypt the file. Later this file would be transferred across the network and at the receiving end there was a similar utility which would decrypt the file. Now the problem was I didn't have enough time to go through gpg's api's and integrate it in the utility. So instead I used system function to execute the gpg command as shown above. For testing I would call this utility from terminal and

Code Conversion from C#.NET to VB.NET

Developer Fusion offers free online code conversion service and it is of better quality than almost all others. The URL for the same is as follows: http://www.developerfusion.com/tools/convert/vb-to-csharp You can follow following steps to convert one whole project from C#.NET to VB.NET : 1. Create empty VB.NET project. 2. Create the necessary forms – Don't add any controls; we'll copy them from respective forms in C#.NET project in following step. 4. Go to code for the forms and add Import for all assemblies required (using * statements in C#.NET project – which you can paste in the URL above to get imports * statements) 3. Copy all controls in a form and paste the in respective forms. 4. Add the extra class variables (Convert respective code to VB.NET using above URL). 5. Add constructors and methods you have added to the forms(Convert respective code to VB.NET using above URL). 6. Finally add event handlers (Convert respective code to VB.NET using above URL). 7.

Midnight in Paris and XBMC

Image
About the movie? I have only one word – WOW! The story is great; the execution is brilliant and the actors are great. Also I waited 2 weeks since I got this movie in my hands so that I wouldn't rush through it and instead saved it for the day when I was feeling like watching such a movie. I have read the reviews and they were positive but this movie is the kind of film that I love – the story is leisurely told and is acted out brilliantly, you find yourself enjoying the acting, the events and the overall tone of the film. You find yourself getting involved in the film; thinking about it and you find some great thing in it. That's the recipe for a really laid back pleasurable film to watch. And Midnight in Paris is just the film. All I missed was some grapes (I don't know why!) and someone to feed them to me (Ok, just kidding!). Now the software, and yeah this article was originally about XBMC 11. It was lauded all over the internet as a worthy upgrade to XBMC 10 in term

MS Office woes

Image
Change the separator in all .csv text files ########################################################################## In Microsoft Windows, click the Start button, and then click Control Panel. Open the Regional and Language Options dialog box. Do one of the following: In Windows Vista, click the Formats tab, and then click Customize this format. In Windows XP, click the Regional Options tab, and then click Customize. Type a new separator in the List separator box. Click OK twice.  NOTE   After you change the list separator character for your computer, all programs use the new character as a list separator. You can change the character back to the default character by following the same procedure. ########################################################################## ','(comma ) is used as Separator for CSV file; regardless of 'List Separator' Setting in Control Panel.  ########################################################################## SYMPTOMS When

Perl Script for brute force cracking gpg encrypted file

Image
Two Points never to forget while using encryption: 1. Keep the passwords handy/ safe. 2. Don't use encryption if you are not familiar with the procedures /options available when it comes to recovering the password/ decrypting the file. LEARNT THE HARD WAY! :D #################################################################### #!/usr/bin/perl -w # This script was largely based on this Python script: http://www.rbgrn.net/content/25-how-to-write-brute-force-password-cracker # Author: Tom # Blog: kaabel.net/blog/ # IRC: irc.malvager.com #perlbar use strict; use GnuPG; my $gpg = new GnuPG(); # Create GnuPG handle my $found; my @range = ('0' .. '9'); # Edit your charset here (Numbers, in this case) ('A'..'Z') for caps my $maxlength = 5; # Max length of the password my $minlength = 1; my $time = time(); sub recurse($$) { my ($width, $position, $basestring) = @_; # Get the arguments supplied in the function's arguments. foreach my $char (@rang