<?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/"
	>

<channel>
	<title>Tutorials Bay</title>
	<atom:link href="http://tutorialsbay.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tutorialsbay.com</link>
	<description>Quality Tutorials for everyone!</description>
	<lastBuildDate>Wed, 08 Feb 2012 15:37:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>cPanel FTP 550 Could not delete/edit Permission denied</title>
		<link>http://tutorialsbay.com/cpanel-ftp-550-could-not-deleteedit-permission-denied/</link>
		<comments>http://tutorialsbay.com/cpanel-ftp-550-could-not-deleteedit-permission-denied/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 15:37:46 +0000</pubDate>
		<dc:creator>Mody</dc:creator>
				<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://tutorialsbay.com/?p=670</guid>
		<description><![CDATA[This cpanel ftp problem is usually caused when there is something wrong with files ownership, this happened to me today while I was trying to delete some files from a cPanel account using FileZilla, It even happened while I was trying to use cPanel file manager, there is an easy and quick way to fix [...]]]></description>
			<content:encoded><![CDATA[<p>This cpanel ftp problem is usually caused when there is something wrong with files ownership, this happened to me today while I was trying to delete some files from a cPanel account using FileZilla, It even happened while I was trying to use cPanel file manager, there is an easy and quick way to fix this permission problem.</p>
<p>If you have a VPS or Dedicated server and have access to SSH, then ssh to your server and cd to the <strong>public_html</strong> directory of the user who&#8217;s having the problem</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>username<span style="color: #000000; font-weight: bold;">/</span>public_html</pre></div></div>

<p>then run the following command to fix the permission problem</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chown</span> username.username <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #660033;">-R</span></pre></div></div>

<p>replace username with the actual cPanel username</p>
<p>and if you are on a shared hosting and don&#8217;t have SSH access, you might want to refer your hosting company to this page</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialsbay.com/cpanel-ftp-550-could-not-deleteedit-permission-denied/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Tkinter &amp; Sqlite3 GUI programming tutorial</title>
		<link>http://tutorialsbay.com/python-tkinter-sqlite3-gui/</link>
		<comments>http://tutorialsbay.com/python-tkinter-sqlite3-gui/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 20:00:38 +0000</pubDate>
		<dc:creator>Mody</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://tutorialsbay.com/?p=658</guid>
		<description><![CDATA[I have been playing with Python &#38; Tkinter for couple of days, then thought of sqlite3 so I can do something useful with Python Tkinter &#38; sqlite3, after this tutorial you will know how to create basic a Python program to store notes in sqlite3 database and retrieve them, This program should work on Windows, [...]]]></description>
			<content:encoded><![CDATA[<p>I have been playing with Python &amp; Tkinter for couple of days, then thought of sqlite3 so I can do something useful with Python Tkinter &amp; sqlite3, after this tutorial you will know how to create basic a Python program to store notes in sqlite3 database and retrieve them, This program should work on Windows, Linux and Mac.<br />
the final program will look like this:<br />
<img src="http://tutorialsbay.com/wp-content/uploads/2012/02/python-tkinter-program.png" alt="python-tkinter-program" title="Python Tkinter" width="351" height="346" class="alignnone size-full wp-image-664" /></p>
<p>You will need:<br />
<a title="Opens in new window" href="http://python.org">Python</a> installed<br />
<a title="opens in new window" href="http://sqlite3.org" target="_blank">Sqlite3</a> Library</p>
<p>Sqlite comes with a Command Line Shell for creating and managing databases</p>
<p><strong>Create an empty sqlite database</strong><br />
If you are on windows go to <strong>Start &gt; run</strong> , type CMD ad the command line window will appear, make sure you have an empty folder created wherever you want to build the program, in my case I created a folder on desktop called &#8220;program&#8221;, if you did like me then in windows command line windows type</p>
<p class="note">cd Desktop/program</p>
<p>At a shell or DOS prompt, enter</p>
<p class="note">sqlite3 mydb</p>
<p>that creates an empty sqlite3 database, now lets create a table to store notes</p>
<p class="note">create table mynotes(note varchar(50) );</p>
<p>the above line creates an empty table inside the database &#8220;<strong>mydb</strong>&#8221;</p>
<p><strong>Python file</strong><br />
Create an empty file inside the same dir and name it <strong>prog.py</strong><br />
and paste the following inside it (don&#8217;t worry I will try to explain most of it):</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">Tkinter</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #66cc66;">*</span>
<span style="color: #ff7700;font-weight:bold;">import</span> sqlite3
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Program:
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, master<span style="color: black;">&#41;</span>:
        frame = Frame<span style="color: black;">&#40;</span>master, width=<span style="color: #ff4500;">80</span>, height=<span style="color: #ff4500;">50</span><span style="color: black;">&#41;</span>
        frame.<span style="color: black;">pack</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">text</span> = Label<span style="color: black;">&#40;</span>frame, text=<span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">text</span>.<span style="color: black;">pack</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">text</span>.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row=<span style="color: #ff4500;">0</span>, sticky=W, pady=<span style="color: #ff4500;">10</span>, padx=<span style="color: #ff4500;">10</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">TextField</span> = Entry<span style="color: black;">&#40;</span>frame, width=<span style="color: #ff4500;">45</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">TextField</span>.<span style="color: black;">pack</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">TextField</span>.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row=<span style="color: #ff4500;">1</span>, rowspan=<span style="color: #ff4500;">2</span>, sticky=W,  pady=<span style="color: #ff4500;">5</span>, padx=<span style="color: #ff4500;">10</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">btn</span> = Button<span style="color: black;">&#40;</span>frame, text=<span style="color: #483d8b;">&quot;Add note&quot;</span>, command=<span style="color: #008000;">self</span>.<span style="color: black;">add_note</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">btn</span>.<span style="color: black;">pack</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">btn</span>.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row=<span style="color: #ff4500;">3</span>, rowspan=<span style="color: #ff4500;">2</span>, sticky=W, pady=<span style="color: #ff4500;">10</span>, padx=<span style="color: #ff4500;">10</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">showbtn</span> = Button<span style="color: black;">&#40;</span>frame, text=<span style="color: #483d8b;">&quot;Show Notes&quot;</span>, command = <span style="color: #008000;">self</span>.<span style="color: black;">show_notes</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">showbtn</span>.<span style="color: black;">pack</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">showbtn</span>.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row=<span style="color: #ff4500;">3</span>, rowspan=<span style="color: #ff4500;">2</span>,  pady=<span style="color: #ff4500;">10</span>, padx=<span style="color: #ff4500;">80</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
        <span style="color: #808080; font-style: italic;"># create an empty Tkinter listbox</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">content</span> = Listbox<span style="color: black;">&#40;</span>master, width=<span style="color: #ff4500;">50</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">content</span>.<span style="color: black;">pack</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> add_note<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
&nbsp;
        <span style="color: #808080; font-style: italic;"># if texfield is empty</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.<span style="color: black;">TextField</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">&quot;&quot;</span>:
            <span style="color: #808080; font-style: italic;"># then set text label text</span>
            <span style="color: #008000;">self</span>.<span style="color: black;">text</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;text&quot;</span><span style="color: black;">&#93;</span> = <span style="color: #483d8b;">&quot;Please type a note&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
&nbsp;
            <span style="color: #808080; font-style: italic;"># everything is ok lets get the typed note</span>
            item = <span style="color: #008000;">self</span>.<span style="color: black;">TextField</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
            <span style="color: #808080; font-style: italic;"># create sqlite connection            </span>
            conn = sqlite3.<span style="color: black;">connect</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'mynotes'</span><span style="color: black;">&#41;</span>
            c = conn.<span style="color: black;">cursor</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
            <span style="color: #808080; font-style: italic;"># insert a row</span>
            c.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;insert into notes (mynote) values (?)&quot;</span>, <span style="color: black;">&#40;</span>item,<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
            conn.<span style="color: black;">commit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>                  
&nbsp;
            <span style="color: #808080; font-style: italic;"># close connection</span>
            c.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
            <span style="color: #808080; font-style: italic;"># clear input</span>
            <span style="color: #008000;">self</span>.<span style="color: black;">TextField</span>.<span style="color: black;">delete</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>, END<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> show_notes<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
            conn = sqlite3.<span style="color: black;">connect</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'mynotes'</span><span style="color: black;">&#41;</span>
            c = conn.<span style="color: black;">cursor</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
            <span style="color: #808080; font-style: italic;"># select all entries from database</span>
            <span style="color: #008000;">list</span> = c.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;SELECT * FROM notes&quot;</span><span style="color: black;">&#41;</span>
            conn.<span style="color: black;">commit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
            <span style="color: #808080; font-style: italic;"># list has an array so lets loop the array and insert each item to</span>
            <span style="color: #808080; font-style: italic;"># our listbox</span>
&nbsp;
            <span style="color: #ff7700;font-weight:bold;">for</span> row <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">list</span>:
                    <span style="color: #008000;">self</span>.<span style="color: black;">content</span>.<span style="color: black;">insert</span><span style="color: black;">&#40;</span>END, row<span style="color: black;">&#41;</span>                    
            c.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
&nbsp;
root = Tk<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
application = Program<span style="color: black;">&#40;</span>root<span style="color: black;">&#41;</span>
root.<span style="color: black;">mainloop</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Lets explain the code above</p>
<div class="note">
    def __init__(self, master):<br />
        frame = Frame(master, width=80, height=50)<br />
        frame.pack()
</div>
<p class="note">
def __init__(self, master):
</pre>
<p>function for initialization.</p>
<div class="note">
frame = frame = Frame(master, width=80, height=50)<br />
frame.pack()
</div>
<p>Creates the main frame</p>
<div class="note">
        self.text = Label(frame, text="")<br />
        self.text.pack()<br />
        self.text.grid(row=0, sticky=W, pady=10, padx=10)
</div>
<p>it creates a label where we can put any text we want, we created a label to show a message if field left empty<br />
row , sticky, pady, padx control the position of the label</p>
<div class="note">
        self.TextField = Entry(frame, width=45)<br />
        self.TextField.pack()<br />
        self.TextField.grid(row=1, rowspan=2, sticky=W,  pady=5, padx=10)
</div>
<p>Creates a text field, you may note there is "frame" as first argument, that's the name of Tkinter frame we want the text field in</p>
<div class="note">
        self.btn = Button(frame, text="Add note", command=self.add_note)<br />
        self.btn.pack()<br />
        self.btn.grid(row=3, rowspan=2, sticky=W, pady=10, padx=10)
</div>
<p>Creates a button, <strong>text</strong> argument is the text displayed on the button, <strong>command</strong> is the function to run when you click that button</p>
<div class="note">
        self.content = Listbox(master, width=50)<br />
        self.content.pack()
</div>
<p>Creates an empty Tkinter listbox (thats where we will display sqlite3 contents)</p>
<div class="note">
item = self.TextField.get()<br />
            conn = sqlite3.connect('mynotes')<br />
            c = conn.cursor()</p>
<p>            # insert a row<br />
            c.execute("insert into notes (mynote) values (?)", (item,))<br />
            conn.commit()<br />
            c.close()</p>
<p>            # clear input<br />
            self.TextField.delete(0, END)
</p></div>
<p>where <strong>item </strong>= <strong>self.TextField.get()</strong> we are getting the text typed into Textfield.<br />
where <strong>self.TextField.delete(0, END)</strong> we are reseting the field.<br />
<strong>sqlite3.connect('mynotes')</strong> creates a sqlite connection to mynotes (the database).</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialsbay.com/python-tkinter-sqlite3-gui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP search facebook posts using Graph  API (JSON)</title>
		<link>http://tutorialsbay.com/php-search-facebook-posts-json/</link>
		<comments>http://tutorialsbay.com/php-search-facebook-posts-json/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 21:57:54 +0000</pubDate>
		<dc:creator>Mody</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://tutorialsbay.com/?p=642</guid>
		<description><![CDATA[Facebook offers a flexible and easy to use API called Graph, graph is simply a URL that once you open in a browser or within your code it return a JSON (JavaScript Object Notation ) string, in this tutorial you will learn how to use php and facebook graph API to access public posts and [...]]]></description>
			<content:encoded><![CDATA[<p>Facebook offers a flexible and easy to use API called Graph, graph is simply a URL that once you open in a browser or within your code it return a JSON (JavaScript Object Notation ) string, in this tutorial you will learn how to use php and facebook graph API to access public posts and parse JSON results with php, We will build together a php  search engine to parse JSON returned by Facebook Graph and display results to visitors</p>
<p>view this in action <a href="http://tutorialsbay.com/demo/graph-search" title="Opens in new window" target="_blank"><strong>Demo</strong></a></p>
<p>If you don&#8217;t know what is <a title="Opens in new window" href="http://www.json.org/" target="_blank">Json</a>, a Json string looks like this</p>
<p class="note">{<br />
&#8220;name&#8221;: &#8220;John Smith&#8221;,<br />
&#8220;Age&#8221;: &#8220;30&#8243;,<br />
&#8220;username&#8221;: &#8220;Jsith&#8221;,<br />
&#8220;location&#8221;: &#8220;Chicago&#8221;<br />
}</p>
<p>Our search engine will be 2 pages<br />
<strong><br />
index.html<br />
search.php<br />
</strong></p>
<p>index.html content</p>
<p class="note">
&lt;form action=&#8221;search.php&#8221; method=&#8221;post&#8221;&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;keyword&#8221; /&gt;<br />
&lt;input type=&#8221;submit&#8221; value=&#8221;search&#8221; /&gt;<br />
&lt;/form>
</p>
<p>in the above step we build a basic html page with a form that contains text field and submit button to submit the form to our search.php, then once a user type a keyword and hit submit we want to take that keyword and search facebook public posts suing their graph API.</p>
<p>Now in <strong>search.php</strong> We need to catch the submitted keyword from index.html</p>
<p class="note">
$keyword = $_POST['keyword'];
</p>
<p>The graph url which will return a JSON string is https://graph.facebook.com/search<br />
the url accepts many parameters but we will use the basic ones such as type and q (query)<br />
you can see what the JSON results would look like before we parse them with PHP here:<br />
<a title="ope" href="https://graph.facebook.com/?q=hello&amp;type=post" target="_blank">https://graph.facebook.com/search?q=hello&amp;type=post</a><br />
Now lets set the graph url we will be opening with php</p>
<p class="note">// set graph url<br />
$graph_url = &#8220;https://graph.facebook.com/search?&#8221;;<br />
// add parameters to graph url<br />
$graph_url .= &#8220;&amp;type=posts&#8221;;<br />
$graph_url .= &#8220;&amp;q=$keyword&#8221;;</p>
<p>in the above step we have a prepared graph url with type parameter and q parameter, the q parameter is the keyword we want to search for and type is the kind of contents we need, we are going to search for posts, aren&#8217;t we?<br />
Now that facebook graph url is ready with the keyword we want to search for, lets have php open it so it returns the JSON results</p>
<p class="note">
$results = file_get_contents( $graph_url );
</p>
<p><strong><br />
$result</strong> will be the variable holding the JSON data returned by Facebook Graph, We now need to parse JSON and display it as readable text or HTML content, We will parse it using php function &#8211; json_decode() -</p>
<p class="note">
$json = json_decode($results);
</p>
<p>the json_decode() function in the way used above converts the JSON string into accessible objects, We will need to do a foreach loop to access those objects and print them, lets do that now </p>
<p class="note">
foreach( $json->data as $show ) {<br />
echo $show->from->name . &#8220;\n&#8221;;<br />
echo $show->message . &#8220;\n&#8221;;<br />
echo $show->created_time . &#8220;\n&#8221;<br />
echo &#8220;&lt;hr>&gt;&#8221;;<br />
}
</p>
<p>Now you might be wondering why used $json->data and not $json alone, the answer is because all the returned results in JSON are inside an array called &#8220;data&#8221; and also you may have noticed to show the name of poster I&#8217;m doing $json->from->name is because &#8220;from&#8221; is an array and name is an object inside that array you can see how it looks like here <a title="ope" href="https://graph.facebook.com/?q=hello&amp;type=post" target="_blank">https://graph.facebook.com/?q=hello&amp;type=post</a>, In this tutorial I&#8217;m only showing name of person who made the post,  message which is post content, created time is the timestamp of the post date you can access many more such as Facebook user ID , description, comments count etc. By simple doing $show->xx where xx is the object name! I hope this helps you in your next Facebook app project! you can what we have created in action here</p>
<p>search.php all together will look like this</p>
<p class="note">
$keyword = $_POST['keyword'];<br />
$graph_url = &#8220;https://graph.facebook.com/search?&#8221;;<br />
$graph_url .= &#8220;&amp;type=posts&#8221;;<br />
$graph_url .= &#8220;&amp;q=$keyword&#8221;;<br />
$results = file_get_contents( $graph_url );<br />
$json = json_decode($results);<br />
foreach( $json->data as $show ) {<br />
echo $show->from->name . &#8220;\n&#8221;;<br />
echo $show->message . &#8220;\n&#8221;;<br />
echo $show->created_time . &#8220;\n&#8221;<br />
echo &#8220;&lt;hr>&gt;&#8221;;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialsbay.com/php-search-facebook-posts-json/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter time ago &#8211; How to get it done!</title>
		<link>http://tutorialsbay.com/codeigniter-time-ago/</link>
		<comments>http://tutorialsbay.com/codeigniter-time-ago/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 23:04:45 +0000</pubDate>
		<dc:creator>Mody</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://tutorialsbay.com/?p=636</guid>
		<description><![CDATA[In today&#8217;s web, its much better to use x hour ago, day ago , month ago , a year ago etc. CodeIgniter has a built-in function in date_helper that allows you to convert any date/time to &#8220;xx Time ago&#8221; style, its called timespan() it takes 2 arguments the first one is the date/time you want [...]]]></description>
			<content:encoded><![CDATA[<p>In today&#8217;s web, its much better to use x hour ago, day ago , month ago , a year ago etc. CodeIgniter has a built-in function in date_helper that allows you to convert any date/time to &#8220;xx Time ago&#8221; style, its called timespan() it takes 2 arguments the first one is the date/time you want to convert to &#8220;time ago style&#8221; and the second one should be current date time, below is an example show you how to use CodeIgniter timespan function</p>
<p>First you will need to load the date helper</p>
<div class="note php">$this-&gt;load-&gt;helper(&#8216;date&#8217;);</div>
<p>Now lets use the function in any of our controllers</p>
<div class="note php">timespan(1326927423, time() ) . &#8220;ago&#8221; ;</div>
<p>That will outputs something like</p>
<div class="note php">2 hours ago</div>
<p>Note that <strong>1326927423</strong> is a UNIX date format, see this <a title="Opens in new window" href="http://php.net/manual/en/function.date.php" target="_blank">page</a> to learn about date formats and how to convert them.</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialsbay.com/codeigniter-time-ago/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install OpenVPN Access server on a VPS</title>
		<link>http://tutorialsbay.com/openvpn-access-server-on-a-openvz-vps/</link>
		<comments>http://tutorialsbay.com/openvpn-access-server-on-a-openvz-vps/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 22:47:24 +0000</pubDate>
		<dc:creator>Mody</dc:creator>
				<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://tutorialsbay.com/?p=633</guid>
		<description><![CDATA[Let install OpenVZ AS (Access server) on an openvz VPS, as most vps providers are using openvz technology. We will be installing openvpn AS on a VPS with centOS 6 32bit, It should be no problem if you are using 64bit also this tutorial can work just fine on a dedicated server or Xen VPS. [...]]]></description>
			<content:encoded><![CDATA[<p>Let install OpenVZ AS (Access server) on an openvz VPS, as most vps providers are using openvz technology.<br />
We will be installing openvpn AS on a VPS with centOS 6 32bit, It should be no problem if you are using 64bit also this tutorial can work just fine on a dedicated server or Xen VPS.</p>
<p>The first thing you should do if you are on a openVZ VPS is asking your vps provider to enable TUN/TAP device for you or just give them the following commands to run on their hardware node<br />
to enable TUN/TAP</p>
<div class="note">vzctl set 101 &#8211;devnodes net/tun:rw &#8211;save</div>
<p>to enable IP tables if necessary</p>
<div class="note">vzctl set 101 &#8211;iptables ipt_REJECT &#8211;iptables ipt_tos &#8211;iptables ipt_TOS &#8211;iptables ipt_LOG &#8211;iptables ip_conntrack &#8211;iptables ipt_limit &#8211;iptables ipt_multiport &#8211;iptables iptable_filter &#8211;iptables iptable_mangle &#8211;iptables ipt_TCPMSS &#8211;iptables ipt_tcpmss &#8211;iptables ipt_ttl &#8211;iptables ipt_length &#8211;iptables ipt_state &#8211;iptables iptable_nat &#8211;iptables ip_nat_ftp &#8211;save</div>
<p>where 101 is your vps CID.</p>
<p>Now ssh to your server, if you are on Linux (Ctrl + t) to open terminal and type inside</p>
<div class="note">ssh root@xxx.xxx.xxx.xx</div>
<p>Where xxx.xx.. is your server IP address, it will then ask for root password just type it and hit enter to login to your server.</p>
<p>If you are on windows then use <a title="Opens in new window" href="https://www.google.com/search?client=ubuntu&amp;channel=fs&amp;q=putty&amp;ie=utf-8&amp;oe=utf-8" target="_blank">putty</a> to connect to your server.<br />
now that you&#8217;re logged in, run the following command to download openvpn access server installation script<br />
<strong>for centOS 32bit do this</strong></p>
<div class="note">wget http://swupdate.openvpn.org/as/openvpn-as-1.8.3-CentOS5.i386.rpm</div>
<p><strong>for centOS 64bit do this</strong></p>
<div class="note">wget http://swupdate.openvpn.org/as/openvpn-as-1.8.3-CentOS5.x86_64.rpm</div>
<p>run Openvpn Access Server installer for (32bit)</p>
<div class="note">rpm -i openvpn-as-1.8.3-CentOS5.i386.rpm</div>
<p>run Openvpn Access Server installer for (64bit)</p>
<div class="note">rpm -i openvpn-as-1.8.3-CentOS5.x86_64.rpm</div>
<p>it will take anywhere between 4 minutes and 10 minutes, it will create the master username(openvpn) so once done lets change the user &#8220;openvpn&#8221; password by running this</p>
<div class="note">passwd openvpn</div>
<p>choose a password, type and confirm it and that is it! you got openvpn access server installed and ready, to login to openvpn access server admin, the url would be something like this</p>
<div class="note">https://xxx.xxx.xxx:943/admin</div>
<p>where xxx.xxx.xxx is your server IP address, and make sure the url is starting with <strong>https</strong>, the user name would be <strong>openvpn</strong> and password would be the one you have chosen in last step.</p>
<p>and to login as a client the url would be</p>
<div class="note">https://xxx.xxx.xxx</div>
<p>the first time a client connect to openvpn access server, he may be asked to download openvpn connect client.</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialsbay.com/openvpn-access-server-on-a-openvz-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to host Multiple domains/Websites on Apache Without Control panel</title>
		<link>http://tutorialsbay.com/hosting-multiple-websites-ubuntu-lamp/</link>
		<comments>http://tutorialsbay.com/hosting-multiple-websites-ubuntu-lamp/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 22:55:07 +0000</pubDate>
		<dc:creator>Mody</dc:creator>
				<category><![CDATA[Servers]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://tutorialsbay.com/?p=624</guid>
		<description><![CDATA[So you have got a dedicated server or VPS and want to host more than one website /domain on Apache web server but also don&#8217;t want to spend money on control panel like cPanel , Directadmin etc.. I will show you how to seriously host multiple websites or domains on your LAMP stack easily without [...]]]></description>
			<content:encoded><![CDATA[<p>So you have got a dedicated server or VPS and want to host more than one website /domain on Apache web server but also don&#8217;t want to spend money on control panel like cPanel , Directadmin etc.. I will show you how to seriously host multiple websites or domains on your LAMP stack easily without any control panel! in this small tutorial I have Apache with Mysql , PHP on Ubuntu.</p>
<p>then lets SSH to server  first, I&#8217;m connecting from my Ubuntu desktop, if you are on  windows then look at <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" title="Opens in new window" target="_blank">putty</a> a cool ssh client for windows computers</p>
<p class='note'>
ssh root@xx.xxx.xx
</p>
<p>in this example we are going to host the domain name  &#8220;www.example.com&#8221;.<br />
now that you are logged in to server, lets change dir</p>
<p class='note'>
cd /etc/apache2/sites-available
</p>
<p>let&#8217;s create a configuration file for www.example.com<br />
NOTE: I will be using &#8220;vi&#8221; its a text editor that comes with Ubuntu and you can use it in any ssh session, if you don&#8217;t like it then install yum or just <strong>sftp</strong> to server and work with a GUI</p>
<p class='note'>
vi www.example.com
</p>
<p>Now that <strong>vi</strong> has create the virtual host file , lets copy and paste the following inside that file<br />
<strong>TIP</strong> to paste the following in the file we created/opened in the step above, press <strong>i</strong> then mouse <strong><em>right click</em></strong></p>
<p class='note'>
<VirtualHost *:80><br />
        ServerAdmin name@example.com<br />
        ServerName  example.com<br />
        ServerAlias www.example.com<br />
        # Indexes + Directory Root.<br />
        DirectoryIndex index.html<br />
        DocumentRoot /var/www/example.com<br />
</VirtualHost>
</p>
<p>Now lets save that file, press <strong>Esc</strong> 2 times then type:</p>
<p class='note'>
:wq
</p>
<p>Now we have to enable www.example.com on the server, to do that issue:</p>
<p class='note'>
a2ensite www.example.com
</p>
<p>Great! Now you only need to go to /var/www to create a home directory for example.com, remember in the steps above we created a configuration file that has a virtual host for example.com? in that file we also added something like <strong>DocumentRoot</strong> ?<br />
thats where the domain home directory will be so lets create it.</p>
<p class='note'>
cd /var/www<br />
sudo mkdir example.com
</p>
<p>Lets reload apache</p>
<p class='note'>
service apache2 reload
</p>
<p>Now remain to add an A record to example.com wherever you have it registered, <a href="http://help.godaddy.com/article/680#arecs" title="Opens in new window" target="_blank">here</a> is a guide on how to do that on Godaddy </p>
<p>That is it! just upload the website files to /var/www/example.com and you will be able to access them by visiting wwww.example.com</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialsbay.com/hosting-multiple-websites-ubuntu-lamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4 FREE CodeIgniter based CMS</title>
		<link>http://tutorialsbay.com/list-of-free-codeigniter-cms/</link>
		<comments>http://tutorialsbay.com/list-of-free-codeigniter-cms/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 23:01:57 +0000</pubDate>
		<dc:creator>Mody</dc:creator>
				<category><![CDATA[Resources]]></category>

		<guid isPermaLink="false">http://tutorialsbay.com/?p=620</guid>
		<description><![CDATA[This is a list containing FREE CMS ( Content management systems ) which were built on the popular PHP Framework Codeigniter , We have tried to find every free CMS out there, if you think we missed some, Please share them with your comment! FuelCMS Features: Inline Editing Simple Interface Import Existing Static Pages Manage [...]]]></description>
			<content:encoded><![CDATA[<p>This is a list containing FREE CMS ( Content management systems ) which were built on the popular PHP Framework Codeigniter , We have tried to find every free CMS out there, if you think we missed some, Please share them with your comment!</p>
<h3><a href="http://www.getfuelcms.com/" target="_blank">FuelCMS</a></h3>
<p><strong>Features:</strong></p>
<ul>
<li>Inline Editing</li>
<li>Simple Interface</li>
<li>Import Existing Static Pages</li>
<li>Manage Users &amp; Permissions</li>
<li>3rd Party Integration</li>
<li>Cronjob Manager</li>
<li>Roll a Blog</li>
</ul>
<p><strong>CMS Installer:</strong> <span style="color: #ff0000;"><strong>NO</strong></span></p>
<p><strong>Templates: <span style="color: #99cc00;">Yes</span></strong></p>
<p>&nbsp;</p>
<h3><a href="http://codefight.org" target="_blank">CodeFight</a></h3>
<p><strong>Features:</strong></p>
<ul>
<li>Pages manager</li>
<li>Multi Website</li>
<li>Users Groups</li>
<li>Menu manager</li>
</ul>
<p><strong>CMS Installer:</strong> <span style="color: #ff0000;"><strong>NO</strong></span></p>
<p><strong>Templates</strong><strong>: <span style="color: #ff0000;">NO</span></strong></p>
<p>&nbsp;</p>
<h3><a href="http://amarokcms.org/" target="_blank">AmarokCMS</a></h3>
<p><strong>Features:</strong></p>
<ul>
<li>WYSIWYG html editor</li>
<li>Image/File upload</li>
<li>page SEO options</li>
<li>Page Sidebar</li>
<li>Custom slugs</li>
<li>Multi-Level menu</li>
<li>Page menu orders</li>
</ul>
<p><strong>CMS Installer:</strong> <span style="color: #99cc00;"><strong>Yes</strong></span></p>
<h3><strong>Templates: <span style="color: #99cc00;">Yes</span></strong></h3>
<h3><a href="http://ionizecms.com/" target="_blank"><br />
</a></h3>
<h3><a href="http://ionizecms.com/" target="_blank"> Ionize CMS</a></h3>
<p><strong>Features:</strong></p>
<ul>
<li>Easy edition</li>
<li>Multilingual</li>
<li>Userfriendly</li>
<li>Template System</li>
<li>Extend Content</li>
<li>Articles</li>
<li>Page menus</li>
</ul>
<p><strong>CMS Installer:</strong> <strong></strong></p>
<h3><strong>Templatable: <span style="color: #99cc00;">Yes</span></strong></h3>
]]></content:encoded>
			<wfw:commentRss>http://tutorialsbay.com/list-of-free-codeigniter-cms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>best CSS Frameworks for building Forms, Buttons &amp; messages</title>
		<link>http://tutorialsbay.com/best-css-forms-buttons-messages-frameworks/</link>
		<comments>http://tutorialsbay.com/best-css-forms-buttons-messages-frameworks/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 00:42:59 +0000</pubDate>
		<dc:creator>Mody</dc:creator>
				<category><![CDATA[Resources]]></category>

		<guid isPermaLink="false">http://tutorialsbay.com/?p=611</guid>
		<description><![CDATA[Twitter Bootstrap is a toolkit from Twitter It includes base CSS and HTML for typography, forms, buttons, tables, grids, multi-level navigation, success messages, warnings messages and error messages and much more Blueprint is a CSS framework that gives you a solid foundation to build great looking websites! Blueprint offers the following A CSS reset that [...]]]></description>
			<content:encoded><![CDATA[<p>Twitter Bootstrap is a toolkit from Twitter It includes base CSS and HTML for typography, forms, buttons, tables, grids, multi-level navigation, success messages, warnings messages and error messages and much more<br />
<a title="Opens in new window" href="http://twitter.github.com/bootstrap/" target="_blank"><img class="alignnone size-full wp-image-612" title="twitter-bosstrap-css-framework" src="http://tutorialsbay.com/wp-content/uploads/2012/01/twitter-bosstrap-css-framework.png" alt="twitter-bosstrap-css-framework" width="723" height="539" /></a></p>
<p>Blueprint is a CSS framework that gives you a solid foundation to build great looking websites! Blueprint offers the following</p>
<ul>
<li>A CSS reset that eliminates the discrepancies across browsers.</li>
<li>A solid grid that can support the most complex of layouts.</li>
<li>Typography based on expert principles that predate the web.</li>
<li>Form styles for great looking user interfaces.</li>
<li>Print styles for making any webpage ready for paper.</li>
<li>Plugins for buttons, tabs and sprites.</li>
</ul>
<p><a href="http://blueprintcss.org"><img class="alignnone size-full wp-image-613" title="opens in new window" src="http://tutorialsbay.com/wp-content/uploads/2012/01/blueorint-framework-warning-messages.png" alt="blueorint-framework-warning-messages" width="491" height="226" /></a></p>
<p>formee is a veyr cool css framework that allows you to create very sexy web forms and warning/success messages</p>
<p><a title="Opens in new window" href="http://www.formee.org/" target="_blank"><img class="alignnone size-full wp-image-618" title="formee-css-forms-framework" src="http://tutorialsbay.com/wp-content/uploads/2012/01/formee-css-forms-framework.png" alt="formee-css-forms-framework" width="532" height="484" /></a></p>
<p>52Framework is a CS3 framework that features box shadows, border radius, text shadow and box/text/rotating and more</p>
<p><a title="Opens in new window" href="http://52framework.com" target="_blank"><img class="alignnone size-full wp-image-615" title="52-cs2-framework" src="http://tutorialsbay.com/wp-content/uploads/2012/01/52-cs2-framework.png" alt="52framework preview" width="496" height="248" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialsbay.com/best-css-forms-buttons-messages-frameworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ImportError: No module named tkinter [solved]</title>
		<link>http://tutorialsbay.com/importerror-no-module-named-tkinter-solved/</link>
		<comments>http://tutorialsbay.com/importerror-no-module-named-tkinter-solved/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 23:33:13 +0000</pubDate>
		<dc:creator>Mody</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://tutorialsbay.com/?p=608</guid>
		<description><![CDATA[Today I have been looking at http://en.wikibooks.org/wiki/Python_Programming/User_Interaction a quick introduction to Python Graphical User Interface (GUI) development and following their simple tutorial to create a small program that takes user input I get the following ImportError: No module named tkinter Python has many different GUI toolkits, of which the most standard is Tkinter which comes [...]]]></description>
			<content:encoded><![CDATA[<p>Today I have been looking at http://en.wikibooks.org/wiki/Python_Programming/User_Interaction a quick introduction to Python Graphical User Interface (GUI) development and following their simple tutorial to create a small program that takes user input I get the following</p>
<p class="note">ImportError: No module named tkinter</p>
<p>Python has many different GUI toolkits, of which the most standard is Tkinter which comes with Python but I was unable to get tkinter to work so I Googled a bit and found some articles claiming that running the following commands can fix the problem</p>
<p class="note">sudo apt-get install tk-dev</p>
<p>or</p>
<p class="note">sudo apt-get install python-tk</p>
<p>But it really did not solve the problem and I kept getting</p>
<p class="note">ImportError: No module named tkinter</p>
<p>Until I found out that this is wrong</p>
<p class="note">import tkinter or tkinter.Tk() etc&#8230;</p>
<p>but you must always <strong>use</strong> capital &#8220;T&#8221; in tkinter <img src='http://tutorialsbay.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Like this:</p>
<p class="note">import Tkinter</p>
<p class="note">app_win = Tkinter.Tk()</p>
<p>that solved my problem and I hope it solves yours!<br />
Oh my python version is 2.7.2+</p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialsbay.com/importerror-no-module-named-tkinter-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating Thunderbird from Windows to Ubuntu</title>
		<link>http://tutorialsbay.com/migrating-thunderbird-from-windows-to-ubuntu/</link>
		<comments>http://tutorialsbay.com/migrating-thunderbird-from-windows-to-ubuntu/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 00:19:25 +0000</pubDate>
		<dc:creator>Mody</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://tutorialsbay.com/?p=575</guid>
		<description><![CDATA[So do you want to have all your email profiles and received emails/files on your new Ubuntu installation? There is a very easy way to migrate Thunderbird from windows to Ubuntu, in my case I migrated from Windows 7 to Ubuntu 10.11 but I think it should be the same way for Windows vista or [...]]]></description>
			<content:encoded><![CDATA[<p>So do you want to have all your email profiles and received emails/files on your new Ubuntu installation? There is a very easy way to migrate Thunderbird from windows to Ubuntu, in my case I migrated from Windows 7 to Ubuntu 10.11 but I think it should be the same way for Windows vista or XP. also its good to note that this article can be applied to Firefox Windows to Ubuntu profile migration as well.<strong></strong></p>
<p><strong>if you have Ubuntu and Windows side by side</strong></p>
<p>Boot with ubuntu then go to your Home folder and on the left you will see under &#8220;Devices&#8221; the hardisk your windows installation is on, Click on that and go to <em>Documents &amp; Settings &gt; Your_user_name &gt; Application &amp; Data &gt; Thunderbird &gt; Profiles</em></p>
<p>there should be a folder named something like  <strong>xxxx.default </strong>copy that folder and go back to your Ubuntu home directory press <strong>Ctrl+h</strong> to show hidden folders and then find a folder called <em><strong>.thunderbird</strong></em> open it and paste there the folder you copied in the steps above</p>
<p>&nbsp;</p>
<p>Wait&#8230;. Do not leave that folder yet.</p>
<p>open up the file called <strong><em>profiles.ini</em></strong> you should see something like this:</p>
<p><strong>[General]</strong><br />
<strong>StartWithLastProfile=1</strong></p>
<p><strong>[Profile0]</strong><br />
<strong>Name=default</strong><br />
<strong>IsRelative=1</strong><br />
<strong>Path=xxxxx.default</strong></p>
<p>change the xxxxx.default to the copied folder&#8217;s name and start Thunderbird and you should see all of yours emails there.</p>
<p><strong>if you don&#8217;t have Ubuntu and Windows side by side then you will need to put that folder on a USB stick and use it in Ubuntu<br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://tutorialsbay.com/migrating-thunderbird-from-windows-to-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

