command line

Removing DisableRegistryTools policy

The problem:

You try to run regedit and you get the following response:

Error "Registry Editing has been disabled by your administrator"

The answer is to use the REG.EXE CLI utility:


REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableRegistryTools /t REG_DWORD /d 0 /f

In theory this solution is only for stand alone Windows XP machine, though I have personally seen this be effective on an XP machine managed by Active Directory (we did have local admin privledges).

You can also use the old "at" command from the Windows command line to launch a shell with SYSTEM privs.

at 21:01 /interactive “cmd.exe”

There is nothing here that cannot be found on the internet, specifically and

Disk usage

Just posting a handy little trick to get your disk usage from the command line.

While the df command will show you what the disk utilization for your partitions, sometimes you need more specific details, like which files and folders are taking up all of your space.

Here is how I do this:

  1. df -Pacmx --max-depth=1 . |sort -g

This is kind of awkward to type out all the time, so you create an alias.

  1. echo "alias dus=\"df -Pacmx --max-depth=1 . |sort -g\"" >> ~/.bashrc

Now type

  1. source ~/.bashrc

From any directory, you can now type "dus" without the quotes to see all the files and directories sorted by size. It should also be noted that df is rounding up to the nearest megabyte.

One final note, the flags I used are specific to the GNU version of these utilities. You BSD folks will have to adjust the df and sort options.

Handy Linux Tricks

I am just posting a few of those little usefull commands, links, and utils that make my digital life so much easier:

* What hardware have you got? What version is your BIOS? dmidecode is perfect for this. One that I use regularly is to check the BIOS version without rebooting.

 sudo dmidecode -s bios-version
This command returns something like this:

* Check device usage
fuser (device)
 fuser /dev/dsp

used for finding out what software has control of a given device. Very usefull when tweaking and troubleshooting a linux pro audio set up.

* rsync backups
rsync -avzue ssh (username)@(hostname or ip):/(path to backup)/* (localpath )

This backs up all files and directories on the remote host and copies to the folder you specify.

* Hard Drive Tuning (Linux)
hdparm (options) (hard drive device) For example:
hdparm -c3 -d1 -S36 /dev/hda

This controls the hard drive, specifically I am enabling dma which speeds up the hard drive, setting i/o to mode 3 which also speeds things up.

Windows runas syntax

While not nearly as clean and slick as the GNU sudo command, it is a very useful command for doing administrative stuff while logged in as a non-privaledged user.

runas /noprofile /user:mydomain\myadminusername "mmc %SystemRoot%\system32\compmgmt.msc /s"

This example will bring up the “Computer Management” console, normally launched from “Administrative Tools” All of the control panel applets exist under %SystemRoot%\system32\ (typically c:\windows\system32) and they all have the .msc extension.

Syndicate content