Stupid Windows Tricks from the command line
Change the Log on credentials for a windows service:
sc.exe config "YourServiceName" obj= "yourusername" password= "yourpassword"
Bring up services:
services.msc
Copy a directory structure:
xcopy G:\foo\*.* D:\bin\bar /E /D /Y
Copy a directory structure and exclude one or more files/directories:
xcopy \\nyceqasp8081\apps\polyent\*.* D:\apps\bar\ /E /D /Y /EXCLUDE:excludefile.txt
where excludefile.txt is a file containing one or more path exclusions for example D:\apps\bar\logs
Set environment variables:
setx JAVA_HOME "D:\bin\Java\jdk1.5.0_12" /m
The /m here denotes the variable should be a system wide variable. Leaving /m off will add the variable to the current user’s environment instead.
Map a drive and make it persistent (after reboots):
net use G: \\foo.bar.com\spg /P:Yes
Note: These have been tested and known to work on Windows Server 2003. Your mileage may vary on other variants of Windows.
Silent Install of JDK and JRE
This week I had a requirement for scripting the installation of the Java 5 JDK and JRE. These instructions require separate install files for the JDK and JRE but will get the job done.
For the JDK, you can place the following in a *.bat file and simply run it from command line:
@echo off
echo Installing JDK…
start /w C:\temp\jdk-1_5_0_12-windows-i586-p.exe /s /v”/qn INSTALLDIR=d:\bin\Java\jdk1.5.0_12 REBOOT=Suppress”
For the JRE:
@echo off
echo Installing JRE…
start /w C:\temp\jre-1_5_0_12-windows-i586-p.exe /s INSTALLDIR=d:\bin\Java\jre1.5.0_12 REBOOT=Suppress
Some related links:
How to migrate a Subversion repository in 4 steps
sudo svnadmin dump /path/to/svn-repository > svn-repository.dmpgzip svn-repository.dmp- move
svn-repository.dmp.gzto your new server - log in to your new server, then
sudo svnadmin load svn-repository
Take the Red Pill: Share As Much Information As You Can
Marissa Mayer gives some insight into how Google flourishes with innovation in a Forbes article. Number five caught my eye:
5. SHARE AS MUCH INFORMATION AS YOU CAN
“People are blown away by the information you can get on MOMA, our intranet. Because there is so much information shared across the company, employees have insight into what’s happening with the business and what’s important. We also have people do things like Snippets. Every Monday, all the employees write an email that has five to seven bullet points on what you did the previous week. Being a search company, we take all the emails and make a giant Web page and index them. If you’re wondering, ‘Who’s working on maps?’ you can find out. It allows us to share what we know across the whole company, and it reduces duplication.”
Imagine what could be done at a much larger scale with the catch being that there would be no firewalls, no corporate security…no isolationism. Everyone knows what every one else is doing…no fear…just effective and pure synergy on a planetary scale.
Take the red pill.
Ghosts I-IV: New 36 Track Nine Inch Nails Album!
I’m totally stoked that NIN has another album out called Ghosts I-IV. Don’t worry. Even though it has 36 (count ‘em!), it’s only five bucks available from nin.com or amazon. I haven’t actually listened to it yet but apparently Trent is branching out since he is free from evil record companies. From what I’ve read this one is an instrumental. It doesn’t really matter to me, I’ve been a fan since one of his first releases. Pretty Hate Machine (1989) is still one of my all time favorite albums and will always have special meaning to me.