Saturday, September 29, 2007

Default Form Button

Form properties ->Misc->AcceptButton

Firefox - new profile

Step 1: Start Firefox and export your bookmarks as a file on your hard-drive (we'll need them later).

fast firefox browser

Step 2: Type firefox.exe - P in the Run box of Windows. (see screenshot)

Step 3: Click the Create Profile button without making any modifications to your existing profile (which is normally called "default")

Firefox Very Slow

Now when you Start Firefox in the new profile, you are very likely to be impressed with the speed. You can import the bookmarks that you saved in Step 1. If you have made any changes to the Firefox Dictionary, copy the persdict.dat word list file from the old profile folder to the new one.

Yes, there won't be any old Firefox add-ons in the new profile but the browser will be extremely quick and won't hog the CPU - just the way you want Firefox to run on your computer.

And if you ever need to revert to the old profile, just type Firefox -P again and click the old profile. Nothing is lost.



Tuesday, September 25, 2007

Impersonation - C#

SetACL - windows permissions management (GPL)

DOS command to delete directory with all sub directories without confirmations

Windows XP DOS command deletes the C:\TEST directory and all subdirectories WITHOUT ANY WARNING:


/S = Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree.
/Q = Quiet mode, do not ask if OK to remove a directory tree with /S.

Friday, September 7, 2007

Clean Up Ubuntu Grub Boot Menu After Upgrades

To remove GRUB entries, we'll need to edit the file /boot/grub/menu.lst. You can do this by using Alt+F2 and then typing in the following command:

gksu gedit /boot/grub/menu.lst


Now that we've got the file open, scroll down to the bottom of the file where it says "End Default Options", and you'll find all the menu entries for the various kernels in here. You can just select and delete the ones you want.


Save the file, and then the next time you boot up you'll see a much nicer set of options.


No need to delete those lines to simplify the GRUB menu. The easier way to keep only newest lines is to open the menu.lst (gksu gedit /boot/grub/menu.lst), find "#howmany=all" and change it to "#howmany=1″. Then run "sudo update-grub" to update changes. Next time, only newest kernel lines will be shown.


Tracking Down Svchost Process

In CMD window write:

tasklist /svc

Monday, September 3, 2007

Directory Security and Access Rules


using System.Security.AccessControl;
    FileSystemAccessRule faRule;
    FileSystemRights fsrRights;
    fsrRights = FileSystemRights.FullControl;
    faRule = new FileSystemAccessRule(
        new NTAccount("DOMAIN\\user"), 
        InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, 
        PropagationFlags.InheritOnly, AccessControlType.Allow
    //File.SetAccessControl(txtFile.Text, security);
    DirectorySecurity dirsec = Directory.GetAccessControl(@"\\server\sub$\folder");
    Directory.SetAccessControl(@"\\server\sub$\folder", dirsec);


The best explanation (MSDN)



ACL Propagation rules