<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7320216364508166147</id><updated>2011-04-21T18:33:31.321-07:00</updated><title type='text'>Notes from ByteBar</title><subtitle type='html'>Long notes from ByteBar</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bytebarnotes.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7320216364508166147/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bytebarnotes.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Zen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_L8OQcDJozzM/Saz-OStxFoI/AAAAAAAAAJw/ewS-d4b_Wwg/S220/3309571384_055cbfbe4a.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7320216364508166147.post-4975554942864053093</id><published>2009-03-02T18:15:00.001-08:00</published><updated>2009-03-02T18:15:26.778-08:00</updated><title type='text'>PHP Programming</title><content type='html'>

 
 
 


 
 
 


 
 
 


 
 
 


 
 
 


 
 
 


 
 
 
&lt;div id="ic.7"&gt;&lt;h1&gt;&lt;a id="Introduction_889893783261989" name="Introduction_889893783261989"&gt;&lt;/a&gt;&lt;i&gt;&lt;a id="Introduction_" name="Introduction_"&gt;&lt;/a&gt;&lt;/i&gt;Introduction&lt;/h1&gt;&lt;h2 style="margin-left: 40px;"&gt;&lt;a id="Overview__3521612082859278" name="Overview__3521612082859278"&gt;&lt;/a&gt;Overview
&lt;br&gt;&lt;/h2&gt;&lt;div id="ic.7"&gt;&lt;div style="margin-left: 40px;"&gt;This notes cover the basic of PHP programming, as well as other interesting notes that I find along the way.&lt;br&gt;&lt;/div&gt;&lt;h2 style="margin-left: 40px;" id="c2xa17"&gt;&lt;a id="Table_of_Content_8017771030324009" name="Table_of_Content_8017771030324009"&gt;&lt;/a&gt;Table of Content&lt;br&gt;&lt;/h2&gt;


&lt;div style="margin-left: 40px;" class="writely-toc" id="WritelyTableOfContents" toctype="none+none"&gt;&lt;ol class="writely-toc-none"&gt;&lt;li&gt;&lt;a target="_self" href="#Introduction_889893783261989"&gt;Introduction&lt;/a&gt;&lt;ol style="margin-left: 0pt;" class="writely-toc-subheading writely-toc-none"&gt;&lt;li&gt;&lt;a target="_self" href="#Overview__3521612082859278"&gt;Overview&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Table_of_Content_8017771030324009"&gt;Table of Content&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#References"&gt;References&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Dynamic_Programming_Reflection"&gt;Dynamic Programming / Reflection&lt;/a&gt;&lt;ol style="margin-left: 0pt;" class="writely-toc-subheading writely-toc-none"&gt;&lt;li&gt;&lt;a target="_self" href="#Dynamically_setting_and_gettin"&gt;Dynamically setting and getting attributes&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Dynamic_function_call"&gt;Dynamic function call&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Disk_Management_09173542260145306"&gt;Zend Framework&lt;/a&gt;&lt;ol style="margin-left: 0pt;" class="writely-toc-subheading writely-toc-none"&gt;&lt;li&gt;&lt;a target="_self" href="#The_etc_fstab_file_75214390409"&gt;Links&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt;&lt;/div&gt;&lt;h1 id="ic.72"&gt;&lt;a id="References" name="References"&gt;&lt;/a&gt;References&lt;/h1&gt;&lt;div style="margin-left: 40px;"&gt;&lt;br&gt;&lt;br&gt;Functions&lt;br&gt;http://au2.php.net/functions&lt;br&gt;&lt;/div&gt;
&lt;h1 id="ic.72"&gt;&lt;a id="Dynamic_Programming_Reflection" name="Dynamic_Programming_Reflection"&gt;&lt;/a&gt;Dynamic Programming / Reflection&lt;/h1&gt;&lt;div style="margin-left: 40px;"&gt;PHP is not object oriented in nature, so within PHP there's already a lot of functions and built in features that supports dynamic programming. In fact, for certain operations it may be easier to do it in PHP as compared to other web programming language like Java (JSP) and .NET (ASP).&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;h2 style="margin-left: 40px;"&gt;&lt;a id="Dynamically_setting_and_gettin" name="Dynamically_setting_and_gettin"&gt;&lt;/a&gt;Dynamically setting and getting attributes&lt;br&gt;&lt;/h2&gt;&lt;div style="margin-left: 40px;"&gt;When an execution attempts to access properties of an object and the property does not exist, the built in function __get() and __set() is called, respectively. This means that you can have a class that looks like so:&lt;br&gt;&lt;br&gt;&lt;pre class="code"&gt;class DynamicBean&lt;br&gt;{&lt;br&gt;   private fields;&lt;br&gt;&lt;br&gt;   function DynamicBean() &lt;br&gt;   {&lt;br&gt;      fields = Array();&lt;br&gt;   }&lt;br&gt;&lt;br&gt;   function __get($fieldName)&lt;br&gt;   {&lt;br&gt;      return fields[$fieldName];&lt;br&gt;   }&lt;br&gt;&lt;br&gt;   function __set($fieldName, $value)&lt;br&gt;   {&lt;br&gt;      $fields[$fieldName] = $value;&lt;br&gt;   }&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;&lt;br&gt;The usage is simply as follow:&lt;br&gt;&lt;br&gt;&lt;pre class="code"&gt;DynamicBean bean = DynamicBean();&lt;br&gt;bean-&amp;gt;something = "anything";&lt;br&gt;&lt;br&gt;echo $bean-&amp;gt;something&lt;br&gt;// prints "anything"&lt;br&gt;&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;h2 style="margin-left: 40px;"&gt;&lt;a id="Dynamic_function_call" name="Dynamic_function_call"&gt;&lt;/a&gt;Dynamic function call&lt;br&gt;&lt;/h2&gt;&lt;div style="margin-left: 40px;"&gt;PHP doesn't really support reflection like in .NET or Java. You can't iterate through a list of method from a Class object, but it can invoke a function dynamically. &lt;br&gt;&lt;br&gt;&lt;b&gt;Ref: &lt;/b&gt;&lt;a title="http://au2.php.net/manual/en/functions.variable-functions.php" href="http://au2.php.net/manual/en/functions.variable-functions.php" id="bi_2"&gt;http://au2.php.net/manual/en/functions.variable-functions.php&lt;/a&gt;&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;pre class="code"&gt;class Foo&lt;br&gt;{&lt;br&gt;    function Variable()&lt;br&gt;    {&lt;br&gt;        $name = 'Bar';&lt;br&gt;        $this-&amp;gt;$name(); // This calls the Bar() method&lt;br&gt;    }&lt;br&gt;    &lt;br&gt;    function Bar()&lt;br&gt;    {&lt;br&gt;        echo "This is Bar";&lt;br&gt;    }&lt;br&gt;}&lt;br&gt;&lt;br&gt;$foo = new Foo();&lt;br&gt;$funcname = "Variable";&lt;br&gt;$foo-&amp;gt;$funcname();  // This calls $foo-&amp;gt;Variable()&lt;br&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;h1 id="ic.72"&gt;&lt;a id="Disk_Management_09173542260145306" name="Disk_Management_09173542260145306"&gt;&lt;/a&gt;Zend Framework&lt;br&gt;&lt;/h1&gt;
&lt;h2 style="margin-left: 40px;"&gt;&lt;a id="The_etc_fstab_file_75214390409" name="The_etc_fstab_file_75214390409"&gt;&lt;/a&gt;Links&lt;/h2&gt;&lt;div style="margin-left: 40px;"&gt;&lt;ul&gt;&lt;li&gt;Getting started: &lt;a title="http://mitchellhashimoto.com/zend-framework-tutorials/getting-started/" href="http://mitchellhashimoto.com/zend-framework-tutorials/getting-started/" id="mzjc"&gt;http://mitchellhashimoto.com/zend-framework-tutorials/getting-started/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt; &lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7320216364508166147-4975554942864053093?l=bytebarnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytebarnotes.blogspot.com/feeds/4975554942864053093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7320216364508166147&amp;postID=4975554942864053093' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7320216364508166147/posts/default/4975554942864053093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7320216364508166147/posts/default/4975554942864053093'/><link rel='alternate' type='text/html' href='http://bytebarnotes.blogspot.com/2009/03/php-programming.html' title='PHP Programming'/><author><name>Zen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_L8OQcDJozzM/Saz-OStxFoI/AAAAAAAAAJw/ewS-d4b_Wwg/S220/3309571384_055cbfbe4a.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7320216364508166147.post-8368530368014338159</id><published>2008-11-20T15:33:00.001-08:00</published><updated>2009-03-03T15:41:55.127-08:00</updated><title type='text'>Ubuntu Linux Home Server Guide</title><content type='html'>

 
 
 


 
 
 


 
 
 


 
 
 


 
 
 


 
 
 


 
 
 


 
 
 


 
 
 
&lt;div id="ic.7"&gt;&lt;h1&gt;&lt;a id="Introduction_889893783261989" name="Introduction_889893783261989"&gt;&lt;/a&gt;&lt;i&gt;&lt;a id="Introduction_" name="Introduction_"&gt;&lt;/a&gt;&lt;/i&gt;Introduction&lt;/h1&gt;&lt;h2 style="margin-left: 40px;"&gt;&lt;a id="Overview__2602488598774859" name="Overview__2602488598774859"&gt;&lt;/a&gt;Overview
&lt;br&gt;&lt;/h2&gt;&lt;div id="ic.7"&gt;&lt;div style="margin-left: 40px;"&gt;This notes cover how to manage disk drives in your LINUX box. When I wrote this I am on Ubuntu Server 8.04 - Hardy Heron but I believe this will still apply to other distro as well.&lt;br&gt;&lt;/div&gt;&lt;h2 style="margin-left: 40px;" id="c2xa17"&gt;&lt;a id="Table_of_Content_2651901104421027" name="Table_of_Content_2651901104421027"&gt;&lt;/a&gt;Table of Content&lt;br&gt;&lt;/h2&gt;


&lt;div style="margin-left: 40px;" class="writely-toc" id="WritelyTableOfContents" toctype="none+none"&gt;&lt;ol class="writely-toc-none"&gt;&lt;li&gt;&lt;a target="_self" href="#Introduction_889893783261989"&gt;Introduction&lt;/a&gt;&lt;ol style="margin-left: 0pt;" class="writely-toc-subheading writely-toc-none"&gt;&lt;li&gt;&lt;a target="_self" href="#Overview__2602488598774859"&gt;Overview&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Table_of_Content_2651901104421027"&gt;Table of Content&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Basic_Administration__6187309446611586"&gt;Basic Administration&lt;/a&gt;&lt;ol style="margin-left: 0pt;" class="writely-toc-subheading writely-toc-none"&gt;&lt;li&gt;&lt;a target="_self" href="#The_Root_Session"&gt;The Root Session&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#User_and_Group_Management"&gt;User and Group Management&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Disk_Management_8279291749679539"&gt;Disk Management&lt;/a&gt;&lt;ol style="margin-left: 0pt;" class="writely-toc-subheading writely-toc-none"&gt;&lt;li&gt;&lt;a target="_self" href="#The_etc_fstab_file_75214390409"&gt;The /etc/fstab file&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Listing_all_known_disc_8378671"&gt;Listing all known disc&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Partition_management_via_fdisk"&gt;Partition management via fdisk&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Formatting_a_disc_with_NTFS_78"&gt;Formatting a disc with NTFS&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Package_Management_2039711196427596"&gt;Package Management&lt;/a&gt;&lt;ol style="margin-left: 0pt;" class="writely-toc-subheading writely-toc-none"&gt;&lt;li&gt;&lt;a target="_self" href="#Basic_Packages_525425832117031"&gt;Basic Packages&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Enable_multiverse_505890354849"&gt;Enable multiverse&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#System_Upgrades"&gt;System Upgrades&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;&lt;a target="_self" href="#Printers_cupsys_"&gt;Printers (cupsys)&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br&gt;
&lt;h1 id="ic.72"&gt;&lt;a id="Basic_Administration__6187309446611586" name="Basic_Administration__6187309446611586"&gt;&lt;/a&gt;Basic Administration&lt;br&gt;
&lt;/h1&gt;
&lt;h2 style="margin-left: 40px;"&gt;&lt;a id="The_Root_Session" name="The_Root_Session"&gt;&lt;/a&gt;&lt;b&gt;The Root &lt;/b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;Session&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;div style="margin-left: 40px;"&gt;as opposed to actually enabling the root account, a root session is simply starting a bash shell under &lt;b&gt;sudo&lt;/b&gt;, like so:&lt;br&gt;
&lt;pre class="code"&gt;sudo bash&lt;br&gt;&lt;/pre&gt;

&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt;Once the root session is up, you are essentially &lt;i&gt;root&lt;/i&gt;, but you'll have to do this everytime you want to have a root session. However, this is still more secure than having the root account enabled. &lt;br&gt;&lt;/div&gt;&lt;h2 style="margin-left: 40px;"&gt;&lt;a id="User_and_Group_Management" name="User_and_Group_Management"&gt;&lt;/a&gt;User and Group Management&lt;/h2&gt;&lt;div style="margin-left: 40px;"&gt;Adding and deleting a user&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt;&lt;pre class="code"&gt;adduser &amp;lt;username&amp;gt;; #add user&lt;br&gt;deluser &amp;lt;username&amp;gt;; #delete a user&lt;br&gt;&lt;/pre&gt;Adding and deleting a group&lt;br&gt;&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt;
&lt;pre class="code"&gt;addgroup &amp;lt;groupname&amp;gt;; #add group&lt;br&gt;delgroup &amp;lt;groupname&amp;gt;; #deletes a group&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;h1 id="ic.72"&gt;&lt;a id="Disk_Management_8279291749679539" name="Disk_Management_8279291749679539"&gt;&lt;/a&gt;Disk Management&lt;br&gt;&lt;/h1&gt;
&lt;h2 style="margin-left: 40px;"&gt;&lt;a id="The_etc_fstab_file_75214390409" name="The_etc_fstab_file_75214390409"&gt;&lt;/a&gt;The /etc/fstab file&lt;/h2&gt;
&lt;div style="margin-left: 40px;"&gt;When a Linux system starts, it will automatically mount everything that is in the &lt;b&gt;/etc/fstab&lt;/b&gt; file. If you attach a new disk drive into tour Linux box and do not add any entry into the /etc/fstab file, then the disk will not be mounted into the filesystem.&amp;nbsp;&lt;/div&gt;&lt;br&gt;&lt;div id="ic.7"&gt;
&lt;div style="margin-left: 40px;"&gt;Remounting partition can only be done by &lt;b&gt;root&lt;/b&gt; privilege user. The command is: &lt;br&gt;
&lt;/div&gt;
&lt;pre style="margin-left: 40px;" class="code"&gt;mount -a&lt;br&gt;&lt;/pre&gt;
&lt;h2 style="margin-left: 40px;"&gt;&lt;a id="Listing_all_known_disc_8378671" name="Listing_all_known_disc_8378671"&gt;&lt;/a&gt;Listing all known disc&lt;/h2&gt;&lt;div style="margin-left: 40px;"&gt;To list all the known disk, use the following command&lt;br&gt;&lt;/div&gt;&lt;pre style="margin-left: 40px;" class="code"&gt;ls -ltrh /dev/disk/by-uuid&lt;br&gt;&lt;/pre&gt;&lt;div style="margin-left: 40px;"&gt;This will list all disk by its known UUID, as well as where each disk maps to. (/dev/sda1, and so on)&lt;br&gt;&lt;/div&gt;&lt;h2 style="margin-left: 40px;"&gt;&lt;a id="Partition_management_via_fdisk" name="Partition_management_via_fdisk"&gt;&lt;/a&gt;&lt;b&gt;Partition management via fdisk&lt;/b&gt;&lt;br&gt;&lt;/h2&gt;&lt;div style="margin-left: 40px;"&gt;The &lt;b&gt;fdisk &lt;/b&gt;utility provide you with means of managing the partition in a disk. Prior to starting, do ensure that the disk is not mounted / busy.&lt;br&gt;The most basic usage is as follow:&lt;br&gt;&lt;/div&gt;&lt;pre style="margin-left: 40px;" class="code"&gt;fdisk /dev/sdb&lt;/pre&gt;&lt;div style="margin-left: 40px;"&gt;Where /dev/sdb is the disc (&lt;u&gt;not the partition&lt;/u&gt;) you want to work against. With this tool, you have to remember that:&lt;br&gt;&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt;&lt;ul&gt;&lt;li&gt;Changes will only takes effect once &lt;b&gt;w&lt;/b&gt; (write) is issued.&lt;/li&gt;&lt;li&gt;You can experiment and cancel the operation with the usual &lt;b&gt;ctrl+c&lt;/b&gt;&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;h2 style="margin-left: 40px;"&gt;&lt;a id="Formatting_a_disc_with_NTFS_78" name="Formatting_a_disc_with_NTFS_78"&gt;&lt;/a&gt;Formatting a disc with NTFS&lt;br&gt;&lt;/h2&gt;&lt;div style="margin-left: 40px;"&gt;Linux doesn't automagically reads NTFS file system. But Linux being linux, obviously it can. In Ubuntu, the tools to work with ntfs can be installed (via root privilege) via:&lt;br&gt;&lt;/div&gt;&lt;pre style="margin-left: 40px;" class="code"&gt;apt-get install ntfsprogs&lt;br&gt;&lt;/pre&gt;&lt;div style="margin-left: 40px;"&gt;The program you want to use is &lt;b&gt;mkntfs. &lt;/b&gt;As usual, the &lt;b&gt;man&lt;/b&gt; page will tell you alot of things about it. &lt;br&gt;Before running this, please make sure that the partitions in the disc have been correctly set with &lt;b&gt;fdisk&lt;/b&gt;.&lt;br&gt;&lt;/div&gt;&lt;pre style="margin-left: 40px;" class="code"&gt;mkntfs -L "Disc Label" /dev/sdb1&lt;/pre&gt;&lt;div style="margin-left: 40px;"&gt;
( Where /dev/sdb1 is the partition in the disc where the ntfs file system will be created at )4.0 - Package Management&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt;
&lt;/div&gt;

&lt;div style="margin-left: 40px;"&gt;
&lt;h2&gt;&lt;br&gt;&lt;/h2&gt;&lt;/div&gt;&lt;h1 id="ic.72"&gt;Networking&lt;/h1&gt;&lt;div style="margin-left: 40px;"&gt;Anything to do with networking, setting up IP, DHCP, and so on. &lt;br&gt;&lt;/div&gt;&lt;h2 style="margin-left: 40px;"&gt;IP Address&lt;/h2&gt;&lt;div style="margin-left: 40px;"&gt;IP address is managed via &lt;b&gt;ifconfig&lt;/b&gt; - but changes made using command below will &lt;i&gt;not&lt;/i&gt; be permanent. &lt;br&gt;&lt;/div&gt;&lt;pre style="margin-left: 40px;" class="code"&gt;ifconfig &amp;lt;interface_name&amp;gt; &amp;lt;ip_address&amp;gt;&lt;/pre&gt;&lt;div style="margin-left: 40px;"&gt;&lt;/div&gt;&lt;h2 style="margin-left: 40px;"&gt;&lt;/h2&gt;&lt;div style="margin-left: 40px;"&gt;To make changes permanent, you'll need to configure the networking service. The file where the IP address can be configured is in &lt;b&gt;/etc/network/interfaces&lt;/b&gt;. &lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt;&lt;h2&gt;Static IP Configuration&lt;/h2&gt;&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt;(&amp;nbsp; IP address shown here are only example )&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;pre style="margin-left: 40px;" class="code"&gt;# This file describes the network interfaces available on your system&lt;br&gt;# and how to activate them. For more information, see interfaces(5).&lt;br&gt;&lt;br&gt;# The loopback network interface&lt;br&gt;auto lo&lt;br&gt;iface lo inet loopback&lt;br&gt;&lt;br&gt;# The primary network interface&lt;br&gt;auto eth0&lt;br&gt;iface eth0 inet static&lt;br&gt;address 192.168.1.11&lt;br&gt;network 192.168.1.0&lt;br&gt;broadcast 192.168.1.255&lt;br&gt;gateway 192.168.1.1&lt;br&gt;netmask 255.255.255.0&lt;br&gt;&lt;/pre&gt;&lt;div style="margin-left: 40px;"&gt;&lt;br&gt;&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt;&lt;h2&gt;&lt;b&gt;Dynamic IP Configuration&lt;/b&gt; (a.k.a DHCP)&lt;/h2&gt;&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt;&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt;&lt;pre class="code"&gt;# This file describes the network interfaces available on your system&lt;br&gt;# and how to activate them. For more information, see interfaces(5).&lt;br&gt;&lt;br&gt;# The loopback network interface&lt;br&gt;auto lo&lt;br&gt;iface lo inet loopback&lt;br&gt;&lt;br&gt;# The primary network interface&lt;br&gt;auto eth0&lt;br&gt;iface eth0 inet dhcp&lt;/pre&gt;&lt;/div&gt;&lt;h2 style="margin-left: 40px;"&gt;&lt;/h2&gt;&lt;h2 style="margin-left: 40px;"&gt;Restarting Networking Service&lt;/h2&gt;&lt;div style="margin-left: 40px;"&gt;For your changes to take effect, you need to restart networking service.&lt;br&gt;&lt;/div&gt;&lt;pre style="margin-left: 40px;" class="code"&gt;sudo /etc/init.d/networking [ start | stop | restart | force-reload ]&lt;/pre&gt;&lt;div style="margin-left: 40px;"&gt;&lt;/div&gt;&lt;h2 style="margin-left: 40px;"&gt;Managing your DNS search entry&lt;/h2&gt;&lt;div style="margin-left: 40px;"&gt;DNS is configured from the file &lt;b&gt;/etc/resolv.conf&lt;/b&gt;, edit the file and make it look like so:&lt;br&gt;&lt;/div&gt;&lt;pre style="margin-left: 40px;" class="code"&gt;search com&lt;br&gt;nameserver &amp;lt;DNS_IP_ADDR_1&amp;gt;&lt;br&gt;nameserver &amp;lt;DNS_IP_ADDR_N&amp;gt;&lt;br&gt;&lt;/pre&gt;
&lt;br&gt;&lt;div style="margin-left: 40px;"&gt;What this means is, it will search &lt;i&gt;hostname.&lt;u&gt;com&lt;/u&gt;&lt;/i&gt; against &amp;lt;DNS_IP_ADDR&amp;gt;. Depending on your setup, you can set &amp;lt;DNS_IP_ADDR_*&amp;gt; to your Gateway's IP address or the one provided by your ISP.&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;div style="margin-left: 40px;"&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;h1 id="ic.72"&gt;&lt;a id="Package_Management_2039711196427596" name="Package_Management_2039711196427596"&gt;&lt;/a&gt;Package Management&lt;br&gt;&lt;/h1&gt;&lt;div style="margin-left: 40px;"&gt;&lt;h2&gt;&lt;a id="Basic_Packages_525425832117031" name="Basic_Packages_525425832117031"&gt;&lt;/a&gt;&lt;b&gt;&lt;b&gt;Basic Packages&lt;/b&gt;&lt;/b&gt;&lt;/h2&gt;The following are the basic packages that I get on top of the basic installation. Run from &lt;i&gt;root session&lt;/i&gt;.&lt;br&gt;
&lt;pre class="code"&gt;# vim&lt;br&gt;apt-get install vim-full;&lt;br&gt;&lt;br&gt;# coding&lt;br&gt;apt-get install sun-java-jdk; &lt;br&gt;&lt;br&gt;# disc mgmt&lt;br&gt;apt-get install ntfsprogs;&lt;br&gt;apt-get install testdisk;&lt;br&gt;&lt;/pre&gt;
Apparently, &lt;i&gt;python&lt;/i&gt; is part of the installation, which is cool.&lt;br&gt;&lt;h2&gt;&lt;a id="Enable_multiverse_505890354849" name="Enable_multiverse_505890354849"&gt;&lt;/a&gt;&lt;b&gt;Enable multiverse&lt;/b&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div id="azy4" style="margin-left: 40px;"&gt;edit file: /etc/apt/sources.list and uncomment the appropriate lines.&lt;br&gt;&lt;h2&gt;&lt;a id="System_Upgrades" name="System_Upgrades"&gt;&lt;/a&gt;&lt;b&gt;System Upgrades&lt;/b&gt;&lt;/h2&gt;The operating system is constantly being updated. To retrieve and install these updates, do:&lt;br&gt;&lt;pre class="code"&gt;apt-get upgrade&lt;/pre&gt;&lt;/div&gt;&lt;div id="azy4"&gt;&lt;h1&gt;&lt;a id="Printers_cupsys_" name="Printers_cupsys_"&gt;&lt;/a&gt;Printers (cupsys)&lt;/h1&gt;&lt;/div&gt;&lt;div id="azy4" style="margin-left: 40px;"&gt;
&lt;/div&gt;&lt;div id="azy4"&gt;
&lt;div style="margin-left: 40px;"&gt;Ref: &lt;a title="http://ubuntuforums.org/showthread.php?t=240282" href="http://ubuntuforums.org/showthread.php?t=240282" id="y8:y"&gt;http://ubuntuforums.org/showthread.php?t=240282&lt;/a&gt; &lt;br&gt;
Operate from a &lt;i&gt;root session&lt;/i&gt;&lt;br&gt;
&lt;br&gt;
installation&lt;br&gt;
&lt;pre class="code"&gt;apt-get install cupsys cupsys-client&lt;/pre&gt;

backup and modify /etc/cups/cupsd.conf, &lt;br&gt;
&lt;pre class="code"&gt;cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.bak&lt;br&gt;vim /etc/cups/cupsd.conf&lt;/pre&gt;

change the appropriate section to the following:&lt;br&gt;
&lt;pre class="code"&gt;&lt;br&gt;&lt;span style="color: rgb(39, 78, 19);"&gt;# Only listen for connections from the local machine.&lt;/span&gt;&lt;br style="color: rgb(39, 78, 19);"&gt;&lt;span style="color: rgb(39, 78, 19);"&gt;# Listen localhost:631 (not anymore)&lt;/span&gt;&lt;br&gt;Listen 631&lt;br&gt;Listen /var/run/cups/cups.sock&lt;br&gt;&lt;br&gt;&lt;span style="color: rgb(39, 78, 19);"&gt;# Show shared printers on the local network.&lt;/span&gt;&lt;br&gt;Browsing On&lt;br&gt;BrowseOrder allow,deny&lt;br&gt;&lt;span style="color: rgb(39, 78, 19);"&gt;#old value: BrowseAllow @LOCAL&lt;/span&gt;&lt;br&gt;BrowseAllow all&lt;br&gt;&lt;br style="color: rgb(39, 78, 19);"&gt;&lt;span style="color: rgb(39, 78, 19);"&gt;#old value: BrowseAddress @LOCAL&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span style="color: rgb(39, 78, 19);"&gt;# Default authentication type, when authentication is required...&lt;/span&gt;&lt;br&gt;DefaultAuthType Basic&lt;br&gt;&lt;br style="color: rgb(39, 78, 19);"&gt;&lt;span style="color: rgb(39, 78, 19);"&gt;# Restrict access to the server...&lt;/span&gt;&lt;br style="color: rgb(39, 78, 19);"&gt;&lt;span style="color: rgb(39, 78, 19);"&gt;# old value: Order allow,deny&lt;/span&gt;&lt;br&gt;&amp;lt;Location /&amp;gt;&lt;br&gt; Allow all&lt;br&gt;&amp;lt;/Location&amp;gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;

Restart cupsys&lt;br&gt;
&lt;pre class="code"&gt;/etc/init.d/cupsys restart&lt;span style="color: rgb(39, 78, 19);"&gt;&lt;/span&gt;&lt;/pre&gt;

Get info on connected printer and note down the &lt;b&gt;printerpath&lt;/b&gt; that that you want to use&lt;br&gt;
&lt;pre class="code"&gt;lpinfo -v&lt;/pre&gt;

Add printer&lt;br&gt;
&lt;pre class="code"&gt;lpadmin -E -p &lt;span style="color: rgb(153, 0, 0);"&gt;&amp;lt;printername&amp;gt;&lt;/span&gt; -v &lt;span style="color: rgb(153, 0, 0);"&gt;&amp;lt;printerpath&amp;gt;&lt;/span&gt; -P &lt;span style="color: rgb(153, 0, 0);"&gt;&amp;lt;path to printer driver&amp;gt;&lt;/span&gt; -u allow:all&lt;br&gt;&lt;/pre&gt;

Example:&lt;br&gt;
&lt;pre class="code"&gt;lpadmin -E -p &lt;span style="color: rgb(153, 0, 0);"&gt;myprinter&lt;/span&gt; -v &lt;span style="color: rgb(153, 0, 0);"&gt;parallel:/dev/lp0&lt;/span&gt; -P &lt;span style="color: rgb(153, 0, 0);"&gt;/usr/share/ppd/cups-included/HP/deskjet.ppd&lt;/span&gt; -u allow:all&lt;/pre&gt;

Setup and administration:&lt;br&gt;
&lt;pre class="code"&gt;lpadmin -d &amp;lt;printername&amp;gt;; # sets this printer as default printer&lt;br&gt;cupsenable &amp;lt;printername&amp;gt;; # enable as default printer&lt;br&gt;accept &amp;lt;printername&amp;gt; ; # get printer to start accepting job&lt;span style="color: rgb(153, 0, 0);"&gt;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;

If you want to delete a printer:&lt;br&gt;
&lt;pre class="code"&gt;lpadmin -x &amp;lt;printername&amp;gt;;&lt;/pre&gt;

&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="azy4" style="margin-left: 40px;"&gt;&lt;div style="margin-left: 40px;"&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br id="azy40"&gt;
&lt;br id="g03z0"&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="fjhs7"&gt;
&lt;div id="okan0" style="margin-left: 40px;"&gt;&lt;br id="c2xa563"&gt;
&lt;/div&gt;
&lt;br id="c2xa564"&gt;
&lt;br id="c2xa565"&gt;
&lt;br id="c2xa566"&gt;
&lt;br id="c2xa567"&gt;
&lt;br id="c2xa568"&gt;
&lt;br id="okqw2"&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7320216364508166147-8368530368014338159?l=bytebarnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytebarnotes.blogspot.com/feeds/8368530368014338159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7320216364508166147&amp;postID=8368530368014338159' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7320216364508166147/posts/default/8368530368014338159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7320216364508166147/posts/default/8368530368014338159'/><link rel='alternate' type='text/html' href='http://bytebarnotes.blogspot.com/2008/11/disk-management-in-linux-ubuntu.html' title='Ubuntu Linux Home Server Guide'/><author><name>Zen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_L8OQcDJozzM/Saz-OStxFoI/AAAAAAAAAJw/ewS-d4b_Wwg/S220/3309571384_055cbfbe4a.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7320216364508166147.post-4742704532340959480</id><published>2008-11-20T15:30:00.000-08:00</published><updated>2008-11-20T15:31:01.897-08:00</updated><title type='text'>Test</title><content type='html'>This is a test&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7320216364508166147-4742704532340959480?l=bytebarnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytebarnotes.blogspot.com/feeds/4742704532340959480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7320216364508166147&amp;postID=4742704532340959480' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7320216364508166147/posts/default/4742704532340959480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7320216364508166147/posts/default/4742704532340959480'/><link rel='alternate' type='text/html' href='http://bytebarnotes.blogspot.com/2008/11/test.html' title='Test'/><author><name>Zen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_L8OQcDJozzM/Saz-OStxFoI/AAAAAAAAAJw/ewS-d4b_Wwg/S220/3309571384_055cbfbe4a.jpg'/></author><thr:total>0</thr:total></entry></feed>
