<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Just Share My Knowledge</title>
	<atom:link href="http://fright.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://fright.wordpress.com</link>
	<description></description>
	<lastBuildDate>Tue, 01 Mar 2011 23:50:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='fright.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Just Share My Knowledge</title>
		<link>http://fright.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://fright.wordpress.com/osd.xml" title="Just Share My Knowledge" />
	<atom:link rel='hub' href='http://fright.wordpress.com/?pushpress=hub'/>
		<item>
		<title>install and configure apache + mysql on freeBSD</title>
		<link>http://fright.wordpress.com/2010/12/10/install-and-configure-apache-mysql-on-freebsd/</link>
		<comments>http://fright.wordpress.com/2010/12/10/install-and-configure-apache-mysql-on-freebsd/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 14:21:16 +0000</pubDate>
		<dc:creator>clinX</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL via source]]></category>
		<category><![CDATA[Mysql.tar.gz]]></category>

		<guid isPermaLink="false">http://fright.wordpress.com/?p=224</guid>
		<description><![CDATA[A. Apache Web Server I assume you have installed openssl. If not yet, see my previous post about openssl. 1. Install tsuweg# cd /usr/ports/www/apache22 tsuweg# make install ; make install clean 2. Configure tsuweg#  ee /usr/local/etc/apache22/httpd.conf in line 138 it should be ServerAdmin you@example.com. change wiyh your email address. In line 147 it should be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=224&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>A. Apache Web Server</strong></p>
<p>I assume you have installed openssl. If not yet, see my previous post about openssl.</p>
<p>1. <strong>Install</strong></p>
<blockquote><p><strong>tsuweg# cd /usr/ports/www/apache22</strong></p>
<p><strong>tsuweg# make install ; make install clean</strong></p>
<p><strong> </strong></p></blockquote>
<p><strong> 2. Configure</strong></p>
<blockquote><p><strong>tsuweg#  ee /usr/local/etc/apache22/httpd.conf</strong></p>
<p>in line 138 it should be ServerAdmin you@example.com. change wiyh your email address.</p>
<p>In line 147 it should be ServerName host.example.com:80. Uncomment it and change with your host</p>
<p>In line 449 it should be Include etc/apache22/extra/httpd-ssl.conf, uncomment it to support SSL</p>
<p>save it</p>
<p><strong>tsuweg# </strong><strong>ee /usr/local/etc/apache22/extra/httpd-ssl.conf</strong></p>
<p>in line 78 and 79, it describes servername and and person that maintain it.</p>
<p>in line 99,  change it into your ssl certificate path.This is my path: SSLCertificateFile &#8220;/usr/local/openssl/certs/tsuweg-cert.pem&#8221;</p>
<p>in line 107, change  into your ssl-key path, This is my path : SSLCertificateKeyFile &#8220;/usr/local/openssl/certs/tsuweg-unencrypted-key.pem&#8221;</p>
<p>save and exit</p></blockquote>
<p><strong>3. Test</strong>ing</p>
<blockquote><p><strong>tsuweg# apachectl configtest</strong></p>
<p>if your syntax correct,it will appear syntax OK</p>
<p><strong>tsuweg# ee /etc/rc.conf</strong></p>
<p>add :</p>
<p>apache22_enable=&#8221;YES&#8221;</p>
<p>apache22_http_accept_enable=&#8221;YES&#8221;</p>
<p>save and exit</p>
<p><strong>tsuweg# <strong>/usr/local/etc/rc.d/apache22 start</strong></strong></p>
<p><strong>tsuweg#  <strong>openssl s_client -connect localhost:443</strong></strong></p></blockquote>
<p>&nbsp;</p>
<p><strong>B. Mysql</strong></p>
<p><strong> 1. Install</strong></p>
<blockquote><p>i assume mysql is located in /usr/web.It&#8217;s depend on you.</p>
<p><strong>tsuweg# cd /usr/web</strong></p>
<p><strong>tsuweg# tar -xzvf mysql-5.0.77.tar.gz</strong></p>
<p><strong>tsuweg# cd mysql-5.0.77</strong></p>
<p><strong>tsuweg# ./configure &#8211;prefix=/usr/local/mysql &#8211;without-debug &#8211;with-extra-charsets=none &#8211;enable-local-infile &#8211;enable-assembler</strong></p>
<p><strong>tsuweg# make</strong></p>
<p><strong>tsuweg# make install</strong></p></blockquote>
<p>&nbsp;</p>
<p><strong> 2. Configure </strong></p>
<blockquote><p><strong>tsuweg# ./scripts/mysql_install_db</strong></p>
<p><strong>tsuweg# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf </strong></p>
<p><strong>tsuweg# /usr/local/mysql/bin/mysqld_safe &#8211;user=root &amp;</strong></p>
<p><strong>tsuweg# ee /usr/local/etc/rc.d/mysql.sh</strong></p>
<p><strong><strong>/usr/local/mysql/bin/mysqld_safe &#8211;user=root &amp;</strong></strong></p>
<p><strong><strong>save and exit</strong></strong></p>
<p><strong><strong>chmod 700 <strong><strong>/usr/local/mysql/bin/mysqld_safe &#8211;user=root &amp;</strong></strong></strong></strong></p>
<p><strong><strong><strong><strong>tsuweg# <strong><strong><strong><strong>/usr/local/mysql/bin/mysqladmin -u root password <em>yourpassword</em></strong></strong></strong></strong></strong></strong></strong></strong></p>
<p><strong><strong><strong><strong><strong><strong><strong><strong>tsuweg# <strong><strong><strong><strong><strong><strong><strong><strong>/usr/local/mysql/bin/</strong></strong></strong></strong></strong></strong></strong></strong><strong>mysqladmin -u root -h</strong> host.example.com <strong>password </strong> <em>yourremotepassword</em></strong></strong></strong></strong></strong></strong></strong></strong></p>
<p><strong><strong><strong><strong>tsuweg# ee /etc/rc.conf</strong></strong></strong></strong></p>
<p><strong><strong><strong><strong>mysql_enable=&#8221;YES&#8221;</strong></strong></strong></strong></p></blockquote>
<p>&nbsp;</p>
<p>source :</p>
<p>http://dev.mysql.com/doc/refman/5.1/en/installing-source-distribution.html</p>
<p>http://cipitunk.blog.friendster.com/2006/10/cara-mudah-install-apachephpmysql-di-freebsd-61from-source/</p>
<p>Hong,Bryan J..Building A Server with freeBSD 7</p>
<blockquote><p><strong><strong><strong><strong> </strong></strong></strong></strong></p>
<p><strong><strong><strong><strong> </strong></strong></strong></strong></p></blockquote>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fright.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fright.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fright.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fright.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fright.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fright.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fright.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fright.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fright.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fright.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fright.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fright.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fright.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fright.wordpress.com/224/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=224&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fright.wordpress.com/2010/12/10/install-and-configure-apache-mysql-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f5441f3076f7d0cf2c3cc2b45172c0c2?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">fright</media:title>
		</media:content>
	</item>
		<item>
		<title>Install and Configuration OpenSSH in FreeBSD</title>
		<link>http://fright.wordpress.com/2010/12/03/install-and-configuration-openssh-in-freebsd/</link>
		<comments>http://fright.wordpress.com/2010/12/03/install-and-configuration-openssh-in-freebsd/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 23:53:21 +0000</pubDate>
		<dc:creator>clinX</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[OpenSSH]]></category>

		<guid isPermaLink="false">http://fright.wordpress.com/?p=218</guid>
		<description><![CDATA[SSH is a secure version of telnet. It&#8217;a a protocol used to access the console or command line for remote system. 1. Installation tsuweg# cd /usr/ports/security/openssh-portable tsuweg# make config ; make install clean 2.  Configure tsuweg# cp /etc/make.conf /etc/make.conf.old tsuweg#  echo &#8220;NO_OPENSSH = YES&#8221; &#62;&#62; /etc/make.conf tsuweg# cd /etc/ssh/ tsuweg# cp sshd_config sshd_config.old tsuweg# cp sshd_config-dist [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=218&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SSH is a secure version of telnet. It&#8217;a a protocol used to access the console or command line for remote system.</p>
<p>1. Installation</p>
<blockquote><p>tsuweg# cd /usr/ports/security/openssh-portable</p>
<p>tsuweg# make config ; make install clean</p></blockquote>
<p>2.  Configure</p>
<blockquote><p>tsuweg# cp /etc/make.conf /etc/make.conf.old</p>
<p>tsuweg#  echo &#8220;NO_OPENSSH = YES&#8221; &gt;&gt; /etc/make.conf</p>
<p>tsuweg# cd /etc/ssh/</p>
<p>tsuweg# cp sshd_config sshd_config.old</p>
<p>tsuweg# cp sshd_config-dist ssh_config</p>
<p>tsuweg# /etc/rc.d/sshd restart<br />
Stopping sshd.<br />
Starting sshd.</p>
<p>tsuweg#ee /etc/rc.conf</p>
<p>add command :  sshd_enable=&#8221;YES&#8221;</p></blockquote>
<blockquote><p>this command is used to start ssh automatically</p></blockquote>
<p>3. Testing</p>
<blockquote><p>tsuweg# telnet localhost 22<br />
Trying 127.0.0.1&#8230;<br />
Connected to localhost.<br />
Escape character is &#8216;^]&#8217;.<br />
SSH-2.0-OpenSSH_5.1p1 FreeBSD-openssh-portable-overwrite-base-5.1.p1,1</p>
<p>press enter to quit. You should now be able to connect with any SSH-capable client and any valid user  account other than root.</p></blockquote>
<p>Source :  Hong,Bryan J.<em>Building a server with FreeBSD 7.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fright.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fright.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fright.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fright.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fright.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fright.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fright.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fright.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fright.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fright.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fright.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fright.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fright.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fright.wordpress.com/218/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=218&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fright.wordpress.com/2010/12/03/install-and-configuration-openssh-in-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f5441f3076f7d0cf2c3cc2b45172c0c2?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">fright</media:title>
		</media:content>
	</item>
		<item>
		<title>OpenSSL on FreeBSD</title>
		<link>http://fright.wordpress.com/2010/12/02/openssl-on-freebsd/</link>
		<comments>http://fright.wordpress.com/2010/12/02/openssl-on-freebsd/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 19:20:40 +0000</pubDate>
		<dc:creator>clinX</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[OpenSSL]]></category>

		<guid isPermaLink="false">http://fright.wordpress.com/?p=207</guid>
		<description><![CDATA[OpenSSL is an open source toolkit and cryptographic library that implements the SSL and TLS protocols. OpenSSL provides Cryptographic tools for securing network connections. 1. Install OpenSSL tsuweg# cd /usr/ports/security/openssl tsuweg# cp Makefile Makefile.old tsuweg# echo EXTRACONFIGURE +=no-idea &#62;&#62; Makefile tsuweg# make install clean tsuweg# rehash &#160; 2. Configure tsuweg# cp /etc/make.conf /etc/make.conf.old tsuweg# echo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=207&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>OpenSSL is an open source toolkit and cryptographic library that implements the SSL and TLS protocols. OpenSSL provides Cryptographic tools for securing network connections.</p>
<p><strong>1. Install OpenSSL</strong></p>
<ul>
<li>tsuweg# cd /usr/ports/security/openssl</li>
</ul>
<ul>
<li>tsuweg# cp Makefile Makefile.old</li>
</ul>
<ul>
<li>tsuweg# echo EXTRACONFIGURE +=no-idea &gt;&gt; Makefile</li>
</ul>
<ul>
<li>tsuweg# make install clean</li>
</ul>
<ul>
<li>tsuweg# rehash</li>
</ul>
<p>&nbsp;</p>
<p><strong>2. Configure</strong></p>
<ul>
<li>tsuweg# cp /etc/make.conf /etc/make.conf.old</li>
</ul>
<ul>
<li>tsuweg# echo &#8220;WITH_OPENSSL_PORT=YES&#8221; &gt;&gt; /etc/make.conf</li>
</ul>
<ul>
<li>tsuweg# mv /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf.old</li>
</ul>
<ul>
<li>tsuweg# cd /usr/local/openssl</li>
</ul>
<ul>
<li>tsuweg# cp openssl.cnf.sample openssl.cnf</li>
</ul>
<p>now,test open ssl by type command below :</p>
<ul>
<li>tsuweg# openssl</li>
</ul>
<p>&nbsp;</p>
<p><strong>3.  Create Certificate Request for CA Submission</strong></p>
<p><strong>A.  Generate Request</strong></p>
<p>We will use CA.pl script included with OPENSSL to create certificate request.</p>
<ul>
<li>tsuweg# cd /usr/local/openssl</li>
</ul>
<ul>
<li>tsuweg# cp misc/CA.pl certs</li>
</ul>
<p>Run the script to create certificate request</p>
<ul>
<li>tsuweg# cd /usr/local/openssl/certs</li>
</ul>
<ul>
<li>tsuweg# setenv OPENSSL /usr/local/bin/openssl</li>
</ul>
<ul>
<li>tsuweg# ./CA.pl -newreq</li>
</ul>
<p>fill passprase, country,province. After fill an email, just enter twice.</p>
<p>Running CA.pl indirectly create a file named newkey.pem. next step :</p>
<ul>
<li>tsuweg# cp newkey.pem tsuweg-encrypted-key.pem</li>
</ul>
<p>We will also get new file named newreq.pem that contains certificate request. next :</p>
<ul>
<li>tsuweg# cp newreq.pem tsuweg-req.pem</li>
</ul>
<p>file tsuweg-encrypted-key.pem is encrypted with the password.If this file is going to be used on an unattended server, it may be a good idea  to decrypt the file so that daemons are able to load it without user  intervention. To remove the encryption and make the unencrypted file readable  only to root, use the following commands :</p>
<ul>
<li>tsuweg# openssl rsa -in tsuweg-encrypted-key.pem\</li>
</ul>
<ul>
<li>? -out tsuweg-unencrypted-key.pem</li>
</ul>
<ul>
<li>tsuweg# chmod 400 tsuweg-unencrypted-key.pem</li>
</ul>
<p>&nbsp;</p>
<p><strong>B.  Create A Self-Signed SSL Certificate</strong></p>
<p>1. Command below will create self certificate for about 3 years</p>
<ul>
<li>tsuweg# cd /usr/local/openssl</li>
</ul>
<ul>
<li>tsuweg# cp misc/CA.pl certs</li>
</ul>
<ul>
<li>tsuweg# sed -I .old &#8216;s/365/1095/&#8217; openssl.cnf</li>
</ul>
<p>2. Run the script</p>
<ul>
<li>tsuweg# cd /usr/local/openssl/certs</li>
</ul>
<ul>
<li>tsuweg# setenv OPENSSL /usr/local/bin/openssl</li>
</ul>
<ul>
<li>tsuweg# ./CA.pl -newca</li>
</ul>
<p>The first prompt will asked about certificate name. Juste type enter. Next, fill the passphrase and remember it. After entering email address,just type enter twice.</p>
<p>3. Generate certificate request</p>
<ul>
<li>tsuweg# ./CA.pl -newreq</li>
</ul>
<p>fill pasphrase same one you used earlier. After fill email address, just type enter twice</p>
<p>4. Create the signed certificate from the request and certificate authority files.</p>
<ul>
<li>tsuweg# ./CA.pl -signreq</li>
</ul>
<p>Enter the password that used earlier. Answer yes twice.</p>
<ul>
<li>tsuweg# cp newcert.pem tsuweg-cert.pem</li>
</ul>
<ul>
<li>tsuweg# cp newkey.pem tsuweg-encrypted-key.pem</li>
</ul>
<ul>
<li>tsuweg# cp demoCA/cacert.pem ./tsuweg-CAcert.pem</li>
</ul>
<ul>
<li>tsuweg# cp demoCA/private/cakey.pem ./tsuweg-encrypted-CAkey.pem</li>
</ul>
<p>If this file is going to be used on an unattended server, it may be a good idea  to decrypt this file so that daemons are able to load it without user  intervention.To remove the encryption and make the unencrypted file readable only to root, use this command .</p>
<ul>
<li>tsuweg# openssl rsa -in tsuweg-encrypted-key.pem<strong> \</strong></li>
</ul>
<ul>
<li>? -out tsuweg-unencrypted-key.pem</li>
</ul>
<ul>
<li>tsuweg# chmod 400 tsuweg-unencrypted-key.pem</li>
</ul>
<p>5. convert  PEM (Privacy Enhanced Mail) text based certificate to the DER  format.</p>
<ul>
<li>tsuweg# openssl x509 -in tsuweg-CAcert.pem -inform PEM \</li>
</ul>
<ul>
<li>? -out tsuweg-CAcert.cer -outform DER</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Source :  Hong,Bryan J.<em>Building a server with FreeBSD 7.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fright.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fright.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fright.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fright.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fright.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fright.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fright.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fright.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fright.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fright.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fright.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fright.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fright.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fright.wordpress.com/207/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=207&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fright.wordpress.com/2010/12/02/openssl-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f5441f3076f7d0cf2c3cc2b45172c0c2?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">fright</media:title>
		</media:content>
	</item>
		<item>
		<title>Remote FreeBSD via Putty : Setting SSHD</title>
		<link>http://fright.wordpress.com/2010/11/21/remote-freebsd-from-putty-setting-sshd/</link>
		<comments>http://fright.wordpress.com/2010/11/21/remote-freebsd-from-putty-setting-sshd/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 18:19:43 +0000</pubDate>
		<dc:creator>clinX</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[remote freeBSD]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://fright.wordpress.com/?p=202</guid>
		<description><![CDATA[This is step by step to setting SSHd so you can access root in freeBSD via putty : 1. ee  /etc /ssh/sshd_config 2. uncomment PermitRootLogin(it should be in line 47) and change it into yes 3. save that configuration 4.  /etc/rc.d/sshd restart  or reboot your machine 5. try to remote your machine via putty and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=202&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is step by step to setting SSHd so you can access root in freeBSD via putty :</p>
<p>1. ee  /etc /ssh/sshd_config</p>
<p>2. uncomment PermitRootLogin(it should be in line 47) and change it into yes</p>
<p>3. save that configuration</p>
<p>4.  /etc/rc.d/sshd restart  or reboot your machine</p>
<p>5. try to remote your machine via putty and enjoy it</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fright.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fright.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fright.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fright.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fright.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fright.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fright.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fright.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fright.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fright.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fright.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fright.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fright.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fright.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=202&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fright.wordpress.com/2010/11/21/remote-freebsd-from-putty-setting-sshd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f5441f3076f7d0cf2c3cc2b45172c0c2?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">fright</media:title>
		</media:content>
	</item>
		<item>
		<title>forget root password in freeBSD</title>
		<link>http://fright.wordpress.com/2010/11/19/forget-root-password-in-freebsd/</link>
		<comments>http://fright.wordpress.com/2010/11/19/forget-root-password-in-freebsd/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 15:00:00 +0000</pubDate>
		<dc:creator>clinX</dc:creator>
				<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://fright.wordpress.com/?p=197</guid>
		<description><![CDATA[here step by step if you forgetting root password in freeBSD : 1. Login using single user mode 2. When following comment exist : Enter full pathname of shell or RETURN for /bin/sh: type ok 3. #fsck -y 4. #mount -u ufs -a 5. #passwd type a new password 6. #exit<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=197&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>here step by step if you forgetting root password in freeBSD :</p>
<p>1. Login using single user mode</p>
<p>2. When following comment exist :</p>
<p>Enter full pathname of shell or RETURN for /bin/sh:</p>
<p>type ok</p>
<p>3. #fsck -y</p>
<p>4. #mount -u ufs -a</p>
<p>5. #passwd</p>
<p>type a new password</p>
<p>6. #exit</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fright.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fright.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fright.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fright.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fright.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fright.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fright.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fright.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fright.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fright.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fright.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fright.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fright.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fright.wordpress.com/197/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=197&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fright.wordpress.com/2010/11/19/forget-root-password-in-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f5441f3076f7d0cf2c3cc2b45172c0c2?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">fright</media:title>
		</media:content>
	</item>
		<item>
		<title>Mounting USB Flash Disk In Slackware</title>
		<link>http://fright.wordpress.com/2010/07/18/mounting-usb-flash-disk-in-slackware/</link>
		<comments>http://fright.wordpress.com/2010/07/18/mounting-usb-flash-disk-in-slackware/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 06:30:18 +0000</pubDate>
		<dc:creator>clinX</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mount usb flash disk linux]]></category>
		<category><![CDATA[mount usb flash disk slackware]]></category>

		<guid isPermaLink="false">http://fright.wordpress.com/?p=193</guid>
		<description><![CDATA[First,check your device you can check with this command root@racolo:/mnt/data# dmesg sd 4:0:0:0: [sdb] 7856128 512-byte hardware sectors (4022 MB) sd 4:0:0:0: [sdb] Write Protect is off sd 4:0:0:0: [sdb] Mode Sense: 23 00 00 00 sd 4:0:0:0: [sdb] Assuming drive cache: write through sdb: sdb1 usb flash disk located in sdb1 Second, make dir [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=193&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>First,check your device</strong><br />
you can check with this command<br />
root@racolo:/mnt/data# dmesg</p>
<p>sd 4:0:0:0: [sdb] 7856128 512-byte hardware sectors (4022 MB)<br />
sd 4:0:0:0: [sdb] Write Protect is off<br />
sd 4:0:0:0: [sdb] Mode Sense: 23 00 00 00<br />
sd 4:0:0:0: [sdb] Assuming drive cache: write through<br />
sdb: sdb1</p>
<p>usb flash disk located in sdb1</p>
<p><strong>Second, make dir in /mnt</strong> <strong>:</strong><br />
root@racolo:/#mkdir /mnt/usb</p>
<p><strong>Third, mounting your device :</strong><br />
root@racolo:/#mount /dev/sdb1 /mnt/usb</p>
<p><strong>Fourth,goto /mnt/usb :</strong><br />
root@racolo:/#cd /mnt/usb<br />
and you can see files in your usb flashdisk</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fright.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fright.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fright.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fright.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fright.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fright.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fright.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fright.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fright.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fright.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fright.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fright.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fright.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fright.wordpress.com/193/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=193&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fright.wordpress.com/2010/07/18/mounting-usb-flash-disk-in-slackware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f5441f3076f7d0cf2c3cc2b45172c0c2?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">fright</media:title>
		</media:content>
	</item>
		<item>
		<title>Basic Linux Security</title>
		<link>http://fright.wordpress.com/2010/07/09/basic-linux-security/</link>
		<comments>http://fright.wordpress.com/2010/07/09/basic-linux-security/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 18:58:21 +0000</pubDate>
		<dc:creator>clinX</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://fright.wordpress.com/?p=189</guid>
		<description><![CDATA[In this configuration, I used slackware 12.2. I practice this configuration from http://alko.web.id/blog/tag/slackware. So, this is the configuration: turned of ip forwarding root@racolo:/# echo &#8220;0&#8243; &#62; /proc/sys/net/ipv4/ip_forward drop ping packets root@racolo:/# echo &#8220;1&#8243; &#62; /proc/sys/net/ipv4/icmp_echo_ignore_all ignore broadcast ping. prevent from smurfing attacks. root@racolo:/# echo &#8220;1&#8243; &#62; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts Disable source route packets root@racolo:/home/tsuweg# echo &#8220;0&#8243; &#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=189&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this configuration, I used slackware 12.2. I practice this configuration from http://alko.web.id/blog/tag/slackware. So, this is the configuration:</p>
<p><strong>turned of ip forwarding</strong><br />
root@racolo:/# echo &#8220;0&#8243; &gt; /proc/sys/net/ipv4/ip_forward</p>
<p><strong>drop ping packets</strong><br />
root@racolo:/# echo &#8220;1&#8243; &gt; /proc/sys/net/ipv4/icmp_echo_ignore_all</p>
<p><strong>ignore broadcast ping. prevent from smurfing attacks.</strong><br />
root@racolo:/# echo &#8220;1&#8243; &gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts</p>
<p><strong>Disable source route packets</strong><br />
root@racolo:/home/tsuweg# echo &#8220;0&#8243; &gt; /proc/sys/net/ipv4/conf/all/accept_source_route</p>
<p><strong>Disable redirect acceptance</strong><br />
root@racolo:/home/tsuweg# echo &#8220;0&#8243; &gt; /proc/sys/net/ipv4/conf/all/accept_redirects</p>
<p><strong>protect against bad error messages</strong><br />
root@racolo:/home/tsuweg# echo &#8220;1&#8243; &gt; /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses</p>
<p><strong>enable reverse path filtering</strong><br />
root@racolo:/home/tsuweg# for i in /proc/sys/net/ipv4/conf/*; do /bin/echo &#8220;1&#8243; &gt; $i/rp_filter; done</p>
<p><strong>log all spoof routed and redirect packet</strong><br />
root@racolo:/home/tsuweg# echo &#8220;1&#8243; &gt; /proc/sys/net/ipv4/conf/all/log_martians</p>
<p>But after reboot the configuration are reset, so we must edit sysctl in /etc/sysctl.conf<br />
net.ipv4.ip_forward = 0</p>
<p>source : http://alko.web.id/blog/tag/slackware</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fright.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fright.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fright.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fright.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fright.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fright.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fright.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fright.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fright.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fright.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fright.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fright.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fright.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fright.wordpress.com/189/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=189&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fright.wordpress.com/2010/07/09/basic-linux-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f5441f3076f7d0cf2c3cc2b45172c0c2?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">fright</media:title>
		</media:content>
	</item>
		<item>
		<title>Number Theory-Divisibility</title>
		<link>http://fright.wordpress.com/2010/03/03/divisibility/</link>
		<comments>http://fright.wordpress.com/2010/03/03/divisibility/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 11:00:53 +0000</pubDate>
		<dc:creator>clinX</dc:creator>
				<category><![CDATA[cryptography]]></category>
		<category><![CDATA[dvisibility]]></category>
		<category><![CDATA[number theory]]></category>

		<guid isPermaLink="false">http://fright.wordpress.com/?p=177</guid>
		<description><![CDATA[1. Theorem 1 If m&#124;ab è (m,a) = 1 So m&#124;b Proof : m&#124;ab è ab = x.m (m,a) = 1 è m can’t divide a So m&#124;b a.t =x ab = a.t.m è b = t.m 2. Theorem 2 If  m,n&#124;a  and (m,n) = 1 so mn&#124;a 3. Theorem 3 If x&#124;my and x&#124;ny [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=177&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>1. Theorem 1</strong></p>
<p>If m|ab è (m,a) = 1</p>
<p>So m|b</p>
<p>Proof :</p>
<p>m|ab è ab = x.m</p>
<p>(m,a) = 1 è m can’t divide a</p>
<p>So m|b</p>
<p>a.t =x</p>
<p>ab = a.t.m è b = t.m</p>
<p><strong>2. Theorem 2</strong></p>
<p>If  m,n|a  and (m,n) = 1 so mn|a</p>
<p><strong>3. Theorem 3</strong></p>
<p>If x|my and x|ny and gcd (m,n) =1 so</p>
<p>x|y.</p>
<p><strong>4. Theorem 4</strong></p>
<p>If n,m is an even number and if</p>
<p>x|my</p>
<p>x|ny</p>
<p>gcd (m,n)=2t</p>
<p>so</p>
<p>x=z.2t or</p>
<p>x=y</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fright.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fright.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fright.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fright.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fright.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fright.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fright.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fright.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fright.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fright.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fright.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fright.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fright.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fright.wordpress.com/177/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=177&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fright.wordpress.com/2010/03/03/divisibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f5441f3076f7d0cf2c3cc2b45172c0c2?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">fright</media:title>
		</media:content>
	</item>
		<item>
		<title>Number Theory-Introduction</title>
		<link>http://fright.wordpress.com/2010/03/02/number-theory-introduction/</link>
		<comments>http://fright.wordpress.com/2010/03/02/number-theory-introduction/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 15:25:29 +0000</pubDate>
		<dc:creator>clinX</dc:creator>
				<category><![CDATA[cryptography]]></category>
		<category><![CDATA[introduction to number theory]]></category>
		<category><![CDATA[number theory]]></category>

		<guid isPermaLink="false">http://fright.wordpress.com/?p=165</guid>
		<description><![CDATA[A. In number theory, we always play in the “modulus world”. B. Integer n&#62;0 and n,there are integer q and r, 0≤r≤n so : m=qn+r C. Definition 1. integer m is a factor of integer n or m can divide n, if there are, it’s                     [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=165&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A.  In number theory, we always play in the “modulus world”.<br />
B.  Integer n&gt;0 and n,there are integer q and r, 0≤r≤n so :</p>
<pre>m=qn+r</pre>
<p>C.  Definition<br />
1.  integer m is a factor of integer n or m can divide n, if there are, it’s                         satisfied n=mq. The notation is m|n.<br />
2. GCD(Great Common Divisor) from two integer m,n(not both 0) is int d                 that can divide each number. Notation :</p>
<pre>   d =(m,n)  or d =gcd(m,n) so
   m =d.q
   n =d.r</pre>
<p>If m≠0, so (m,0) = |m| ==&gt; always absolut</p>
<p>D.  Theorem<br />
1.  If d =(m,n) and there are integer r,s so d=rm+sn<br />
2. The Linear diophantine equation e=xm+yn is satisfied in integer x,y iff               (m,n)|e<br />
3. Every divisor alliance from m,n divide greatest common divisor</p>
<p>E.  Prime number<br />
Prime number is number that can divided by 1 or it self.<br />
If m,n is prime then gcd is 1.<br />
Relative prime number is the number that can have gcd  =1</p>
<p>F. Eucliedan Algorithm<br />
Use to find gcd from 2 integer number . Example :</p>
<pre>(37,11) ==&gt;
37=3×11+4
11=2 ×4+3
4=1×3+1
3=3 ×1+0    ==&gt; the end of eucliedan algorithm
The result is (37,11) = (11,4) = (4,3) = (3,1) =1</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fright.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fright.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fright.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fright.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fright.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fright.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fright.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fright.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fright.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fright.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fright.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fright.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fright.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fright.wordpress.com/165/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=165&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fright.wordpress.com/2010/03/02/number-theory-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f5441f3076f7d0cf2c3cc2b45172c0c2?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">fright</media:title>
		</media:content>
	</item>
		<item>
		<title>Logic Programming-Basic Constructs</title>
		<link>http://fright.wordpress.com/2010/02/28/logic-programming-basic-constructs/</link>
		<comments>http://fright.wordpress.com/2010/02/28/logic-programming-basic-constructs/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 04:02:29 +0000</pubDate>
		<dc:creator>clinX</dc:creator>
				<category><![CDATA[Prolog]]></category>
		<category><![CDATA[Basic constructs]]></category>
		<category><![CDATA[Logic Programming]]></category>

		<guid isPermaLink="false">http://fright.wordpress.com/?p=148</guid>
		<description><![CDATA[1. Facts The simplest kinds of statement called a fact. Facts are a means of starting that a relation holds between objects. An example is father(abraham,isaac). It means that abraham is father of isaac. Names of a individually are called atoms. A finite set of facts constitues a program. A set of facts is also [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=148&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. Facts<br />
The simplest kinds of statement called a fact. Facts are a means of starting that a relation holds between objects. An example is father(abraham,isaac). It means that abraham is father of isaac. Names of a individually are called atoms. A finite set of facts constitues a program. A set of facts is also description  of a situation.</p>
<p>2. Queries<br />
Queries are a means of retrieving information from a logic program. A query asks whether a certain relation holds between objects. For example,the query father(abraham,isaac)? asks whether the father relationship holds between abraham and isaac. The facts is in program 1 and the answer is yes.</p>
<p>3. Logical Variable,Substitutions, and Instances<br />
logical variable stands for an unspecified individual and is used accordingly. variables are means of summarizing many queries. A  query containing a variable asks whether there is a value for the variable that makes the query a logical consequence of the program.Variable in logic programs behave differently from variables in conventional programming languages. They stand for an unspecified but single entity rather than for a store location in memory.</p>
<p>Having introduced variables,we can define a term, the single data structure in logic programs. Constants and variable are terms. Also compound terms, or structures are terms.</p>
<p>Queries,goals, and more generally terms where variables do not occur are called ground. Where variables do occur,they are called nonground.</p>
<p><em>Definition</em></p>
<p>A substituion is a finite set(possibly empty) of pairs of the form X<sub>i</sub> = t<sub>i</sub>,where Xi is a variable and ti is a term, and  and X<sub>i</sub> ≠ X<sub>j</sub> for every i ≠ j, and X<sub>i</sub> does not occur in t<sub>j</sub>,for any i and j.</p>
<p><em>Definition</em></p>
<p>A is an instance of B if there is a substitution θ such that A =Bθ</p>
<p>4. Existential Queries<br />
Variables in queries are existentially quantified which means,intuively, that the query father(abraham,X)?reads &#8220;Does there exist an X such that abraham is the father of X?The next deduction rule is generalization. The fact father(abraham,issaac) implies that there exist an X such taht father (abraham,X) is true,namely,X=isaac.</p>
<p>5. Universal facts<br />
VAriables in facts are implicitly universally quantifiesd,which means,intuively, that the fact likes(X,pomegranates) states that for all  X, X like pomegranates.In general, a factp(T1,T2,&#8230;,Tn) readas that for all X1,&#8230;,Xk,where Xi are variables occuring in the fact,p(T1,&#8230;,Tn) is true. Logically,from a universally quantified fact one can deduce any instance of it. For example, from likes(X,pomegrantes),deduce likes (abraham,pomegranates). This is the third deduction rule,called instantiation. From a universally quantified statements P,deduce an instance</p>
<p>of it,P0,for any substitution 0.</p>
<p><em>Definition </em></p>
<p>C is common instance of A and B if it an instance of A and an instance of B,in other words,if there are  substitutions θ<sub>1</sub> and θ<sub>2 </sub>such that C=Aθ<sub>1 </sub>is syntatically identical to Bθ<sub>2</sub></p>
<p>6. Conjunctive Queries and Shared Variables</p>
<p>Conjunctive queries are a conjunction of goals passed as a query . for example a query father(haran,X),male(X)?. The solutions to the query father(haran,X)? Are restricted to the children that are male. A conjunctive query is a logical consequence of a program P if all the goals in the conjunction are consequences of P,where shared variables are instantiated to the same values in different goals.A sufficient condition is is that there be a ground instance of the query that is consequence of P. This instance then deduces the conjuncts in the query via generalizations.</p>
<p>7. Rules<br />
Rules are the statements of the form : A &lt;– B<sub>1</sub>,B<sub>2</sub>,&#8230;,B<sub>n</sub></p>
<p>Where n ≥ 0. The goal A is the head of the rule. A rule expressing the son relationship is</p>
<p>son(X,Y) &lt;- father(Y,X),male(X).</p>
<p>Rules can be viewed in two ways :</p>
<p>-          Procedural reading</p>
<p>They are a means of expressing new or complex queries in terms of simple queries. A query son(X,haran)? To the program that contains the preceding rule of a son is translated to the query father(haran,X),male(X)? According to the rule, and solved as before.A new query about the son relationship has been built from simple queries involving father and male relationship.</p>
<p>-          Logical axiom</p>
<p>The backward arrow is used to denote logical implication. The son rule reads:”X is son of Y if Y is the father of X and X is male”. In this view, rules are a means of defining new or a complex relationship using other,simpler relationship.</p>
<p><em>Definition </em></p>
<p><em> </em>The law of universal modus ponens says that from the rule</p>
<p>R=(A&lt;-B<sub>1</sub>,B<sub>2</sub>,&#8230;,B<sub>n</sub>)</p>
<p>And the facts</p>
<p>B<sub>1.</sub></p>
<p><sub> </sub>B<sub>2</sub></p>
<p><sub> .</sub></p>
<p><sub> .</sub></p>
<p><sub> </sub>B<sub>n</sub></p>
<p><sub> </sub>A’ can be deduced if</p>
<p>A’ &lt;- B’<sub>1</sub>, B’<sub>2</sub>,&#8230;, B’<sub>n</sub> is an instance of R.</p>
<p><em>Definition </em></p>
<p><em> </em>A logic programs is a finite set of rules</p>
<p><em>Definition </em></p>
<p>An existentially quallified goal G is logical consequence of a program P if there is a clause in P with a ground instance is a clause in P with a ground instance A &lt;- B<sub>1</sub>,B<sub>2</sub>,&#8230;,B<sub>n</sub>,n≥0 such that B<sub>1</sub>,&#8230;, B<sub>n</sub> are logical consequences of P, and A is an instance of G.</p>
<p>8. A  simple abstract listener</p>
<ol></ol>
<p>The abstract interpreter performs yes/no computations. It takes as input a program and a goal, and answer yes if the goal is a logical consequence of the program and no otherwise. The current,usually conjunctive,goal at any stage of the computation is called resolvent. A trace of the interpreter is the sequence of resolvents produced during the computation. Each iteration of the while loop of the abstract interpreter corresponds to a single application of modus ponens. This called reduction.</p>
<pre>
<em>Input :   A ground goal G and  a program P</em>

<em>Output  : </em><em> yes if G is a logical consequence of P</em>

<em> No otherwise</em>

<em>Algorithm : </em>

<em>Initialize the resolvent to G</em>

<em>              While the resolvent is not empty do</em>

<em>                       Choose a goal A from the resolvent</em>

<em>                       Choose a ground instance of a clause A’&lt;-B<sub>1</sub>...B<sub>n</sub> from P</em>

<em>                       Such that A and A’ are identical </em>

<em>                                If no such goal and clause exist,exit the while loop</em>
<em>                      Replace A by  A’&lt;-B<sub>1</sub>...B<sub>n</sub> in the resolvent </em>
<em>               If the resolvent is empty,then output yes,else no</em>
</pre>
<p><em>Definition </em></p>
<p>A reduction of a goal G by a program P is the replacement of G by the body of an instance of a clause in P,whose head is identical to the choosen goal.</p>
<p>9. The      Meaning of a Logic Program<br />
<em>Definition </em><br />
The meaning of a logic program P,M(P) is thee set of ground goals deducible from P.</p>
<p>
Reference :<br />
Sterling,Leon ,Shapiro, Ehud. <em>The art of prolog</em>.1999.Massachussets Of Technology.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fright.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fright.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fright.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fright.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fright.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fright.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fright.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fright.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fright.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fright.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fright.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fright.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fright.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fright.wordpress.com/148/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fright.wordpress.com&amp;blog=3529214&amp;post=148&amp;subd=fright&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fright.wordpress.com/2010/02/28/logic-programming-basic-constructs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f5441f3076f7d0cf2c3cc2b45172c0c2?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">fright</media:title>
		</media:content>
	</item>
	</channel>
</rss>
