Archive for October, 2009

Possible DOS attack caught on time

Thursday, October 22nd, 2009

My server suddenly went under a very heavy load, similar with a DOS (Denial Of Service) attack. Luckily I was 1 foot away form it and heard the hard-drive working like crazy so I ssh-ed in the server, checked the running processes, noticed it was a high load on mysql (only possible via web), did a netstat, found the offending IP and temporarely -j DROP-ped it out with iptables. the load stopped suddenly so my finding was right.

this is the offending ip: 85.92.222.254
anyone know the guy behind it, hit him hard in the head.
will see if he returns and if he does, the -j DROP will become permanent.
Just for the record I currently have 7 IPs with permanent -j DROP . I should probably remove them since they are pretty old and with the use of DHCP the IPs probably belong to a ton of other people now.

Related posts

Huge album with photos from India

Sunday, October 11th, 2009

I have started to share my photos from the trip I took to India in 2006.
There are a lot of photos there, just as a glimpse, in the second day there I took about 800 pictures.
I will share most of them, but in time. Right now I am working on the second day and that will be it for today and probably for the next following days/weeks.

Enjoy.

Related posts

A special photo gallery

Sunday, October 11th, 2009

I feel like I’m going mad. Ever since I started putting my stuff on the net I found that existing web software solutions did not provide what I need. Not even the commercial ones.
Like now, here I am, again, facing my 20k+ photos and trying yet again to manage them using gallery2. But I have a very special need when it comes to photos:
– some photos I don’t want nobody to see. so they’re private
– others, only a few people can see
– others, just a few group of people
– others must be deleted
– and finally, the rest can be seen by the wide public

now, in order to easily support this, I’ve made 5 albums:
– 1 that contains all unsorted photos and which is totally private
– 1 which is my private album
– 1 that is totally public
– 1 that is only for family
– 1 that is for family and friends only

now, when I go into sorting the photos, I need to create sub-albums in most of the main albums and then:
– go over all photos in the managed album and delete what is not needed
– again go over all (remaining) photos in that album and move the needed one to my public
– again go over all (remaining) photos in that album and move the needed one to family only
– again go over all (remaining) photos in that album and move the needed one to family and friends
– move all remaining photos to my private album

so basically I am iterating the photos like 3 to 5 times. It is ANNOYING.

But there is another annoying part. Imagine you’re a family member. That means you have access to 3 albums that contain *related* photos. now that sucks.

The alternative for this is to keep all photos in once place, BUT, manually edit each and every single photos permissions to suit the restrictions on it. 20.000. photos. Twenty THOUSAND photos. If it takes 1 minute per photo, this equals a total of almost 14 continuous DAYS. to be more realistic, using this technique and say 3 hours per day, it means I’d be done in about 111 days. almost 4 months.

It’s a killer because I don’t have 3 hours every single day for this task.

which means I will be writing my own gallery software most likely based on joomla 😀

Cheers.

Related posts

JOOMSUITE 1.4.5: how to add SEF to file downloads [UPDATE]

Monday, October 5th, 2009

This is an update for http://blog.ciuly.com/website/joomsuite-how-to-add-sef-to-file-downloads/ which is valid for joomsuite 1.4.0

You need to edit 3 files and add url rewrite rules.
/components/com_resource/controller.php:373 (download function)

// Ciuly – file SEF
$fn = basename($res->field_value);
if (JRequest::getInt(‘timestamp’)==1){
$a = explode(‘_’, $fn, 2);
$fn = $a[1];
}
if($browser==’IE’) {
header(‘Content-Disposition: attachment; filename=”‘.$fn.'”‘);
header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0’);
header(‘Pragma: public’);
} else {
header(‘Content-Disposition: attachment; filename=”‘.$fn.'”‘);
header(‘Cache-Control: no-cache, must-revalidate’);
header(‘Pragma: no-cache’);
}

./components/com_resource/controller.php:495 (download2 function, after adding above code)

// Ciuly – file SEF
$fn = basename($res->field_value);
if (JRequest::getInt(‘timestamp’)==1){
$a = explode(‘_’, $fn, 2);
$fn = $a[1];
}
if($browser==’IE’) {
header(‘Content-Disposition: attachment; filename=”‘.$fn.'”‘);
header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0’);
header(‘Pragma: public’);
} else {
header(‘Content-Disposition: attachment; filename=”‘.$fn.'”‘);
header(‘Cache-Control: no-cache, must-revalidate’);
header(‘Pragma: no-cache’);
}

./components/com_resource/controllers/article.php:855 (download_attachment function)

// Ciuly – file SEF
$fn = basename($comment->attachmente);
if (JRequest::getInt(‘timestamp’)){
$a = explode(‘_’, $fn, 2);
$fn = $a[1];
}
if($browser==’IE’) {
header(‘Content-Disposition: attachment; filename=”‘.$fn.'”‘);
header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0’);
header(‘Pragma: public’);
} else {
header(‘Content-Disposition: attachment; filename=”‘.$fn.'”‘);
header(‘Cache-Control: no-cache, must-revalidate’);
header(‘Pragma: no-cache’);
}

./plugins/joomsuite_content_fields/file.php:227 (onRenderFieldValue function)
if($params->get(‘show_name’))
{
// Ciuly – make it SEF
if (JROUTER_MODE_SEF)
$download = JURI::base().”download.php/$field->id/”;

$label = basename($field->field_value);
// Ciuly – remove timestamp from display
if ($params->get(‘attach’)){
$a = explode(‘_’, $label, 2);
$label = $a[1];
if (JROUTER_MODE_SEF)
$download = $download . “1/”;
else
$download = $download . “&timestamp=1”;
} else
if (JROUTER_MODE_SEF)
$download = $download . “0/”;
if (JROUTER_MODE_SEF)
$download = $download . $label;
}
else {
$label = $field->title;
}

and finally, url rewrite:
RewriteEngine on
RewriteRule ^/download.php/([0-9]+)/([0-1])/.*$ /index2.php?option=com_resource&task=download&no_html=1&file=$1&timestamp=$2

Related posts

Problem with article file display fixed

Monday, October 5th, 2009

I managed to find and fix the problem that prevented the files from being displayed in the articles on my site.
Long story short, everything should be back to normal now.

Related posts

Joomla issue with articles not showing partially fixed.

Monday, October 5th, 2009

Ever since I switched my site to joomla, my articles were not showing to the public, only to registered users.
I was informed about this issue about a week ago or so. Very late but I’m glad I was informed about it eventually.
So I logged a bug with joomsuite resources (which is the component that actually manages the articles) and I finally got the solution by upgrading to the latest version of that component.
Right now, the articles are showing, the text is there, but the files are not shown. I hope to get this fixed ASAP.

Sorry for the trouble for those who were expecting things to be there. This also got me loose a few rankings in google. Stupid thing.

Related posts