How To Share Dialup Internet Connection On Ubuntu Server

This article explain how to share your dialup internet connection on ubuntu linux. Just to share with the other. Here you are.

1. Change your statict network interface. In this example is eth1.
# vim /etc/network/interfaces

auto eth1
iface eth1 inet static
address 192.168.0.254
netmask 255.255.255.0
broadcast 192.168.0.255

where eth1 is the network card and ip is your desired server ip address. I used 192.168.0.254 as IP Address.

2. Configure the NAT:

# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

where ppp0 is the network card that the Internet is coming from. Use ppp0 for dialup connection.

# echo 1 > /proc/sys/net/ipv4/ip_forward

3. Install dnsmasq and ipmasq using apt-get:

# apt-get install dnsmasq ipmasq

4. Reconfigure ipmasq to start after networking has been started:

# dpkg-reconfigure ipmasq

5. Add the line “net.ipv4.ip_forward = 1″ to /etc/sysctl.conf

# vim /etc/sysctl.conf

6. Set your client DNS to 192.168.0.254

How to recover images from formatted memory card

A few days ago, My friend’s SD card accidentally formatted. While in the SD card is a memorable photographs of the birth of their first son. To restore these photos I recommend to use the recovery tool. To find the recovery tool, I told him to look for in google.

There are some recovery tools that are used. All are Windows programs. However, none of which succeeded. This is because the tool is a trial version. Meanwhile, to get the full version required to buy it. Fortunately I have a Ubuntu Linux machine which Ubuntu Lucid Lynx LTS upgrade from Ubuntu LTS Hardy Heron, minimal installation with LXDE. And finally my friend’s problem could be solved with the help of my Ubuntu Linux machine.

Here are some things you need to do with simple commands. This tutorial is written for Ubuntu GNU/Linux, but should be similar for most Linux machines.

1. Make a copy of the image of your SD card.
sudo dd if=/dev/sdb of=SDCARD-backup.img bs=1M

2. Install recoverjpeg package via apt-get
sudo apt-get install recoverjpeg

3. Run the command below.
$ recoverjpeg SDCARD-backup.img
Restored 398 pictures

The pictures that have been recovered will be stored in a folder. Please see the recovery that have been made. Good luck … Go Opensource .

Simple WordPress Themes

Simple is my next WordPress themes. Simple WordPress Themes consist of only 2 files, index.php and style.css. Simple WordPress themes is Valid CSS and Valid XHTML 1.0 Transitional.

As the previous themes, Simple WordPress Theme is released under a Creative Commons Attribution License 3.0. Here’s the source code of the Simple WordPress Theme.

File index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">

	<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>

	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
	<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->

	<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
	<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
	<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

	<?php wp_get_archives('type=monthly&format=link'); ?>
	<?php //comments_popup_script(); // off by default ?>
	<?php wp_head(); ?>
</head>
<body>

<div id="wrapper">

<div id="header">
       <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
       <p><?php bloginfo('description'); ?></p>
</div>

<div id="menu">
       <ul>
             <li class="gohome"><a href="<?php echo get_option('home'); ?>/">Home</a></li>
             <?php wp_list_pages('depth=1&title_li='); ?>
       </ul>
</div>

<div id="container">

<div id="content">
        <?php if(have_posts()) : ?>
        <?php while(have_posts()) : the_post(); ?>
        <div class="post">
                <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
                <div class="post-date">Posted on <?php the_time('F jS, Y'); ?> <?php edit_post_link('Edit Post', '[', ']'); ?></div>
                <div class="post-content">
                       <?php the_content(); ?>
                       <?wp_link_pages(); ?>
                </div>
                <div class="post-meta">Posted by <?php the_author(); ?> under <?php the_category(',') ?> with <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></div>
        </div>
        <?php endwhile; ?>
        <div class="page-navigation"><?php posts_nav_link(); ?></div>
        <?php endif; ?>

<div id="comments">
       <?php comments_template(); ?>
</div>

</div>

<div class="sidebar">
       <ul>

             <li id="search"><h2>Search</h2>
                      <form method="get" id="searchform" action="<?php bloginfo('home'); ?>">
                             <div>
                                    <input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" size="22" />
                                    <input type="submit" id="searchsubmit" value="Search" />
                             </div>
                      </form>
             </li>
              <?php wp_list_pages('title_li=<h2>Pages</h2>'); ?>
              <?php wp_list_categories('title_li=<h2>Categories</h2>'); ?>
              <li id="archives"><h2>Archives</h2>
                      <ul>
                             <?php wp_get_archives('type=monthly'); ?>
                      </ul>
              </li>
             <?php wp_list_bookmarks(); ?>
             <li id="rss-links"><h2>RSS Feeds</h2>
                     <ul>
                             <li><a href="<?php bloginfo('rss2_url') ?>">Posts RSS</a></li>
                             <li><a href="<?php bloginfo('comments_rss2_url') ?>">Comments RSS</a></li>
                     </ul>
             </li>
             <li id="meta"><h2>Meta</h2>
                     <ul>
                             <?php wp_register() ?>
                             <li><?php wp_loginout() ?></li>
                             <?php wp_meta() ?>
                     </ul>
             </li>

       </ul>
</div>

</div>

<div id="footer">
       <div class="footer-box"><?php wp_footer(); ?><span class="alignleft"><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a> Proudly Powered by <a href="http://www.wordpress.org/">WordPress <?php bloginfo('version'); ?></a>.</span> <span class="alignright">Using Simple Theme by <a href="http://www.basoro.com/">IM Basoro</a> with <a href="http://jigsaw.w3.org/css-validator/check/referer" title="Valid CSS!">CSS</a> and <a href="http://validator.w3.org/check?uri=referer" title="Valid XHTML 1.0 Transitional">XHTML</a>.</span></div>
</div>
</div>
</body>
</html>

File style.css

/*
Theme Name: Simple
Theme URI: http://www.basoro.com/themes/simple/
Description: Simple WordPress Themes For Free.
Version: 0.1
Author: IM Basoro
Author URI: http://www.basoro.com/
*/

body, h1, h2, h3, h4, h5, h6, address, blockquote, dd, dl, hr, p, form {
margin : 0;
padding : 0;
}
body {
font-family : Arial, helvetica, sans-serif;
font-size : 13px;
text-align : left;
vertical-align : top;
color : #111;
}
table {
font-size : 12px;
}
a {
text-decoration : none;
color : #8f3939;
}
a:hover {
text-decoration : none;
color : #111;
}
a img {
border : 0;
}
dd {
padding : 0 0 0 20px;
}
p {
padding : 10px 0 5px;
}
p img {
max-width : 100%;
}
img.centered {
margin-left : auto;
margin-right : auto;
display : block;
}
img.alignright {
margin : 3px 0 2px 10px;
padding : 4px;
border : 1px solid #ededed;
display : inline;
}
img.alignleft {
margin : 3px 10px 2px 0;
padding : 4px;
border : 1px solid #ededed;
display : inline;
}
.alignleft {
float : left;
}
.alignright {
float : right;
}
.clear {
margin : 0;
padding : 0;
clear : both;
}
small {
font-size : 11px;
}
h1, h2, h3, h4, h5, h6 {
font-size : 16px;
font-weight : bold;
}
blockquote {
margin : 10px 0 0;
border-top : 2px solid #ddd;
background : #f5f5f5;
}
blockquote p {
padding : 10px;
}
blockquote blockquote {
float : none;
width : auto;
margin : 0 10px;
background : #fff;
}
form, input, textarea {
font-size : 12px;
padding : 3px;
}
#wrapper {
width : 100%;
margin : 0 auto;
padding : 0;
border-top : 10px solid #666;
text-align : left;
background : #fff;
}
#header {
width : 860px;
margin : 0 auto;
padding : 0;
background : #fff;
}
#header h1 {
font-family : Georgia, "Times New Roman", serif;
padding : 20px 10px 0 10px;
font-size : 32px;
font-weight : normal;
}
#header p {
float : right;
font-family : Georgia, "Times New Roman", serif;
padding : 10px 40px 20px 10px;
font-size : 16px;
font-weight : normal;
font-style : italic;
}
#menu {
float : left;
width : 100%;
margin : 0 auto;
border-top : 1px solid #ccc;
border-bottom : 1px solid #ccc;
background : #f3f3f3;
}
#menu ul {
width : 860px;
margin : 0 auto;
padding : 0;
list-style : none;
}
#menu ul li {
float : left;
}
#menu ul li a {
display : block;
padding : 9px 15px;
border-right : 1px solid #ccc;
text-decoration : none;
color : #111;
}
#menu ul li a:hover {
background : #ddd;
}
#menu li.gohome a {
border-left : 1px solid #ccc;
}
#menu li.current_page_item a {
background : #ccc;
}
#breadcrumb{
float : left;
width : 100%;
margin : 0 auto;
font-family: arial, helvetica, sans-serif;
font-size: 11px;
font-weight : normal;
color: #111;
}
#breadcrumb p{
width : 840px;
margin : 0 auto;
padding: 15px 10px 5px 20px;
}
#breadcrumb a {
color: #8f3939;
font-weight : bold;
}
#container {
width : 860px;
margin : 0 auto;
padding : 0;
background : #fff;
}
#content {
float : left;
width : 530px;
margin : 0 10px 0 0;
padding : 10px 0 10px 0;
}
.page-navigation {
margin : 10px 10px 0;
padding : 5px 10px 6px;
line-height : 24px;
}
.post {
padding : 10px 20px;
}
.post h2 {
font-family : Georgia, "Times New Roman", serif;
font-size : 24px;
font-weight : normal;
}
.post h2 a {
color : #000;
}
.post-date {
padding : 10px 10px 0 0;
color : #666;
}
.post-content {
line-height : 21px;
font-size : 13px;
}
.post-content h2, .post-content h3, .post-content-h4, .post-content h5 {
padding : 10px 0 5px;
}
.post-content h2 a {
color : #8f3939;
}
.post-content h3 {
font-size : 18px;
font-weight : normal;
}
.post-content h5 {
font-size : 14px;
}
.post-content h6 {
font-size : 12px;
}
.post-meta {
padding : 10px 0 0 0;
line-height : 24px;
}
.sidebar {
float : left;
width : 300px;
background-color : #f3f3f3;
margin : 10px;
padding : 10px 0 10px 0;
}
.sidebar ul {
list-style : none;
margin : 0;
padding : 0;
}
.sidebar ul {
margin : 0 0 10px;
}
.sidebar ul li {
padding : 10px 10px 0;
}
.sidebar ul li h2 {
border-bottom : 1px solid #ddd;
font-family : Georgia, "Times New Roman", serif;
padding : 8px 10px 9px;
font-size : 18px;
font-weight : normal;
color : #444;
font-style : italic;
}
.sidebar ul ul {
margin : 0;
padding : 6px 10px 0;
line-height : 24px;
}
.sidebar ul ul li {
padding : 0;
}
.sidebar ul ul ul {
padding : 0 0 0 10px;
}
#comments {
margin : 10px;
padding : 10px;
border : 1px solid #f5f5f5;
}
#comment {
width : 450px;
}
#comments ol {
list-style : none;
margin : 10px 0;
padding : 0;
}
#comments ol li {
list-style : none;
margin : 10px 0 0;
padding : 0 0 10px;
border-bottom : 1px solid #ededed;
line-height : 24px;
}
#comments span.comment-author {
font-weight : bold;
}
#respond {
padding : 10px;
background : #f9f9f9;
}
.recentcomments a {
display : inline !important ;
padding : 0 !important ;
margin : 0 !important ;
}
#footer {
float : left;
width : 100%;
margin : 0 auto;
padding : 15px 0 20px 0;
border-top : 1px solid #aaa;
text-align : center;
line-height : 24px;
background : #eee;
}
#footer a {
text-decoration : none;
color : #555;
}
#footer .footer-box {
width : 860px;
margin : 0 auto;
padding : 0;
font-family : Georgia, "Times New Roman", serif;
font-size : 14px;
font-weight : normal;
font-style : italic;
}

For the record, Basoro.COM put links at the bottom of the page that lead to a page Basoro.COM. If you do not like, it allowed to eliminate the link.