Block These Sites On Your Router (and in Ad Block) Immediately

This is a list of sites that should be blocked completely. Add this list to your Router Settings and the Chrome extension Ad Block for much, much faster Internet browsing.

Please read the list before blocking them:

12mlbe
33across
3dstats
4chan
abmr
acxiom-online
adadvisor
adage
adblade
addfreestats
adexcite
adgrx
adingo
adinterax
admailtiser
admeld
adnxs
adparlour
adpredictive
adshuffle
adsonar
adsrvr
advertising
adzerk
agkn
analytics
atdmt
bluecava
bluekai
bounceexchange
brand-server
chartbeat
chasbros
clickability
coveritlive
crwdcntrl
doubleclick
dynamicyield
effectivemeasure
eproof
etahub
exelator
feedbackify
fetchback
ggpht
google-analytics
googleadservices
googlesyndication
googletagmanager
googletagservices
histats
intermarkets
libsyn
lijit
liveperson
llnwd
marketo
mathtag
merchantadvantage
mgid
mktoresp
moatads
myspace
netmng
newrelic
newsinc
omtrdc
outbrain
parse.ly
parsely
premiereinteractive
quantcast
quantserve
reddit
revsci
sail-horizon
scorecardresearch
shikharfin
simplereach
simpli.fi
sitemeter
tealium
trib.al
triggit
visitortracklog
visualdna
visualrevenue
w3schools
w55c
webtrends
xiti
zagat
zedo
zemanta

Ensure Windows Services function properly with PowerShell and Task Scheduler

Not too long ago, I accidently turned off one of the Remote Desktop services on my dedicated server. Of course, I immediately lost my Remote Desktop connection and had to email my hosting provider to get the service restarted. The cost for this incident was $75.00 and I can’t really complain because it was my fault.

Let’s get PowerShell and Windows Task Scheduler to keep this from happening again. The following script will start and ensure the correct settings of various Windows Services in IIS.

You will need to alter the script for your own purposes – the following code isn’t really intended to be a copy-and-paste solution. When your version of the script is perfected, use Task Scheduler to execute the script as frequently as necessary. My version runs every 15 minutes.

For more information about running PowerShell scripts from the Task Scheduler, see: Weekend Scripter: Use the Windows Task Scheduler to Run a Windows PowerShell Script.

Block IP addresses in Windows Firewall with PowerShell

IIS Administrators are use to seeing some visitors abuse their sites. In certain situations the only option is to block the offending IPs. The netsh utility can greatly simplify the task of blocking one or more IP addresses in the Windows Firewall:

This script can be run as many times as needed, and will either create or update the Firewall Rule named “Blocked IPs”.

Display all IIS server variables in a table

Open your favorite text editor and save the following as an ASPX file. Open the file in your Web browser for a list of server variables.

 

Write a global-level IIS HTTP Module in C#

  1. Global-level HTTP Modules are Class Libraries not ASP.NET projects – though a HTTP Module class can be added to a single ASP.NET project.
  2. Open Visual Studio and create a new Windows Class Library project.
    New Project > Class Library
  3. Add a reference to System.Web.dll:
    Reference Manager
  4. Implement the IHTTPModule interface:
  5. Determine which HttpApplication Events you want to respond to:
  6. Install the module into the Global Assembly Cache from your output directory:
  7. Open Internet Information Services (IIS) Manager and select Modules:
    IIS Modules
  8. Click Add Managed Module… in the Modules Actions pane and select your assembly.
  9. Depending on the nature of your HTTP Module, you may want to restart the server from IIS Manager.

Stop Visual Studio from creating PDB folders in your project

If Visual Studio is cluttering your solution with Project Database (PDB) Folders, there are a couple of ways to deal with them:

  1. Change the location of the Symbols Cache:
    In Visual Studio, click the Debug menu, and select “Options and Settings…“. In the dialog, select Symbols under Debugging. Change the location where the folders are created under “Cache symbols in this directory:“. I’ve chosen to keep mine in the Windows Temp folder. The PDB information will still be available but kept out of your solutions, projects, and best of all SVN.
    DebugOptionsSymbols
  2. Create a single PDB file instead of PDB Folders:
    From your project’s properties, select Build, and click the “Advanced…” button at the bottom of the screen. In the dialog, select “pdb-only” from the “Debug Info:” list. This will create a single PDB file and prevent PDB folder from being generated. Developers are still responsible for keeping the PDB file out of SVN.
    AdvancedBuildSettings

 

JavaScript Recipes

I’m writing a book for for Apress. It will be available in early 2014. 

JavaScript Recipes is your go to reference for tackling common and advanced JavaScript tasks. JavaScript is the world’s most popular client ­side scripting language and is gaining popularity on the server. This book takes you from language basics like built­in objects and flow ­control all the way to advanced “Bit Twiddling” optimization techniques, and everything in between. Quickly discover solutions to common problems, best practices you can follow, and everything JavaScript has to offer.

You will learn:

  • Language fundamentals like types, conversions, execution contexts, expressions, operators, statements, and built­-in objects.
  • How to explore and make the most of your script’s host environment and how to create your own JavaScript host using Google’s V8 engine.
  • Employ advanced optimization techniques to create scripts that execute as fast, or faster, than native executables.

JavaScript is a powerful language that developers have used to write 3D games, compilers and even a virtual machine that boots Linux. JavaScript Recipes shows you how to avoid wasting development time and concentrate on developing cutting ­edge applications. You’ll see how much quicker and efficient it is to develop with JavaScript.

ISBN: 9781430261063