I’ve been hacked. Evil aspx file uploaded called AspxSpy. They’re still trying. Help me trap them‼

If you running asp.net and only as you tagged, then you only need to add this web.config on the root directory that your users upload files. With that web.config you do not allow anyone to run aspx pages on this directory tree. The web.config on the protected must only contains: <configuration> <system.web> <authorization> <deny users=”*” … Read more

How do I run a Play Framework 2.0 application as a Windows service?

This worked for me on Windows 7: Create folder C:\my_app Go to your Play! app folder in command line and type play dist Copy generated “something-SNAPSHOT” folder to C:\my_app Download YAJSW and extract to C:\my_app In C:\my_app\something-SNAPSHOT\ make a new file start.bat and fill it with command like this: java -cp “C:\my_app\something-SNAPSHOT\lib\*” play.core.server.NettyServer Save it … Read more

Build Visual Studio project through the command line

Create a .bat file called: Manual_MSBuild_ReleaseVersion.bat Put this in the .bat file. REM you’ll have to find the “latest” version of where msbuild.exe resides on your machine.. here are some popular versions/locations REM set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v2.0.50727 REM set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v3.5 REM set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319 REM set msBuildDir=C:\Program Files (x86)\MSBuild\12.0\Bin set msBuildDir=C:\Program Files (x86)\MSBuild\14.0\Bin call “%msBuildDir%\msbuild.exe” MySolution.sln /p:Configuration=Release /l:FileLogger,Microsoft.Build.Engine;logfile=Manual_MSBuild_ReleaseVersion_LOG.log … Read more

How to get current user who’s accessing an ASP.NET application?

The quick answer is User = System.Web.HttpContext.Current.User Ensure your web.config has the following authentication element. <configuration> <system.web> <authentication mode=”Windows” /> <authorization> <deny users=”?”/> </authorization> </system.web> </configuration> Further Reading: Recipe: Enabling Windows Authentication within an Intranet ASP.NET Web application

Automating Office via Windows Service on Server 2008

I’ve had problems automating Office from a Windows Service under Windows Server 2008, even though that works fine under Windows Server 2003. The problem also occurs at the Open call, so it may be the same problem. I tried following the advice given by H Ogawa in this MSDN thread, and it seemed to work. … Read more

ASP.NET 4.5 MVC 4 not working on Windows Server 2008 IIS 7

Try using this: <system.webServer> <modules runAllManagedModulesForAllRequests=”true” /> … </system.webServer> EDIT: The solution above will work for .NET 3.5 or below. If you are using .NET 4.0 or above, you might want to try installing IIS7 QFE Also, this article is worth reading to understand the difference between those two.

Gradle proxy configuration

Refinement over Daniel’s response: HTTP Only Proxy configuration gradlew -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 “-Dhttp.nonProxyHosts=*.nonproxyrepos.com|localhost” HTTPS Only Proxy configuration gradlew -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3129 “-Dhttp.nonProxyHosts=*.nonproxyrepos.com|localhost” Both HTTP and HTTPS Proxy configuration gradlew -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3129 “-Dhttp.nonProxyHosts=*.nonproxyrepos.com|localhost” Proxy configuration with user and password gradlew -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 – Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3129 -Dhttps.proxyUser=user -Dhttps.proxyPassword=pass -Dhttp.proxyUser=user -Dhttp.proxyPassword=pass -Dhttp.nonProxyHosts=host1.com|host2.com worked for me (with gradle.properties in … Read more

tech