Mulyana Sandi

Belajar menulis dan berbagi ilmu melalui blog, sedikit tulisan semoga menjadi banyak manfaat :D.

Star Bolic

Belajar menulis dan berbagi ilmu melalui blog, sedikit tulisan semoga menjadi banyak manfaat :D.

Home Mini Server and VoIP

Banyak sekali perangkat yang terselubung diantara ilmu yang bermanfaat, perangkat kecil dengan hasil yang gak bisa di taksir.

Mulyana Sandi

Belajar menulis dan berbagi ilmu melalui blog, sedikit tulisan semoga menjadi banyak manfaat :D.

Antenna Star Bolic

Menembus jarak dengan perangkat yang murah meriah namun memerlukan kreatifitas dalam pembuatannya.

Friday, August 24, 2012

Install OpenVPN di VPS OS Debian/Ubuntu


  1. Login sebagai root pada Server/VPS anda.
  2. wget http://vpsnoc.com/scripts/debian-openvpn.sh
  3. chmod +x debian-openvpn.sh
  4. ./debian-openvpn.sh <= Script debian-openvpn.sh akan otomatis mendownload dan menginstall OpenVPN pada Server/VPS anda.
  5. Setelah itu periksa apakah OpenVPN yang anda install sudah berjalan atau belum. ketikkan perintah sebagai berikut :
    netstat -an | grep 1194
    Jika hasilnya seperti di bawah ini :
    udp        0      0 0.0.0.0:1194            0.0.0.0:*

    Berarti OpenVPN server sudah berhasil di-install.
  6. Dalam hal ini, sebagai contoh client, kita menggunakan komputer yang ber-OS Windows XP. Download dan install OpenVPN GUI yang bisa kita dapatkan di sini
  7. Download file /root/keys.tgz dari VPS menggunakan winscp atau software sftp lain ke PC kita. Untar file keys.tgz tadi ke directory C:\Program Files\OpenVPN\config\


    Jika client berhasil connect ke OpenVPN server, maka PC client akan mendapat IP 10.8.0.6 (contoh saja)
  8. Setelah PC client berhasil connect OpenVPN server, sesuai dengan script yang dijalankan di langkah pertama, default gateway dari setting network di PC client akan mengarah ke OpenVPN server. Jika PC client berhasil melakukan ping, misalnya kewww.yahoo.com, berarti instalasi OpenVPN server dan client sudah berhasil. Anda bisa melakukan browsing, chat dan aktifitas internet lainnya di PC client.
  9. Jika PC client berhasil connect ke OpenVPN server tapi tidak dapat melakukan ping atau browsing, silakan buat file script di bawah ini dan upload ke VPS, misalnya file script ini kita namakan updnet.sh
    echo 1 > /proc/sys/net/ipv4/ip_forward
    iptables -t nat -A POSTROUTING -o XX-eth -j SNAT –to 99.99.99.99
    #ganti 99.99.99.99 dengan IP Public VPS Anda
    #ganti XX-eth dengan device network Anda, misalnya venet0
    iptables-save > /etc/iptables.conf
    echo “#!/bin/sh” > /etc/network/if-up.d/iptables
    echo “iptables-restore < /etc/iptables.conf” >> /etc/network/if-up.d/iptables
    chmod +x /etc/network/if-up.d/iptables
    echo “net.ipv4.ip_forward=1″ >> /etc/sysctl.conf
  10. Setelah file updnet.sh diupload ke VPS, sebelum file dieksekusi,  ketikkan perintah
chmod +x updnet.sh
./updnet.sh

Monday, August 20, 2012

IRC Twitter BOT


#!/usr/bin/perl

# Twitter IRC Bot
# This bot is one way communication with twitter.

# to use just edit the bot and change the twitter username and pass.
# then set it up in a channel

# then to send an update type:
# !twitter update text

# an update will be sent right away.

# the bot will also send a twitter update on topic change.

# awesome
# - harper

# thanks to b0iler for his page "Bare Bones IRC Bot In Perl"
# http://b0iler.eyeonsecurity.org/tutorials/ircperlbot.htm

# this script is largely based upon his barebones framework

use LWP::Simple;
use LWP::UserAgent;
use HTML::TokeParser;
use IO::Socket;
use URI::Escape;

# configure variables
my $ircserver = "irc.freenode.net"; #add your irc network
my $ircchannel = "#h-c"; #add your irc channel
my $nickname = "HC-twit"; #add your twitter bots nick
my $username = "twittwittwit"; #add your twitter bots name
my $twituser = ""; #add your twitter username
my $twitpass= ""; #add your twitter password

my $helpmessage = "I am the twitter update bot. I will update twitter for ".$ircchannel.". If you want to send an update just enter: !twitter <update text>. If you want to see all updates made - please visit twitter.com/".$twituser;

my $browser = LWP::UserAgent->new;

# connect to the IRC server
$sock = IO::Socket::INET->new(
        PeerAddr => $ircserver,
        PeerPort => 6667,
        Proto => 'tcp' ) or die "could not make the connection";
       
while($line = <$sock>){
        print $line;
        if($line =~ /(NOTICE AUTH).*(checking ident)/i){
                print $sock "NICK $nickname\nUSER $username 0 0 :just a bot\n";
                last;
        }
}

while($line = <$sock>){
        print $line;  
        #use next line if the server asks for a ping
        if($line =~ /^PING/){
                print $sock "PANG :" . (split(/ :/, $line))[1];
        }
        if($line =~ /(376|422)/i){
                #print $sock "NICKSERV :identify nick_password\n";
                last;
        }
}

sleep 3;

# join the channel
print $sock "JOIN $ircchannel \n";

# main loop
print "/------------------------------------------------------------------------\n";
print "| Twitter IRC Bot \n";
print "|----------------------------------------------\n";
print "|\n";
while ($line = <$sock>) {
        #$text is the stuff from the ping or the text from the server
        ($command, $text) = split(/ :/, $line);  
        if ($command eq 'PING'){
                #while there is a line break - many different ways to do this
                while ( (index($text,"\r") >= 0) || (index($text,"\n") >= 0) ){ chop($text); }
                print $sock "PANG $text\n";
                next;
        }
        #done with ping handling
       
        ($nick,$type,$channel) = split(/ /, $line); #split by spaces
       
        ($nick,$hostname) = split(/!/, $nick); #split by ! to get nick and hostname seperate
       
        $nick =~ s/://; #remove :'s
        #$text =~ s/://;
       
        #get rid of all line breaks.  Again, many different way of doing this.
        $/ = "\r\n";
        while($text =~ m#$/$#){ chomp($text); }


if ($command =~ /TOPIC/){
my $topic_update = "Topic changed by $nick:  $text\n\n\n";
$topic_update =~ s/</[/g;
        $topic_update =~ s/>/]/g;
my $topic_delurl = "http://" . $twituser . ":" . $twitpass ."\@twitter.com/statuses/update.xml?status=".$topic_update;
print $topic_delurl;
my $topic_response = $browser->post( $topic_delurl );
my $topic_responsetext = $topic_response->content;
print $topic_responsetext;
if ($topic_responsetext =~ /\<created_at\>/){
print $sock "PRIVMSG $ircchannel :* Twitter updated: ".$topic_update."\n";
}else{
print $sock "PRIVMSG $ircchannel :* Twitter update failed\n" ;
}
$topic_responsetext = "";
$topic_update = "";
}

       
        if($channel eq $ircchannel){
                print "<$nick> $text\n";
if($text =~ /^!twitterhelp(.*)/){
print $sock "PRIVMSG $ircchannel :* ".$helpmessage."\n";
}
                if($text =~ /^!twitter (.*)/){
my $update = "[".$nick."] ".$1;
$update =~ s/</[/g;
            $update =~ s/>/]/g;
my $delurl = "http://" . $twituser . ":" . $twitpass ."\@twitter.com/statuses/update.xml?status=". urlencode($update);
my $response = $browser->post( $delurl );
my $responsetext = $response->content;
print $responsetext;
if ($responsetext =~ /\<created_at\>/){
print $sock "PRIVMSG $ircchannel :* Twitter updated: ".$update."\n";
}else{
print $sock "PRIVMSG $ircchannel :* Twitter update failed\n" ;
}
$responsetext = "";
$update = "";

                }
        }
}


###########
# subroutine: urlencode a string
###########

sub urlencode {

my $ask = shift @_;
my @a2 = unpack "C*", $ask;
my $s2 = "";
while (@a2) {
    $s2 .= sprintf "%%%X", shift @a2;
}
return $s2;

}

Saturday, August 18, 2012

Selamat Hari Raya Idul Fitri


Wednesday, August 15, 2012

Add Light Streaks To A Photo With Photoshop


Step 1: Add A New Blank Layer

We're going to be adding our light streaks on their own separate layer, so the first thing we need to do is add a new blank layer to our document. To do that, click on the New Layer icon at the bottom of the Layers palette:
Adobe Photoshop tutorial image.
Clicking on the "New Layer" icon.
This adds a new blank layer, which Photoshop names "Layer 1", above our Background layer:
Adobe Photoshop tutorial image.
A new layer appears above the Background layer.

Step 2: Select The Pen Tool

As I mentioned at the beginning, we're going to create our light streaks by drawing paths and then stroking the paths with a brush. To draw paths, we need the Pen Tool, so select it from the Tools palette. You can also press the letter P to select it with the keyboard shortcut:
Adobe Photoshop tutorial image.
Select the Pen Tool.

Wednesday, August 8, 2012

170 - A Map of the Internet's Black Holes

carte-web-en1.jpg
The series of tubes famously dubbed the ‘internets’ by president G.W. Bush* constitute a world wide web of interconnectedness. But, as this map demonstrates, there are some black holes in that web. They represent the 15 countries that limit or prohibit their citizens’ access to internet as a way of censoring the free flow of information.
Perhaps most notorious among those countries is China, with its Great Firewall (and its insistence on self-censorship by non-Chinese companies operating within the Middle Kingdom). Other countries also maintain firewalls, notably Saudi Arabia, while less-developed nations might just not allow their citizens to own computers.
This map was commissioned by Reporters Without Borders, which also publishes a World Ranking of press freedom. As the list of the 15 internet-restricting countries (followed by their ranking on said list) indicates, internet censorship is a strong indicator of press censorship in general:
1. Maldives (144)
2. Tunisia (148)
3. Belarus (151)
4. Libya (152)
5. Syria (153)
6. Vietnam (155)
7. Uzbekistan (158)
8. Nepal (159)
9. Saudi Arabia (161)
10. Iran (162)
11. China (163)
12. Myanmar/Burma (164)
13. Cuba (165)
14. Turkmenistan (167)
15. North Korea (168 and very last on the list)
I happened to be in one of those countries earlier this year. While attempting to go online in a hotel, I was told that the “internet was closed for the day.” I should try again the next day, when there was supervision. Which I did as early as possible: had I waited too long, the internet undoubtedly would have been on its lunch break.
Thanks to Jack E. Alexander for pointing out this map, which can be found here. The official site for Reporters Without Borders is here.
* : it was Alaska Senator Ted Stevens who called the internet ‘a series of tubes’. George W. Bush referred to the world wide web as ‘the internets’ both in the 2000 and the 2004 presidential election campaigns.

Wednesday, August 1, 2012

Virtual Host XAMPP Windows

C:\WINDOWS\system32\drivers\etc
tambahkan di akhir baris 
127.0.0.1 namaweb.com

kemudian buat folder namaweb.com di htdocs folder xampp

Habis itu edit httpd-vhosts.conf di Files\xampp\apache\conf\extra
di akhir baris kita buat virtual host dengan menambahkan perintah dibawah ini

NameVirtualHost namaweb:80
<VirtualHost localhost:80>

ServerAdmin webmaster@localhost

DocumentRoot "C:/Program Files/xampp/htdocs"

ServerName localhost
</VirtualHost>

NameVirtualHost namaweb.com:80
<VirtualHost namaweb.com:80>

ServerAdmin webmaster@namaweb.com

DocumentRoot "C:/Program Files/xampp/htdocs/namaweb.com"

ServerName namaweb.com
</VirtualHost>

Restart XAMPP