Solving development problems  |  About this blog

Archive for the ‘System administration’ Category

Windows 7 – Fix if SLEEP mode does not work

Check your network card properties through the device manager and disable the “Allow this devide to wake the computer” feature.

  1. Right click on your “My Computer” then select Properties.
  2. Click Device Manager on the left side of the Properties window.
  3. Check your Network card on the Network Adapters (Click on the + sign to expand).
  4. Right click on your network card and select properties.
  5. Go to the Power Management tab and untick the option there to prevent your network card from ever waking up your Windows.

Find out what wakes up your Windows 7/Vista from its sleep

To find out what event/device woke up your Windows from its sleep state, go to command prompt (type cmd on the Run/Search box and press ENTER), then type this:
powercfg – lastwake

 

To get the most detailed info (and probably easiest) on the device that wakes your Windows up during the sleep, type:
powercfg –devicequery wake_armed

 

There! You’ll find the culprit I clicked my mouse to wake my Windows up intentionally so that’s why you see an HID compliant mouse on the screenshot above. Yours might be different.

Hope this helps to prevent your computer wakes up from sleep by itself!

If it still doesn’t work:

  • Check out your Power Management Options on your Control Panel (Start, Control Panel, Power Settings, Change plan settings, Change advanced power settings).
    -> “Multimedia settings” option, “When sharing media.” ->”Allow the computer to sleep.
    -> Check other options one by one while you’re at it.

Original article available here.

Written by Avivo

September 11th, 2011 at 9:33 am

Get all project files from Visual Source Safe for a given date

If you are developing some application and use Visual Source Safe as version control software then you probably needed (at least one time) to retrieve all files from your project for specific day from the past.
Visual Source Safe does not allow you to do this from its GUI but there is a DOS command that can help you.

To use the command-line, you must set the Environment Variable for SSDIR to the location of your working SourceSafe database, such as \\Dev1\VSS where Dev1 is the name of the server and VSS is the name of the share where the database is located. You may also need to add ss.exe path to your PATH variable – it is usually in folder: c:\Program Files (x86)\Microsoft Visual SourceSafe\

This is the command:

ss Get "$/your_vss_folder" -R -Vd15-03-2009;2:00a

or just without an hour

ss Get "$/your_vss_folder" -R -Vd15-03-2009
  • First parameter is folder under your Visual Source Safe project
  • -R means to get all files recursively
  • -V means date and in this example we get all files for 15.3.2009

How to block Remote IP address (hacker attack) on Windows 2008 Server?

Block IP address with Windows Firewall 2008

This procedure helped us when someone wanted to hack our server (taken from original post). If you ever feel that someone may be trying to break into your server or know an IP address that you want to block from accessing your server there is a built in firewall on all of our 2008 DDS servers. You can use this firewall to block either a range of IP addresses or a single address.

  1. Log into your server via RDP.
  2. Click on start > administrative tools > windows firewall with advanced security
  3. On the left side of the firewall window click on the inbound rules option.
  4. On the right side of the screen click on New Rule.
  5. Click on the custom radio button and then click next.
  6. Make sure the All programs radio is selected then click next.
  7. On the protocol and ports options leave everything at its defaults and click next.
  8. On the scope screen you will see two boxes the top one is for local IP addresses and the bottom is for remote IP addresses. In this scenario we are trying to block an outside (remote) IP from accessing anything on the server so we will need to add the IP address to this section only as it will not be a local IP address.
  9. Click on the radio that says these IP addresses in the remote section as shown below:
  10. Click on the Add button.
  11. In the next window we will be adding a single IP address to the rule, you can also add an entire range at this point if you wish.
  12. Click ok, click next.
  13. Make sure you select the Block the connection radio on the next screen and then click next.
  14. Leave all of the options on the next screen checked this will be sure to block the IP no matter the connection they are trying to use. Click next.
  15. Name the rule on the next screen something you can remember in case you wish to remove or edit it in the future. Click finish and thats it

How to recover Firefox bookmarks, settings and whole profile?

Imagine that you computer crashed (let’s hope it will not) and be optimistic (that means that you do daily/weekly/monthly backups or your HDD is still alive).

  1. Before you reinstall your OS (this tutorial is for Vista and Windows 7) make sure you have backup of your data.
  2. Go to this folder of your original (crashed) system and copy all from it to some folder in your new OS filesystem:
    C:\Users\[SOME_USER]\AppData\Roaming\Mozilla\Firefox\Profiles\[SOME_RANDOM_CODE].default\

    where:
    [SOME_USER] is your current logged user’s username
    [SOME_RANDOM_CODE] – some random Firefox profile code like: mhwibcep.default

  3. Now, go to the new Firefox folder on your reinstalled OS:
    C:\Users\[SOME_USER]\AppData\Roaming\Mozilla\Firefox\Profiles\[OTHER_RANDOM_CODE].default\

    where:
    [SOME_USER] is your current logged user’s username
    [OTHER_RANDOM_CODE] – some other random Firefox profile code from your new Firefox installation like: bbtibcep.default

  4. Copy all files from Step 2 into Step 3

Happy surfing!

Import/Export DNS zones from DNS Manager in Windows 2008 R2

First, you must have installed on your Windows 2008 server DNS Server Role. If you don’t installed it use this:

(Server Manager > Roles Summary > Add Roles > DNS Server)

Now, you can start DNS Manager clicking on icon or command %SystemRoot%\system32\mmc.exe %SystemRoot%\system32\dnsmgmt.msc /s

Just replace with your values:

  • [your_server_name] - your server name
  • [your_domain_name] - your domain (must repeat this for every domain – Export and Import)
  • [your_primary_ip] - because we were importing secondary zones, we needed to specify primary IP address (primary zone)
  • [your_custom_folder] - your custom folder where yo want to move exported domains and to import from

EXPORT SPECIFIC DNS ZONE

dnscmd [your_server_name] /ZoneExport [your_domain_name] [your_domain_name].txt
move /Y c:\Windows\System32\dns\[your_domain_name].txt [your_custom_folder]

IMPORT SPECIFIC DNS ZONE

move /Y [your_custom_folder]\[your_domain_name].txt c:\Windows\System32\dns\
dnscmd [your_server_name] /ZoneAdd [your_domain_name] /Secondary
             [your_primary_ip] /file [your_domain_name].txt /load

Written by Avivo

February 14th, 2011 at 12:02 pm