Useful command lines to access different parts of Windows Control Panel

Use these commands (.cpl) to gain fast access to different part of the Windows Control Panel:

How to limit the memory size for PHP?

You can increase or decrease the memory size limit for php through the .htaccess file with the following command :

Connect to another database in WordPress using the wpdb class

In WordPress the $wpdb object can talk to any number of tables, but only within database WordPress is installed. In case you need to connect to another database, you will have to instantiate your own object from the wpdb class with the appropriate connection details:

 

Once the connection is made you can access the database and its tables as you would in any WordPress database:

This code can be in plugins, templates, themes and almost anywhere else inside the WordPress code.

Get size of MySQL database using SELECT statement

Use this MySQL to get size of database:

 

 

 

Ubuntu: Switch to Console mode from GUI mode in GNOME

To switch from GUI mode to Console mode in GNOME use these shortcuts

 

To switch to Console mode:

Press ‘Ctrl + Alt + F1′ (F2 – F6)

 

To switch between consoles in Console mode

Press ‘Alt + F1′ (F2 – F6)

 

To switch back to GNOME GUI mode

Press ‘Alt + F7′

 

Create Event Source with PowerShell

To create a Event Source in PowerShell use this:

Get more info on CreateEventSource method here : http://msdn.microsoft.com/en-us/library/2awhba7a.aspx

 

In PowerShell 2.0 this is even simpler:

 

Handling attributes with hyphens in PowerShell

Sometimes we need working with PowerShell objects which have attributes with hyphens. That can be a bit difficult as PowerShell assumes hyphens are used with operators and parameters.

Below is an example on how to get around this, and rename the attribute:

 

 

 

 

Enumerate COM classes using WMI

 

Quick and short way of enumerating COM classes is using the WMI class Win32_ClassicComClassSetting.

Example:

 

 

Fun with Microsoft Agent and PowerShell

Show Merlin:

List animations:

 

Activate animation:

 

Have Merlin tell when process was started:

 

Microsoft Agent is being deprecated and will not be included in future versions of the Windows operating system.

EventLog: Determine Windows startup (Event Log Service)

To determine when Windows was started search for Event ID 6005 in the System Event Log. The entry should look like this: