WordPress admin login

After reading on the SANS website about a dirty process of using distributed wordpress as from here. One of the ways to make sure that the user cannot keep on trying to use brute force to access your site is to set the password randomly, I use this website pctools which comes up with a very nice password for you.

Also within the brute force attach they are using the username of admin to try and login so you could change the admin username.

UPDATE wp_users SET user_login = '<insert name here>' WHERE user_login = 'admin';

Of course if you have setup the pre table name of wp_ instead it would be users table name.

Multiplication

Whilst I was understanding the bits structure of binary values I did come across the page from here about how to do multiplication with binary values and thought that I might as well do it in c++ to understand abit more about the process.

The main part from that page above is

Rules of Binary Multiplication

  • 0 x 0 = 0
  • 0 x 1 = 0
  • 1 x 0 = 0
  • 1 x 1 = 1, and no carry or borrow bits

For example,

00101001

Call a function

Lets just say that you are writing a template program and you want to add into a array of function calls, which you can add to as well on-the-fly. Within PHP you can use a function called call_user_func which allows you to call a function using a stringed parameter in the first parameter and the next parameter(s) (if you wish to pass more than one parameter) is next. Hopefully the below will demonstrate better.

<?php
  function test($var)
  {
    echo "test : " . $var;
  }
 
  function example($var)
  {
    echo "example : " . $var;
  }
 
  $funarr = array(array("test", "codingfriends"), array("example", "was here"));
 
  foreach ($funarr as $funarr_call)
  {
    call_user_func($funarr_call[0], $funarr_call[1]);
    echo "<br/>";
  }
?>

and the output would be

test : codingfriends
example : was here

Conditions – true or false

When you want to do a test against true or false with a integer value. Basically 0 is false and anything else is true, as demonstrated below.

#include <stdlib.h>
#include <iostream>
 
using namespace std;
 
int main()
{
  for (int i = -10; i < 10; i++)
  {
      if (i) 
	  cout << "true " << i << endl;
      else
	  cout << "false " << i << endl;
  }
}

and the output of this is, the true/false values is after the if statement.

true -10
true -9
true -8
true -7
true -6
true -5
true -4
true -3
true -2
true -1
false 0
true 1
true 2
true 3
true 4
true 5
true 6
true 7
true 8
true 9

4GB – 32bit northbridge BAR1 error

With the Laptop that I have, it appears to have a 32 bit northbridge with a 64 bit cpu’s, I have logged this error with the PCI kernel group because hopefully they will be able to give some advice and also I am giving data back to the Linux group on the whole.

Shall put any advice on the kernel PCI group list back on this page regarding the error, if anyone wants to look over the 2GB/4GB dmesg + /proc/iomem files just say.

“I have a acer aspire 9815 with from what I have read a 32bit Northbridge and when you add 4GB of RAM with a nVidia 256 of “virtual
ram” causes a base address registers (BAR1), but works fine with 2GB because there is a problem with the way that Linux kernel is
allocating the memory associated with the devices and places then out of range.

Here is my lspci for the PCI host bridge

Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and
945GT Express Memory Controller Hub (rev 03)
PCI bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and
945GT Express PCI Express Root Port (rev 03)

From this website it appears that some one was trying to update the PCI IOMEM part of the kernl

http://tjworld.net/wiki/Linux/PCIDynamicResourceAllocationManagement

but says that it will be in the .30 / .31 kernel but I am not able to still use the 4GB of ram and I am using the 2.6.31-10-generic
#35-Ubuntu SMP Tue Sep 22 17:33:42 UTC 2009 i686 GNU/Linux from a kubuntu 9.10 setup and was hoping to have the fix already applied.

Was wondering since I am using the k/ubuntu kernel does the “real” kernel have the PCI IOMEM Upgrade ? or do I have pass some kernel
parameters on grub to allow for this to work correctly ? or has there been another upgrade to the PCI structure that will come in a later
release ?

Also there was some advice to update the BIOS for some laptops and set the upper memory limit, does this make the PC memory have a virtual
head to it and thus the OS will not see the rest of RAM ? or is it just for the PCI setup aspects that look at the upper memory limit and
the rest of the OS can see the and use the rest of the RAM ?

Any advice would be great.”

UPDATE

The only advice was that how about trying out the 64bit kernel, which is what I am using.

Firefox – Show results from navigation bar

In Firefox the navigation bar will display the first search result if you type in something that is not a valid URL, e.g. if you type in CodingFriends.com then it will display codingfriends.com web site, but if you typed in codingfriends then it would display the first result which is this website.

But to alter the default settings in the navigation bar so that it will display your favorite search engine, I use Google search engine.

If you type in the navigation bar

about:config

This will display

about:config
about:config

Once you have clicked the button, then do a search for

keyword.URL

Double click on the value (the one on the right) and change

http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=

To

http://www.google.com/search?q=

You are taking out the gfns=1, which means goto the first result.
I have taken more than the gfns because the rest are encoding standards for text.

SugarCRM hook – what are they

SugarCRM is a very nice and open source CRM (Customer relationship management) system. And with being open source means that you are able to alter the internals of it and also are able to write modules for it easier than closed source applications because you can follow the direction of things if you are for example debugging etc.

The hooks part of the sugarCRM setup allows to place your own code into the base code at set parts of execution e.g. after retrieve of data, or post processing of data updates.

Here is a link to the sugarcrm site of hooks definitions. Basically there is 3 main types, with subhooks attached to those types.

  • Application hooks
    • after_ui_frame – Fired after the frame has been invoked and before the footer has been invoked
    • after_ui_footer – Fired after the footer has been invoked
    • server_round_trip – Fired at the end of every SugarCRM page
  • Module hooks
    • before_delete – Fired before a record is deleted
    • after_delete – Fired after a record is deleted
    • before_restore – Fired before a record is undeleted
    • after_restore – Fired after a record is undeleted
    • after_retrieve – Fired after a record has been retrieved from the database. This hook does not fire when you create a new record.
    • before_save – Fired before a record is saved.
    • after_save – Fired after a record is saved.
    • process_record – Fired immediately prior to the database query resulting in a record being made current. This gives developers an opportunity to examine and tailor the underlying queries. This is also a perfect place to set values in a record