are.ehibou.com

May 19, 2006

Linux Forgotten Root Password Recovery

Filed under: Side Notes — admin @ 2:08 pm

There is plenty of ways, how to recover forgotten Linux password. My method is:

1. Burn Knoppix Linux CD (See www.Knoppix.org website)

2. Start the system useing just burned CD.

3. In console window type:

sudo mount -o remount,rw

4. Navigate to your Linux system folder – /etc/

5. Open the file named shadow and delete hashed password data from the Root user record or copy some known hashed password from some known user record to the Root user record.

Thats it.

  • Share/Bookmark

May 3, 2006

XSLT and XPath selecting distinct nodes

Filed under: Side Notes — admin @ 6:54 pm

It is a complicated task to select distinct nodes or to use grouping useing xslt. There are no simple syntax to write this type XPath query.

The work arround is quite difficult to remember, thats why i decided to duplicate internet content in my blog.

Let’s say, that the XML source is:

[root]
[MyData attribute1="15" attribute2="value1"/]
[MyData attribute1="14" attribute2="value2"/]
[MyData attribute1="12" attribute2="value3"/]
[MyData attribute1="15" attribute2="value4"/]
[MyData attribute1="14" attribute2="value5"/]
[MyData attribute1="12" attribute2="value6"/]
[MyData attribute1="15" attribute2="value7"/]
[MyData attribute1="15" attribute2="value8"/]
[/root]

Lets say, that the task is to select distinct nodes grouping by attribute1.The Xpath will look like this:

//MyData[not(@attribute1=preceding-sibling::MyData/@attribute1)]/@attribute1
  • Share/Bookmark

Powered by WordPress