Windows wakes up soon after going to sleep

I think there are two main reasons why Windows would wake up “by itself” (without pressing a key on the keyboard or clicking the mouse).

  1. Scheduled tasks;
  2. Devices allowed to wake up the computer.

Scheduled tasks are fairly simple to look into and it was not the problem at the time of writing this post, so I’ll skip straight to the second point.

We can get a list of devices that are allowed to wake up the computer from sleep by typing at the command prompt:

powercfg -devicequery wake_armed

At the time, I had 3 allowed devices:

  • Intel(R) 82579V Gigabit Network Connection
  • HID-compliant mouse
  • Microsoft USB Natural Ergonomic Keyboard 4000 (Mouse and Keyboard Center) (001)

I don’t need WOL or anything like that so I disallowed the network card to wake up the computer using Device manager:

Untitled

And voilà, my computer now stays asleep until I use the mouse or keyboard. I started having this problem after moving the computer to another network, so I suspect the new router or other network connected computers sent packets that waked it up.

fail2ban on freebsd with pf

% sudo pkg install py27-fail2ban

% sudo vim /usr/local/etc/fail2ban/jail.local

[ssh-pf]
enabled = true
filter = sshd
action = pf
logpath = /var/log/auth.log

% sudo vim /usr/local/etc/fail2ban/action.d/pf.conf

[Definition]
actionstart =
actionstop =
actioncheck =
actionban = /sbin/pfctl -t <tablename> -T add /32
actionunban = /sbin/pfctl -t <tablename> -T delete /32

[Init]
tablename = fail2ban

% sudo vim /etc/pf.conf

table <fail2ban> persist
block in on $ext_if from <fail2ban>

% sudo vim /etc/rc.conf

fail2ban_enable="YES"

% sudo service pf reload
% sudo service fail2ban restart

% sudo pfctl -t fail2ban -T show

http://www.fail2ban.org/wiki/index.php/Talk:HOWTO_use_geoiplookup

SSHFS on Windows

or secure file sharing, a replacement for samba (windows client, accessing files on *nix server).

DokanInstall_0.6.0.exe Dokan library (http://dokan-dev.net/en)
dokan-sshfs-0201226.zip for installer and explorer context menu
dokan-sshfs-0.6.0.zip take DokanNet.dll and DokanSSHFS.exe and replace in 0201226.

Advantages secure, read/write, easy to install.
Drawback easily bottlenecks at a few MBps on slow CPU. Not multi-core. Shows bad size information. Unstable?