Friday, January 27, 2012
Wednesday, January 25, 2012
Converting a System.Data.Linq.Binary (or timestamp) to a string and back again to avoid LINQ concurrency issues
public System.UInt64 Stamp
{
get
{
return BitConverter.ToUInt64 (this._TimeStamp.ToArray(), 0);
}
set
{
this._TimeStamp = new Binary(BitConverter.GetBytes(value));
}
}
REF
:http://geekswithblogs.net/AndrewSiemer/archive/2008/02/11/converting-a-system.data.linq.binary-or-timestamp-to-a-string-and-back.aspx
{
get
{
return BitConverter.ToUInt64 (this._TimeStamp.ToArray(), 0);
}
set
{
this._TimeStamp = new Binary(BitConverter.GetBytes(value));
}
}
REF
:http://geekswithblogs.net/AndrewSiemer/archive/2008/02/11/converting-a-system.data.linq.binary-or-timestamp-to-a-string-and-back.aspx
Friday, January 13, 2012
Configuring cache expiration on IIS 7
As you may be aware of we used something called wildcard mappings on IIS 6 to be able to trap all requests inside EPiServer CMS, that also meant that we took care of delivery of static files even outside the VPP-folders. So, for example the expiration time for your CSS-files in the templates folder was configured by this element located in the root of web.config:
But, since we use the new integrated pipeline in IIS 7 we dropped the wildcard mapping and we can let IIS itself take care of all static files. That also means that there are other settings that controls the cache expiration for files outside of VPP-folders. Add this setting under the -element to add a 1-day expiration on all static files delivered by IIS 7:
What's even better in IIS 7 is that you can add profiles for kernel caching (and output caching for that matter). This section adds kernel caching on often requested files for a short period of time, but remember that this setting will affect ALL content delivered from IIS including files from a VPP-folder:
1: <staticFile expirationTime="12:0:0" />
1: <staticContent>
2: <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00">clientCache>
3: staticContent>
What's even better in IIS 7 is that you can add profiles for kernel caching (and output caching for that matter). This section adds kernel caching on often requested files for a short period of time, but remember that this setting will affect ALL content delivered from IIS including files from a VPP-folder:
1: <caching>
2: <profiles>
3: <add extension=".gif" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="0.00:01:00" location="Any" />
4: <add extension=".png" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="0.00:01:00" location="Any" />
5: <add extension=".js" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="0.00:01:00" location="Any" />
6: <add extension=".css" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="0.00:01:00" location="Any" />
7: <add extension=".jpg" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="0.00:01:00" location="Any" />
8: <add extension=".jpeg" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="0.00:01:00" location="Any" />
9: profiles>
10: caching>
Wednesday, January 04, 2012
Sample database backup
echo off
SET Today=%Date: =0%
SET Today=%Today:~-4%%Date:~-7,2%%Date:~-10,2%
SET Now=%Time: =0%
FOR /F "tokens=1,2 delims=:.," %%A IN ("%Now%") DO SET Now=%%A%%B
SET FileName=WebPortal_%Today%_%Now%.bak
sqlcmd -S Server -U UserName -P Password -Q "BACKUP DATABASE WebPortal_UAT TO DISK='D:\DbBackups\WebPortal_%Today%_%Now%.bak'"
ECHO The database has been backup to D:\DbBackups\WebPortal_%Today%_%Now%.bak
SET Today=%Date: =0%
SET Today=%Today:~-4%%Date:~-7,2%%Date:~-10,2%
SET Now=%Time: =0%
FOR /F "tokens=1,2 delims=:.," %%A IN ("%Now%") DO SET Now=%%A%%B
SET FileName=WebPortal_%Today%_%Now%.bak
sqlcmd -S Server -U UserName -P Password -Q "BACKUP DATABASE WebPortal_UAT TO DISK='D:\DbBackups\WebPortal_%Today%_%Now%.bak'"
ECHO The database has been backup to D:\DbBackups\WebPortal_%Today%_%Now%.bak
Tuesday, December 20, 2011
Could not access VBScript run time for custom action
The information in this article applies to:
All versions of Nitro PDF Professional
All versions of Nitro PDF Express
Problem
When installing Nitro PDF products on Windows Vista or Windows 7, the following error is generated:
Error 2738. Could not access VBScript run time for custom action.
Cause
This error message indicates that the VBScript engine is not currently registered on the machine where the install/uninstall is taking place.
Resolution
The VBScript engine can be quickly registered by following these steps:
Run Command Prompt as administrator:
Start Menu -> All Programs -> Accessories
Right click on Command Prompt and select Run as administrator
Run the following command:
If you are using 32-bit version of Windows:
Type cd %windir%\system32 into the Command Prompt and hit Enter
If you are using 64-bit version of Windows:
Type cd %windir%\syswow64 into the Command Prompt and hit Enter
Type regsvr32 vbscript.dll into the Command Prompt and hit Enter.
If the above solution does not work, try the following alternative steps:
If you are using 32-bit version of Windows:
Run Command Prompt as administrator:
Start Menu -> All Programs -> Accessories
Right click on Command Prompt and select Run as administrator
Type the following command in the prompt: reg delete "HKCU\SOFTWARE \Classes\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}" /f, then hit Enter.
Next, you must also type the following command: c:\windows\system32\regsvr32 vbscript.dll, then hit Enter.
You should now be able to install your Nitro PDF software product.
If you are using 64-bit version of Windows:
Run Command Prompt as administrator:
Start Menu -> All Programs -> Accessories
Right click on Command Prompt and select Run as administrator
Type the following command in the prompt: reg delete "HKCU\SOFTWARE\Classes\Wow6432Node\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}" /f, then hit Enter.
Next, you must also type the following command: c:\windows\syswow64\regsvr32 vbscript.dll, then hit Enter.
You should now be able to install your Nitro PDF software product.
If the above solution does not work, try the following alternative steps:
If you are using 32-bit version of Windows:
Run Command Prompt as administrator:
Start Menu -> All Programs -> Accessories
Right click on Command Prompt and select Run as administrator
Type the following command in the prompt: reg delete "HKCU\SOFTWARE \Classes\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}" /f, then hit Enter.
Next, you must also type the following command: c:\windows\system32\regsvr32 vbscript.dll, then hit Enter.
You should now be able to install your Nitro PDF software product.
If you are using 64-bit version of Windows:
Run Command Prompt as administrator:
Start Menu -> All Programs -> Accessories
Right click on Command Prompt and select Run as administrator
Type the following command in the prompt: reg delete "HKCU\SOFTWARE\Classes\Wow6432Node\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}" /f, then hit Enter.
Next, you must also type the following command: c:\windows\syswow64\regsvr32 vbscript.dll, then hit Enter.
ref: http://kb.nitropdf.com/article.aspx?id=10106&cNode=3D8W4P
All versions of Nitro PDF Professional
All versions of Nitro PDF Express
Problem
When installing Nitro PDF products on Windows Vista or Windows 7, the following error is generated:
Error 2738. Could not access VBScript run time for custom action.
Cause
This error message indicates that the VBScript engine is not currently registered on the machine where the install/uninstall is taking place.
Resolution
The VBScript engine can be quickly registered by following these steps:
Run Command Prompt as administrator:
Start Menu -> All Programs -> Accessories
Right click on Command Prompt and select Run as administrator
Run the following command:
If you are using 32-bit version of Windows:
Type cd %windir%\system32 into the Command Prompt and hit Enter
If you are using 64-bit version of Windows:
Type cd %windir%\syswow64 into the Command Prompt and hit Enter
Type regsvr32 vbscript.dll into the Command Prompt and hit Enter.
If the above solution does not work, try the following alternative steps:
If you are using 32-bit version of Windows:
Run Command Prompt as administrator:
Start Menu -> All Programs -> Accessories
Right click on Command Prompt and select Run as administrator
Type the following command in the prompt: reg delete "HKCU\SOFTWARE \Classes\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}" /f, then hit Enter.
Next, you must also type the following command: c:\windows\system32\regsvr32 vbscript.dll, then hit Enter.
You should now be able to install your Nitro PDF software product.
If you are using 64-bit version of Windows:
Run Command Prompt as administrator:
Start Menu -> All Programs -> Accessories
Right click on Command Prompt and select Run as administrator
Type the following command in the prompt: reg delete "HKCU\SOFTWARE\Classes\Wow6432Node\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}" /f, then hit Enter.
Next, you must also type the following command: c:\windows\syswow64\regsvr32 vbscript.dll, then hit Enter.
You should now be able to install your Nitro PDF software product.
If the above solution does not work, try the following alternative steps:
If you are using 32-bit version of Windows:
Run Command Prompt as administrator:
Start Menu -> All Programs -> Accessories
Right click on Command Prompt and select Run as administrator
Type the following command in the prompt: reg delete "HKCU\SOFTWARE \Classes\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}" /f, then hit Enter.
Next, you must also type the following command: c:\windows\system32\regsvr32 vbscript.dll, then hit Enter.
You should now be able to install your Nitro PDF software product.
If you are using 64-bit version of Windows:
Run Command Prompt as administrator:
Start Menu -> All Programs -> Accessories
Right click on Command Prompt and select Run as administrator
Type the following command in the prompt: reg delete "HKCU\SOFTWARE\Classes\Wow6432Node\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}" /f, then hit Enter.
Next, you must also type the following command: c:\windows\syswow64\regsvr32 vbscript.dll, then hit Enter.
ref: http://kb.nitropdf.com/article.aspx?id=10106&cNode=3D8W4P
Friday, August 19, 2011
How to Install Webmin on Ubuntu 11.04
Recently I launched my own server and its the first time I have ever done this. Im running a Red Hat Linux server and I wanted to install Webmin, but I didnt really know how. Thus, I thought we would run through an installation guide of Wedmin, but this time on Ubuntu and the new Ubuntu 11.04.
Edit /etc/apt/sources.list file
sudo vi /etc/apt/sources.list
Add the following lines
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
Save and exit the file
Now you need to import GPG key
wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
Update the source list
sudo apt-get update
Install webmin
sudo apt-get install webmin
Now you need to access webmin using http://serverip:10000/ once it opens you should see similar to the following screen
Solved same issue with Mythbuntu 11.04 - The default webmin user was root, with an unknown password. This did not match my username and password set during install!
Ran this script to set it;
sudo /usr/share/webmin/changepass.pl /etc/webmin root "your-password"
Once in to the web, I added a new webmin user, to match my logon name. Hope this helps someone get it fixed!
Install drush ref: http://groups.drupal.org/node/23487
install drush in ubuntu $sudo apt-get install drush
install git in linux
http://help.github.com/linux-set-up-git/
Edit /etc/apt/sources.list file
sudo vi /etc/apt/sources.list
Add the following lines
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
Save and exit the file
Now you need to import GPG key
wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
Update the source list
sudo apt-get update
Install webmin
sudo apt-get install webmin
Now you need to access webmin using http://serverip:10000/ once it opens you should see similar to the following screen
Solved same issue with Mythbuntu 11.04 - The default webmin user was root, with an unknown password. This did not match my username and password set during install!
Ran this script to set it;
sudo /usr/share/webmin/changepass.pl /etc/webmin root "your-password"
Once in to the web, I added a new webmin user, to match my logon name. Hope this helps someone get it fixed!
Install drush ref: http://groups.drupal.org/node/23487
install drush in ubuntu $sudo apt-get install drush
install git in linux
http://help.github.com/linux-set-up-git/
Monday, July 11, 2011
How to enable CLR Stored procedures on SQL Server 2005 and 2008
EXEC sp_configure 'show advanced options' , '1';
reconfigure;
EXEC sp_configure 'clr enabled' , '1' ;
reconfigure;
EXEC sp_configure 'show advanced options' , '0';
reconfigure;
reconfigure;
EXEC sp_configure 'clr enabled' , '1' ;
reconfigure;
EXEC sp_configure 'show advanced options' , '0';
reconfigure;
Subscribe to:
Posts (Atom)
