Drop all connections to a database

November 7, 2011 Posted by ddobei

If you want to drop all the connections to a database immediately, you can use the following commands:

USE master
GO
ALTER DATABASE database name
SET OFFLINE WITH ROLLBACK IMMEDIATE
ALTER DATABASE database name
SET ONLINE

Alternatively you can kill all the processes using a database with this code:
(more…)

Backup/Restore MySQL database

April 12, 2011 Posted by ross

Restore database from sql dump:

mysql -u root -p Customers < custback.sql
Password: *****

go….

Aptana – Disable .tmp files

April 1, 2011 Posted by admin

Developing PHP projects i came across a nasty problem – Aptana leaves lots of .tmp files inside folders.

Still, it is really easy to disable this behavior. Just follow these steps:

  • Open Aptana
  • Select Window / Preferences in the main menu
  • Under Aptana / Editors / HTML – select Source only
  • Under Aptana / Editors / PHP – select Source only

Howto check Windows 7 version and build number?

March 30, 2011 Posted by admin

Are you trying to find the Windows Version of the windows product that you are running on your PC?
This can be easily done like this:

  • Click Start, type regedit and press Enter to open the Windows registry
  • Navigate to the registry key – HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion

On the right panel, you will find the key CurrentBuildNumber.The value of this key is your Windows Build Number. Then find a key called CurrentVersion and its value is your windows version i.e. the version of your windows vista, windows xp, etc. You will also find keys called EditionID and ProductId to know the windows edition and product id.

The key BuildLabEx containd build number and revision number.For example, in the value 7600.16617.amd64fre.win7_gdr.100618-1621, the first four digits stand for build number i.e. 7600 and the next five digits stand for windows revision number i.e. 16617.  amd64fre tells you that you are running a 64-bit operating system.

so, whenever you want to find the Windows Version or Build Number, follow the steps outlined above to determine the same. Thereby ensure that you are running only a genuine build and not a fake one.

ProxyPass to IIS SSL (443)

May 27, 2010 Posted by ross

On my development server I host both Apache and IIS7 websites. Because there is only one physical IP address and it is not possible to make Apache and IIS7 listen simultaneously on 80 port, I decided to put Apache on <real_ip>:80, while keeping IIS7 on 127.0.0.3:80 so they don’t interfere. When a request comes from outside to a site that is hosted on IIS7, Apche mod_proxy module will proxy all traffic to 127.0.0.3:80, so IIS7 and Apache could reside on one system.

The problems came when trying to proxy SSL traffic. With default configuration it simply did not work.

(more…)

Configuring HTTPS SSL (port 443) connection on IIS7 on several hostnames

May 26, 2010 Posted by ross

Recently my friend asked me to set up a HTTPS connection for his BlogEngine site, as he did not want anybody to sniff out the traffic used for managing the blog.
The following tutorial will help you to accomplish the task. My configuration is Windows x64 2008 SP2  + IIS7.

(more…)

Cannot remove the domain “<domain name>” because it is referenced by the proxy address template “smtp:@<domain name>”

May 7, 2010 Posted by ross

After migrating my Exchange 2003 server to Exchange 2007 I found out that some of the “Accepted Domains” are obsolete. But trying to remove them gave an error:

Cannot remove the domain ‘<domain name>’ because it is referenced by the proxy address template ’smtp:@<domain name>’

(more…)

Creating a MySQL user

April 18, 2010 Posted by ross

Starting from MySQL 5.0.2 creating new users in MySQL database is not complicated any more.

CREATE USER ‘user1′@’localhost’ IDENTIFIED BY ‘pass1′;

Fixing orphaned users in MSSQL 2005/2008

April 17, 2010 Posted by ross

Often after restoring MSSQL database to a new location, you have to manually recreate all logins used on the source system. After creating logins you also realize that mapping them to existing users in database is not possible, because these users already exist in the database.
(more…)

Configure firewall in Windows 2008 to access SQL server

April 17, 2010 Posted by ross

Firewall in Windows 2008 Server definitely became more “advanced” – got a new look and a bundle and is more sophisticated in configuration.

By default when you install MS SQL Server 2005 / 2008 firewall does not make any changes to allow inbound connections to SQL services.

To enable access to SQL server from the network, one has to do 2 things:
1. Ensure SQL server instance is configured to use static port (e.x. standard 1433)
2. Set appropriate firewall rules.

(more…)