8Nov/100

The Lazy way of working with XML Namespaces in PhP

Please understand the title of this message, this is a total hack but a good one, one that takes the complex notion of working with XML namespaces and makes it easy. There is a big chance that this will not work for ever application but it may help some in overcoming parsing complex XML.

The concept is quite simple, remove that which is causing the problem by using a string replace. Lets take the parsing of the Twitter Geo location. Make sure when applying this that you've checked to see that replaced value is unique.

Problem Area:

<twitter:geo>
<georss:point>40.3815 -79.8598</georss:point>
</twitter:geo>

Fix: Apply a string replace to the entire XML response, good by troublesome colons.

$response = str_replace("twitter:geo", "twittergeo", $response);
$response = str_replace("twitter:", "", $response);
$response = str_replace("georss:point", "georsspoint", $response);

I encourage you to read on and understand how to do this properly, but if examples are your thing here are a few.

6Nov/109

PlanetLotus and the Unexpected Server Rebuild

It all started Wednesday when the dedicated server I have hosting all my websites went down and became totally unreachable. As a rule, if I can't ping it I automatically log into my account with the hosting provider and request a power cycle (server restart).

And then I got this email, moments later from the Network Violations Team...

Regarding your server:

After a review of your hosting account it appears your Virtual Dedicated Server has been compromised. It appears there was a vulnerable setup.php script in PhpMyAdmin. The server was compromised on at an administrative level on or before 10/06/2010, allowing attackers to upload multiple attack tools. These tools resulted in complaints by our abuse department, once notified our security team immediately disabled the process and removed the attack tools. This server must be re provisioned to avoid further issues.

I actually only read or saw one word... "re provisioned" and didn't want to believe what it actually meant. So I dropped a dime and called, fuming.

I was that guy, saying everything I could to get them to reconsider, even escalating it, to no avail, all i wanted was a little more time to get some important files before reformatting. They said no... and then an amazing thing happened.

It turns out,  **lack of internal communication saved the day. The server reboot team didn't' get the word from the network violations team, so my server was back on and I was pulling down files faster then you can say efilnikufesin.

I waited it out, the second shut down, and took my time  moving all my non-vital domains to a hosted service. My main server goes down a lot. It's really just me supporting it and is a single source of failure so it goes down or, gets 'infected' occasionally. Hardware failures, hacks, stupid mistakes, it happens, a server room I have not.

So the rest of the story, if you're still reading, (I know Andrew is), the hacker exploited the phpMyAdmin setup.php file. I guess it's pretty common, and used it to upload a bunch of hacking tools. The network violations team removed all the tools but shut it down and forced a reprovision because they couldn't be sure they removed them all.

I get it, however the problem I have is, yes, you could say it's my problem, <rant from a Linux novice> a "zero day" issue but my server has Fedora 8 and every time I update the packages they're up to date. Even yesterday I tried, everything's current... the reprovision offering, the "Team" wants me to move to, Fedora 8.  So what is stopping the same person from exploiting the same issue? Only time will tell. </rant from a Linux novice>

Email #2 from the Network Violations Team:

We have included the log files as well as a list of the files that appear to be causing the attack. The vulnerability in the phpMyAdmin script allowed the upload of these files. These vulnerabilities are common in open-source PHP applications and it is strongly recommended that you keep all applications updated and patched with the latest security and application upgrades to prevent this from happening again. <plug>If you need assistance upgrading or patching an application we have a pay-per-use administrative service where we will do this for you.</plug>

In order to resolve the current issue the server must be re-provisioned. I reviewed the issue with several peers and admins and there is no other solution that would work.

FOUND ATTACK TOOLS
<removed just in case it helps some one do evil>

PHPMYADMIN EXPLOITATION

<removed just in case it helps some one do evil>[etc...]

I've changed around the IP numbers but you get the drift, update your packages, brush you teeth, eat an apple, blah, blah, blah. Until next hack, thanks for reading.

** There could be a small chance, OK, very small chance that the tech I spoke with let the server reboot slide. If so, the guy made my week, and Thank you, cool tech guy, if you ever come across this! (you never know).

6Nov/100

Cannot load mcrypt extension. Please check your PHP configuration.

Here is a quick little tip on how to remove the "Cannot load mcrypt extension. Please check your PHP configuration." message from your phpMyAdmin login window on a Fedora 8 Linux Dedicated or maybe even virtual dedicated server at Godaddy.

1. Open a ssh session. Switch to root.

2. Run each line individually (or copy each one and right click on the ssh window (putty)).

yum install libmcrypt
yum install php-mcrypt
yum install php-mhash

I didn't have to restart http but you might want to for grins.

A big nod to wayan on this one, and PS, don't search for GoDaddy images on Google while at work :)

7Oct/101

Travel Mode needed for Posterous

Posterous needs a Travel Mode. We all know that people have been targeted for burglaries based on social media postings. The practice is pretty strightforeward. Someone posts about the vacation they're on and a 'friend' robs them.

This is compounded on Posterous with a public facing blog. I don't feel comfortable posting pictures while I'm on business but really, really want to... so how about a mode that you can turn on 'Traveling'. You can send in pictures and capture the titles, content and times but they're queued until you return and turn the mode back off. Your feed is then updated with all the posts, with the original time stamps.

I realize you can set a future date to have your posts published but it's not intuitive, this would be a blanket mode.

If anyone is reading this from Posterous, I love your platform! If you are not from Posterous, you really must check out their offering for your next blog.

7Oct/100

How to recover the Salesforce iPhone passcode

I coudn't find anyting on the web so here is what i did to resolve this.

Max out your passcode attempts. You will then get a message saying all your local data will be erased. You are then prompted to login with your salesforce user name and password (the one you use with your browser). You can then pick a new passcode.

I only use the iPhone app to check events and look up numbers so any local data is of no use to me; hopefully you too.

Tagged as: No Comments
23Sep/100

How to get Microsoft SQL Server databases sizes

I found this fantastic script of all places in the comment of someones blog post. It does a great job of laying out all the size detail for all the databases on your sql server.

SELECT DB_NAME(mf.database_id) AS databaseName
,mf.physical_name
,num_of_reads
,num_of_bytes_read
,io_stall_read_ms
,num_of_writes
,num_of_bytes_written
,io_stall_write_ms
,io_stall
,size_on_disk_bytes
FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS divfs
JOIN sys.master_files AS mf ON mf.database_id = divfs.database_id
AND mf.file_id = divfs.file_id
ORDER BY 3 DESC

A great follow on to this is a File Size Calculator to help make scene of the sizes, especially if you're working with large database (i.e., SharePoint :)

Thanks pinaldave and Jerry Hung.

11Aug/105

Yellow Day: Introducing the Domino Directory!

The Domino Directory is a showcase of sites build on Domino.

A place to show off your creation, promote your site or just point people to to see the potential of Domino.

Anyone can post a new site. There is a small team of editors to make sure your site submission is valid and complete.

The editorial team has been hard at work over the past couple months adding site, if you're site is not there add it, if you don't like the info on your site, create a new, better entry and add "UPDATE" to the post title.

A voting system has been added to identify the best site out there so go check out some new site design ideas and vote for your favorites sites today!

http://www.dominodirectory.com

10Aug/100

Using Visualization for Optimal Performance

It turns out I've done this in the past, used visualization to plot my performance before a race, but only informally. What I've never done is use it purposely before the event or just as important during the event.

After a conversation with a coworker that's used it in the past i figured id try it for an event i did this past weekend. I spent about 5 solid minutes, not too much time; visualizing my effort all the way through. I knew the course so it made it easier, I'll have to test this on unknown effort in the future.

Next, the performance itself. I had a stretch goal of riding the first 100 miles of a 110 mile ride in under 5 hours. This goal was on the line at mile 90, my average speed read 20.0 and I was racing to make sure it didn't dip. I stayed focused on how i would feel when the odometer turned over to 100 miles, actually visualized myself raising my arms in victory and rehearsing what i would scream out.

It was working so well that before i got to the 95 mile mark the avg. moved up to 20.1 giving me some much needed insurance and then 5 miles later success where I lifted my arms yelled out something ridiculous for others to hear and all in the world was in harmony.

Results may vary, see dealer for details.

9Aug/101

Bike Fit Calculator

If you're looking to get a bike you need to start with the type and size. The type is easy, road, mountain, etc. The difficult part is figuring out what size to purchase, order, borrow, steal...

Help is out there and it can be done in the comfort of your own home with the help of a close friend.

This online fit calculator seems to to be the best out there and has helped many a friend; including myself get a perfect sized bike.

Last note, when you get that ideal bike you want to nail all the measurements, not just frame size but also, crank arm length, handle bar width and stem length. The more you can match the less you'll after to upgrade when you find your bike is uncomfortable.

http://www.competitivecyclist.com/za/CCY?PAGE=FIT_CALCULATOR_INTRO

Filed under: Cycling 1 Comment
16Jul/101

How to change the default boot OS in GRUB – Ubuntu

If you're doing a dual boot and you want to change the default operating system that comes up, o' say, during a unplanned restart, you can do this with the Startup Manager, this will then make the change in *GRUB. Just do the following: (If you know of an easier way for amateurs please comment below details.)

Go to System / Administration / Synaptic Package Manager and search for StartUp Manager. Install it then go to it under System / StartUp-Manager and change the Default operating system as seen below. The change will occur the next time you boot.

* GNU GRUB (short for GNU GRand Unified Bootloader) is a boot loader package from the GNU Project. GRUB (shortened form of GNU GRUB) is the reference implementation of the Multiboot Specification, which enables a user to have multiple operating systems on his computer, and choose which one to run when the computer starts. GRUB can be used to select from different kernel images available on a particular operating system's partitions, as well as pass boot-time parameters to such kernels. (From Wikipedia, the free encyclopedia)

Tagged as: , , 1 Comment