JUST OPEN SOURCE MATTERS!

September 8, 2008

How do I disable the ping response?

Filed under: Fedora, linux, open source, Ubuntu, Uncategorized — Tags: — egoleo @ 3:37 pm

Usually a ping is used to check if a machine is up and to check the network status.

It is a small network packet sent to the machine. If the machine is up, an answer will be sent. The time needed to get the answer is called ping time or round-trip time.

The ping response from an IP indicates the machine is up.

Unfortunately this can be used to quickly scan an IP-range for reachable hosts.

This can be used to find potential hackable machines. If your machine doesn’t answer to pings, your chance to be seen is reduced. (That doesn’t mean your machine is more secure, the machine is just not that easy to be seen from the internet. Nothing more.)

Add the following line to your init script for the network (the name depends on the distribution you use):

echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all

This disables ping responses.

To reenable, use the following command:

echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_all

To make this permanent set the following into /etc/sysctl.conf (if you have such a file)

net.ipv4.conf.icmp_echo_ignore_all = 1

Custom teaser length by View using node.tpl.php

Filed under: drupal, open source — Tags: , , , , — egoleo @ 5:23 am

I have been working on this project, http://www.newsafrican.com which is a news site which focuses on everything african news. This project is been built on the Drupal CMS which is very flexible arguably.

I got into a situation where i have to customise the teaser length by View which happens to be one of the Drupal modules using node.tpl.php.

One way to vary teaser lengths is to check the current View with a modified node.tpl.php modify the output based on this

In this example a teaser of length 75 or 150 will be shown for the Views “frontpage” and “ghana_page” respectively.

I worked on this for Drupal 5 with the help of the good guys in the drupal IRC rooms, my solution is below. But this is a solution for Drupal 6 by friends on the drupal-support channel of IRC.

<div class="node<?php print ($sticky) ? " sticky" : ""; ?>">
<?php if ($page == 0): ?>
<?php else: ?>
<?php print $picture ?>
<em class="info"><?php print $submitted ?></em>
<?php endif; ?>

<?php
global $current_view;
if(
$teaser) {
if(
$current_view->name == ‘frontpage’)
{
?>

<?php foreach ((array)$node->field_news_image as $item) { ?>
<div class=”field-item”><?php print $item[‘view’] ?></div>
<?php } ?>
<h2><a href=”<?php print $node_url ?>” title=”<?php print $title ?>“><?php print $title ?></a></h2>
<?php print $node->content[‘body’][‘#value’];
}

if($current_view->name == ‘ghana_page’)
{
?>
<?php foreach ((array)$node->field_news_image as $item) { ?>
<div class=”field-item”><?php print $item[‘view’] ?></div>
<?php } ?>
<h2><a href=”<?php print $node_url ?>” title=”<?php print $title ?>“><?php print $title ?></a></h2>
<?php print $node->content[‘body’][‘#value’];
}

if($current_view->name == ‘africa_page’)
{
?>
<?php foreach ((array)$node->field_news_image as $item) { ?>
<div class=”field-item”><?php print $item[‘view’] ?></div>
<?php } ?>
<h2><a href=”<?php print $node_url ?>” title=”<?php print $title ?>“><?php print $title ?></a></h2>
<?php print $node->content[‘body’][‘#value’];
}
if(
$current_view->name == ‘business_page’)
{
?>

<?php foreach ((array)$node->field_news_image as $item) { ?>
<div class=”field-item”><?php print $item[‘view’] ?></div>
<?php } ?>
<h2><a href=”<?php print $node_url ?>” title=”<?php print $title ?>“><?php print $title ?></a></h2>
<?php print $node->content[‘body’][‘#value’];
}

if($current_view->name == ‘gh1’ || $current_view->name == ‘gh2’)
{
?>
<?php foreach ((array)$node->field_news_image as $item) { ?>
<div class=”field-item”><?php print $item[‘view’] ?></div>
<?php } ?>
<h2><a href=”<?php print $node_url ?>” title=”<?php print $title ?>“><?php print $title ?></a></h2>
<?php print substr($node->content[‘body’][‘#value’], 0, 90). ‘&nbsp;’;
?>
<a href=”<?php print $node_url ?>” title=”read more”>read more</a><?php
}
} else {
print
$content;
}
?>

September 2, 2008

Google launches internet browser

Filed under: Browsers, open source — Tags: , , — egoleo @ 5:00 am

Google is launching an open source web browser to compete with Internet Explorer and Firefox.

The browser is designed to be lightweight and fast, and to cope with the next generation of web applications that rely on graphics and multimedia.

Called Chrome, it will launch as a beta for Windows machines in 100 countries, with Mac and Linux versions to come.

“We realised… we needed to completely rethink the browser,” said Google’s Sundar Pichai in a blog post.

The new browser will help Google take advantage of developments it is pushing online in rich web applications that are challenging traditional desktop programs.

Just waiting to try it out. 🙂

July 15, 2008

Adeona, free Laptop-Tracking System

Filed under: internet, open source — Tags: — egoleo @ 11:30 am

Adeona is the first Open Source system for tracking the location of your lost or stolen laptop that does not rely on a proprietary, central service. This means that you can install Adeona on your laptop and go — there’s no need to rely on a single third party. What’s more, Adeona addresses a critical privacy goal different from existing commercial offerings. It is privacy-preserving. This means that no one besides the owner (or an agent of the owner’s choosing) can use Adeona to track a laptop. Unlike other systems, users of Adeona can rest assured that no one can abuse the system in order to track where they use their laptop.

Adeona

Create a free website or blog at WordPress.com.