DoS Attack on WordPress

The last couple of days my WordPress site has been getting hit by a DoS attack from a single IP address trying to access the ‘xmlrpc.php‘ page. Even though the page is not there it was still causing a lot of slow down processing the request.

Once I had established the source address, a quick google search gave me a solution to block the address through linux’s iptables.

sudo apt-get install iptables
iptables -A INPUT -s IP_ADDRESS -j DROP

Done and done. Now let’s just hope that my site hasn’t been added to a list somewhere and I get pummelled from somewhere else.

Web Developer

I am a web developer located in Coleraine, on the north coast of Ireland. I have been developing commercially for the web since 2005. I have worked in the public and the private sectors and in various business types from charity promotion to chemical compliance data management.

My blog is a record of things I have learned and problems I have solved. The posts may seem unrelated but that is mostly due to the fact that I continue to learn new technologies and approaches.

Maybe you will find something of interest. If you would like to know more about me or some things I have worked on, there is additional information on other profiles.

Share a web page on social media platforms

Recently I was working on a site that required the main page to be shared via lots of different social media platforms. Here are some of the urls I used. Customise the url and use it with any page on your website for each social media platform.

Share on…

Facebook

https://www.facebook.com/sharer/sharer.php?app_id=APP_ID_FROM_FACEBOOK&sdk=joey&u=URL_TO_SHARE&display=popup&ref=plugin

Facebook Feed

https://www.facebook.com/dialog/feed?app_id=APP_ID_FROM_FACEBOOK&ref=site&display=page&name=NAME&caption=CAPTION&description=DESCRIPTION&picture=IMAGE&link=URL_TO_SHARE&redirect_uri=SITE_URL_FROM_APP_SETTINGS

Twitter

https://twitter.com/intent/tweet?text=SET TWEET TEXT HERE WITH - URL_TO_SHARE"

Pinterest

http://pinterest.com/pin/create/button/?url=URL_TO_SHARE&media=URL_OF_PIC_TO_SHARE&description=OPTIONAL_DESCRIPTION

Google Plus

https://plus.google.com/share?url=URL_TO_SHARE"

linkedin

http://www.linkedin.com/shareArticle?mini=true&url=URL_TO_SHARE

StumbleUpon

http://www.stumbleupon.com/submit?url=URL_TO_SHARE&title=OPTIONAL_TITLE

These can be added to any hyperlink and the link customised to look how you would like e.g.

facebook share button

Here is an extra tip. If you want to see how a particular url will display as a Facebook share, check out the Facebook debug tool https://developers.facebook.com/tools/debug/.

Compiler issues after upgrading to XCode 4.2 or higher

There have been some issues with moving from XCode 4.2 to 4.3 or higher and possibly in the process of moving from Leopard to Lion or Mountain Lion. This is due to the compilers being moved or renamed. The following may help you to resolve such issues.

cd /usr/bin
sudo ln -s llvm-gcc-4.2 gcc-4.2
sudo ln -s llvm-g++-4.2 g++-4.2
sudo ln -s llvm-c++-4.2 c++-4.2

You will need to have command line tools for XCode installed. There may also be things that you need to reinstall after fixing the compiler issue. e.g. I had to reinstall imagemagick using brew. see http://gist.github.com/3177887

Apparently there were also issues with moving from XCode 4.1 to XCode 4.2 because gcc-4.2 was removed in favour of llvm-gcc-4.2