// Gets the base url in the following format:
// "http(s)://domain(:port)/AppPath"
HttpContext.Current.Request.Url.Scheme+"://"
+HttpContext.Current.Request.Url.Authority
+HttpContext.Current.Request.ApplicationPath;
Monthly Archives: April 2014
Ubuntu Change Boot Order for a Service
Use the update-rc.d command.
First remove the link fron the /etc/init.d directory to the rc.d directories
sudo update-rc.d -f my_old_script remove
Then change the boot order. The following updates the scripts boot order to 98.
sudo update-rc.d my_script defaults 98
This command can also be used to remove or add a service during boot.
Source
Extracting a Public Key from a SSL Certificate
First convert the .pfx file to .pem format
openssl pkcs12 -in ClientCert1.pfx -out privpub.pem
Then extract the public key from the .pem format:
openssl x509 -inform pem -in privpub.pem -pubkey -out pub.pem -outform pem
Making Ramen Noodles
I’m a big fan of Ramen during the colder months of the year. Found a post detailing the intricacies of making the dish.
Enable HTTP Strict Transport Security (HSTS) in IIS 7
Even though, Internet Explorer doesn’t support the protocol yet, here are directions to add it.
Add the following to the web.config file:
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Strict-Transport-Security" value="max-age=31536000"/>
</customHeaders>
</httpProtocol>
</system.webServer>
Install this IIS module
Breakthrough in Genetics / Biotech – ‘CRISPR/cas9’
SQL Server – Reset Identity Column
If you have an identity column and would like to reset the seed number for it, execute the following if the table’s name is ‘Customer’.
DBCC CHECKIDENT('Customer', RESEED, 0)