howto | Brain Goo https://www.popmartian.com/tipsntricks Carpe Crap 'em Fri, 18 Feb 2011 15:17:33 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.10 SQL: Select duplicate rows, select indistinct rows https://www.popmartian.com/tipsntricks/2008/10/27/sql-select-duplicate-rows-select-indistinct-rows/ https://www.popmartian.com/tipsntricks/2008/10/27/sql-select-duplicate-rows-select-indistinct-rows/#comments Mon, 27 Oct 2008 16:09:29 +0000 http://www.popmartian.com/tipsntricks/?p=67 Using SQL, MySQL or whatever your favorite database may be, we all know using SELECT DISTINCT will return unique values in case a value appears more than once in a table. How do you fine duplicates? What if I want … Continue reading →

The post SQL: Select duplicate rows, select indistinct rows first appeared on Brain Goo.

]]>
Using SQL, MySQL or whatever your favorite database may be, we all know using SELECT DISTINCT will return unique values in case a value appears more than once in a table.

How do you fine duplicates? What if I want to know where the duplicates are?

The trick is to use count() and compare it to an integer.

SELECT count(*), locations.* FROM locations GROUP BY number HAVING COUNT(*) > 1

That will select a count of unique instances of a value from a table called “locations”, group them by a field called “number” where the count is greater than 1. In other words, it will return all the fields where there are more than one instance of the same value in the column “number”.

Did you find this post useful or have questions or comments? Please let me know!

The post SQL: Select duplicate rows, select indistinct rows first appeared on Brain Goo.

]]>
https://www.popmartian.com/tipsntricks/2008/10/27/sql-select-duplicate-rows-select-indistinct-rows/feed/ 1
Change or recover MySQL root password https://www.popmartian.com/tipsntricks/2008/09/22/change-or-recover-mysql-root-password/ https://www.popmartian.com/tipsntricks/2008/09/22/change-or-recover-mysql-root-password/#respond Mon, 22 Sep 2008 16:02:47 +0000 http://www.popmartian.com/tipsntricks/?p=41 To Change a Known Password If you know the current password, use one of these methods to reset it.  If you do not know, skip ahead to the next section. Using mysqladmin if there is no password: $ mysqladmin -u … Continue reading →

The post Change or recover MySQL root password first appeared on Brain Goo.

]]>
To Change a Known Password
If you know the current password, use one of these methods to reset it.  If you do not know, skip ahead to the next section.

Using mysqladmin if there is no password:

$ mysqladmin -u root password <new password>

Using mysqladmin if there is a password:
$ mysqladmin -u root -p <old password> <new password>

Using mysql shell if there is no password
mysql -u root
mysql> update user set password=PASSWORD("<new password>") where User='root';
mysql> flush privileges;
mysql> quit

Using mysql shell if there is a password
mysql -u root -p
Password: <old password>
mysql> update user set password=PASSWORD("<new password>") where User='root';
mysql> flush privileges;
mysql> quit

Recover/reset the password if you don’t know it
There is no way to recover the password if you don’t know it, but you can reset it to something new.
You must have root on the box for this.

  1. Kill the running server
  2. Create a text file with the following contents:
    UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
    FLUSH PRIVILEGES;
  3. Run the mysql_safe binary with the --init-file option pointing to your new file like this:
    mysqld_safe --init-file=/path/to/file &
  4. Delete the init file you created.
  5. Stop and start MySQL normally.

Did you find this post useful or have questions or comments?  Please let me know!

The post Change or recover MySQL root password first appeared on Brain Goo.

]]>
https://www.popmartian.com/tipsntricks/2008/09/22/change-or-recover-mysql-root-password/feed/ 0
Windows 2003 Update Group Policy https://www.popmartian.com/tipsntricks/2008/08/29/windows-2003-update-group-policy/ https://www.popmartian.com/tipsntricks/2008/08/29/windows-2003-update-group-policy/#respond Fri, 29 Aug 2008 20:33:28 +0000 http://www.popmartian.com/tipsntricks/?p=38 From Microsoft knowledgebase article http://support.microsoft.com/kb/298444 To update the group policy, run Gpupdate.exe from a cmd window.  This is refresh any changes in the Group Policy as they apply to that machine.  Run Gpupdate.exe /Force from a cmd window in order … Continue reading →

The post Windows 2003 Update Group Policy first appeared on Brain Goo.

]]>
From Microsoft knowledgebase article http://support.microsoft.com/kb/298444

To update the group policy, run Gpupdate.exe from a cmd window.  This is refresh any changes in the Group Policy as they apply to that machine.  Run Gpupdate.exe /Force from a cmd window in order to force a full refresh of the Group Policy.

You have to check Event Log -> Application to see if it actually succeeded.

Did you find this post useful or have questions or comments?  Please let me know!

The post Windows 2003 Update Group Policy first appeared on Brain Goo.

]]>
https://www.popmartian.com/tipsntricks/2008/08/29/windows-2003-update-group-policy/feed/ 0
calculate server btu output https://www.popmartian.com/tipsntricks/2008/07/28/calculate-server-btu-output/ https://www.popmartian.com/tipsntricks/2008/07/28/calculate-server-btu-output/#comments Mon, 28 Jul 2008 15:49:06 +0000 http://www.popmartian.com/tipsntricks/?p=22 This post was updated on 8/29/2008 to clarify a few things This is a heavily viewed page. Please leave me a comment if this was helpful or if something is missing or confusing.  I would like it to be more … Continue reading →

The post calculate server btu output first appeared on Brain Goo.

]]>

This post was updated on 8/29/2008 to clarify a few things

This is a heavily viewed page. Please leave me a comment if this was helpful or if something is missing or confusing.  I would like it to be more comprehensive.

I posted a simplified Watt-to-BTU post if you are not looking for server-specific information

Shouts to Lavrik for getting this started.

To calculate heat output (BTU) of your systems, you need to remember (or read below) your high school electrical class. There are three questions to answer.

  1. How much power am I going to draw?
  2. How much heat will that power useage generate?
  3. How much cooling do I need for that heat?

How much power am I going to draw?

Power is measured in Watts and used in math as the letter ‘P’. The formula for calculating power requires Volts (How much juice you can provide) and Amperes (How hard you suck on the straw).

Power in Watts (P) = Volts (V) * Current in Amperes (I) or:

P = V * I

If you know how many Watts your power supplies can feed and you know how much voltage you have, you can figure out your Amperes.

Take a simple server:

– A server with a 1000 Watt power supply.
– 208 Volt service.
– Running at theoretical maximum load.

P = 1000
V = 208
I = ?

I = P/V or 1000/208 = 4.8 Amperes

So now that you know how much you’re tugging on the grid, find out how much heat that will produce.

How much heat will that power usage generate?

BTUs or British Thermal Units are heat measurements. Generally measured in per-hour increments. In common usage 12,000 BTU/h is considered a Ton. This is important because we cool and heat over time so we need to know how much cooling to throw in to the room per hour.

1 Watt will produce 3.412 BTU per hour

To calculate the BTU/heat output of a system, substitute BTUs for Watts and use the following equation:

BTU/h = (V * I) * 3.412

Using the example server above running full blast in a sealed room with no air moving in and out and no heat loss through the walls you can do the math:

BTU/h = 3.412 x 1000 = 3412BTU/h

How much cooling do I need for that heat?

About 1/3 Ton of cooling is required to cool this system. However, your actual requirements will probably be lower because we can assume you won’t run the equipment at full capacity and there is some energy loss through the walls, ceiling and floors.

Using the techniques above, you can make a simple worksheet to calculate your total theoretical maximum cooling requirements. Don’t forget to take in to account other sources of heat. Ambient building temperature (do you have hot walls from the boiler in the next room?), lights, cooling compressor (it should list it’s heat output) and other equipment.

You can probably undercut your requirements if your equipment does not run at full capacity, but be sure you leave enough room to grow and to keep up in case a cooling unit fails or you experience a period of heavy load and you do use your gear at capacity.

Did you find this post useful or have questions or comments?  Please let me know!

The post calculate server btu output first appeared on Brain Goo.

]]>
https://www.popmartian.com/tipsntricks/2008/07/28/calculate-server-btu-output/feed/ 18