OS Tips

This page contains various tips and hacks for the operating systems that I encounter.

Usually, these are things that I am using, and want to remember for future use.

Disable autosharing of C$, and other default shares on Windows:

Windows 2000 :
Change (or set) the D-Word property in the system registry

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\lanmanserver\parameters\AutoShareWks(NT Workstation)

to a value of "0"

Windows XP:
Change (or set) the D-Word property in the system registry

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\lanmanserver\parameters\AutoShareWks

to a value of "0"

Turn on debug info for logon / logoff

This can help diagnose a system that takes forever to logon or logoff - at least you will know where it is stuck.

Change (or create and set) the D-Word property in the system registry

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ Policies\System\VerboseStatus

to a value of "1"

 

Increase max number of open files on fedora

Add the following lines to the /etc/security/limits.conf file to bump the file handle limit to 16384:

#crank up the file handle limits
* hard nofile 16384
* soft nofile 16384

This will take affect on your next login (verify with 'ulimit -a')

 

Group Policy Editor for 2000/XP

Start -> Run -> gpedit.msc

 

Shell (bash) configuration

Useful lines from my .bashrc

Sets the prompt to something useful (the current path and hostname):

export PS1="`whoami`"@"`hostname`==> \w>"

Scripts to recursively remove all files with tildas or pound signs in them:

alias removeTilda='find . -name "*~*" -exec rm -i \{\} \;;find . -name ".*~*" -exec rm -i \{\} \;'
alias removePound='find . -name "*#*" -exec rm -i \{\} \;;find . -name ".*#*" -exec rm -i \{\} \;'

 

Bash Terminal history searching

Press CTRL + R after pressing tab to search history in unix

 

Useful Eclipse launch parameters

To launch Eclipse in a specified VM, add this to the end of your shortcut that launches eclipse:

-vm "C:\Program Files\java\jdk141\bin\javaw.exe"

And with more memory space:

-vmargs -Xmx256M

 

Mozilla / Firefox tweaks

Port Blocking

Modify defaults/all.js (in your Mozilla installation directory).
For example, to unblock ports 1, 3, and 7, use the following line:

pref("network.security.ports.banned.override", "1,3,7");

Copying and Pasting long lines

When someone sends you a long link, such as:

http://maps.google.com/maps?q=37.628036,+-116.848060&ie=UTF8&z=15&ll=37.62759,-116.848826&spn=0.017878,0.048752&t=h&om=1

It will inevitably be cut up into a bunch of pieces... you normally can't just copy and paste it into Firefox. To fix this, go to the address "about:config" - type "newlines" into the filter box - and when "editor.singleLine.pasteNewline" comes up - change its value from 1 to 3.  Now it will automatically reassemble the long line.

 

MS Office (anti) Help System

Recent version of MS Office bring up the help system in this really annoying side-attached window, which resizes your entire application. If you want to have the help system open in a new window, like a normal program, modify this registry key:

(Office 2K)

HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Common\HelpViewer

(Office XP)

HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Common\HelpViewer

If there is a value named "IsFloating" assign the number 1 to that value. If there isn't one, add a new DWORD value, name it "IsFloating", and assign 1 to it.