<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7339286656747792301</atom:id><lastBuildDate>Thu, 24 Oct 2024 06:15:17 +0000</lastBuildDate><category>Tutorials</category><category>jquery</category><category>Javascript</category><category>css</category><category>php</category><category>Animation</category><category>Tip</category><category>Web-service</category><category>html5</category><category>api</category><category>hacks</category><category>resource</category><category>Application</category><category>golang</category><category>nodejs</category><category>twitter</category><category>fun</category><category>json</category><category>links</category><category>Gtalk</category><category>Internet</category><category>google+</category><category>mobile-dev</category><category>Canvas</category><category>angularJs</category><category>idea</category><category>joke</category><category>research</category><category>xml</category><category>.htaccess</category><category>amazon</category><category>facebook_graph_api</category><category>mongodb</category><category>Flash</category><category>Games</category><category>Minimalism</category><category>MySql</category><category>Sms</category><category>Sound</category><category>Yql</category><category>linux</category><category>nokia</category><category>plugin</category><category>web-scrapping</category><category>wrt</category><category>Eco</category><category>OSx</category><category>SSEs</category><category>android</category><category>aws</category><category>chrome</category><category>codeplayers</category><category>dellmini9</category><category>dropbox</category><category>github</category><category>guest_post</category><category>hosting</category><category>ifttt</category><category>mac</category><category>mp3</category><category>oauth</category><category>stats</category><category>tool</category><category>tor</category><category>ubuntu</category><category>video</category><title>Motyar&#39;s Blog</title><description></description><link>http://motyar.blogspot.com/</link><managingEditor>noreply@blogger.com (bbbbbb)</managingEditor><generator>Blogger</generator><openSearch:totalResults>170</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-533506487949700550</guid><pubDate>Fri, 30 Nov 2018 08:44:00 +0000</pubDate><atom:updated>2018-11-30T14:42:19.733+05:30</atom:updated><title>Google Map Scraper using Google Places API PHP</title><description>&lt;h3&gt;
Step 1: Get an API key&lt;/h3&gt;
You can &lt;a href=&quot;https://developers.google.com/places/web-service/get-api-key&quot; target=&quot;_blank&quot;&gt;get a key from Google Cloud Platform Console&lt;/a&gt;, You ll have to select a product, and set up a billing account if not already done.

&lt;br /&gt;
&lt;h3&gt;
Step 2: Write the code&lt;/h3&gt;
You can use *Nearby search*, here is a quick example of the call:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&amp;amp;radius=1500&amp;amp;type=restaurant&amp;amp;keyword=cruise&amp;amp;key=YOUR_API_KEY&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
It ll return the data in JSON, you can convert that using json_decode.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Here is a quick example code:

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
$jsonData = file_get_contents($apiUrl);                                
$data = json_decode($jsonData,true);  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
In this data, you ll get PlaceId, You can further get full details about that place using Place details API:

Here is an example:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&amp;amp;fields=name,rating,formatted_phone_number&amp;amp;key=YOUR_API_KEY&lt;code&gt;&lt;/code&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;http://motyar.info/geodata&quot; target=&quot;_blank&quot;&gt;Demo&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNopmj9GSVAzHRGpR1oXgSEvQbcC6ZFdNczyo9hFjAGl18YENsrtt_da717Pi8trmhflSs52N_fcWT5Psa-fLIwFtFASYMd6kPFR28noGkQvNgqSKkWak1FTkJoyuBrcRgvuKmsZKzGGOM/s1600/Screen+Shot+2018-11-30+at+2.02.18+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;152&quot; data-original-width=&quot;1100&quot; height=&quot;44&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNopmj9GSVAzHRGpR1oXgSEvQbcC6ZFdNczyo9hFjAGl18YENsrtt_da717Pi8trmhflSs52N_fcWT5Psa-fLIwFtFASYMd6kPFR28noGkQvNgqSKkWak1FTkJoyuBrcRgvuKmsZKzGGOM/s320/Screen+Shot+2018-11-30+at+2.02.18+PM.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&amp;nbsp;&lt;/h2&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2018/11/google-map-scraper-using-google-places.html</link><author>noreply@blogger.com (bbbbbb)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNopmj9GSVAzHRGpR1oXgSEvQbcC6ZFdNczyo9hFjAGl18YENsrtt_da717Pi8trmhflSs52N_fcWT5Psa-fLIwFtFASYMd6kPFR28noGkQvNgqSKkWak1FTkJoyuBrcRgvuKmsZKzGGOM/s72-c/Screen+Shot+2018-11-30+at+2.02.18+PM.png" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-8838961252953538322</guid><pubDate>Thu, 03 Aug 2017 01:04:00 +0000</pubDate><atom:updated>2017-08-03T06:41:35.591+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Javascript</category><category domain="http://www.blogger.com/atom/ns#">jquery</category><title>Refresh element without page refresh. </title><description>Here is the code ( using jQuery) to refresh a div contents without page refresh. 

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
setInterval(function(){ 
&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&#39;#divId&#39;).load(&#39;?_=&#39; + (new Date()).getTime()+&#39; #divId&#39;);
},5000);
&lt;/code&gt;&lt;/pre&gt;
You can add this simple animation to make it more effective

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
setInterval(function(){                         
        $(&#39;#divId&#39;).fadeOut(&#39;fast&#39;, function() {       
            $(&#39;#divId&#39;).load(&#39;?_=&#39; + (new Date()).getTime()+&#39; #divId&#39;,function() {
                                $(this).fadeIn(&#39;fast&#39;);                                                                                        
            });                                     
        });                                         
    },5000);  
&lt;/code&gt;
&lt;/pre&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2017/08/refresh-element-without-page-refresh.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-6510473003268187360</guid><pubDate>Mon, 24 Jul 2017 05:58:00 +0000</pubDate><atom:updated>2017-07-24T11:29:56.241+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">css</category><category domain="http://www.blogger.com/atom/ns#">idea</category><category domain="http://www.blogger.com/atom/ns#">Javascript</category><category domain="http://www.blogger.com/atom/ns#">links</category><category domain="http://www.blogger.com/atom/ns#">php</category><title>Auto versioning JavaScript and CSS files with PHP</title><description>While development stage, sometimes files get updated but browser doesn&#39;t reload the latest version of CSS and JS file and keep showing the cached version.&lt;br /&gt;
&lt;br /&gt;
We can force to reload CSS and JS files by using current timestamp with the filepath, but its not a good idea to reaload files when nothing got changed.&lt;br /&gt;
&lt;br /&gt;
Sharing a very simple hack that can be used to only reload the latest version when the files get changed. 

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
path_to_js_or_css_file?&amp;lt;?=filemtime(&#39;path_to_js_or_css_file&#39;)?&amp;gt;

&lt;/code&gt;
&lt;/pre&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2017/07/auto-versioning-javascript-and-css.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-692113005880509305</guid><pubDate>Thu, 30 Mar 2017 16:11:00 +0000</pubDate><atom:updated>2017-03-30T21:54:16.327+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">mac</category><category domain="http://www.blogger.com/atom/ns#">OSx</category><category domain="http://www.blogger.com/atom/ns#">tor</category><title>Using TOR is easy</title><description>Note: This tutorial is for macOS only.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUpllg_8RJ28TsYqSmxdtDO9JrE16R0oHFLCh4oi3mMwsFQxGdps68V4v5mz5ixUWOHVAiBx-gtwuT2WBH6g9ZU5CzvKq2ryv7ckVei46aACz6LMzYoxAfB3nbafsGuPzqpSlcfsQ1-O93/s1600/RpgvvtYAQeqAIs1knERU_vegetables.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;265&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUpllg_8RJ28TsYqSmxdtDO9JrE16R0oHFLCh4oi3mMwsFQxGdps68V4v5mz5ixUWOHVAiBx-gtwuT2WBH6g9ZU5CzvKq2ryv7ckVei46aACz6LMzYoxAfB3nbafsGuPzqpSlcfsQ1-O93/s400/RpgvvtYAQeqAIs1knERU_vegetables.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;Step 1. Install Homebrew&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;/usr/bin/ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Step 2. Install TOR&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;brew install tor
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Step 3. Use this shell script. Save this to tor.sh &lt;a href=&quot;https://kremalicious.com/simple-tor-setup-on-mac-os-x/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;source&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
#!/usr/bin/env bash

# &#39;Wi-Fi&#39; or &#39;Ethernet&#39; or &#39;Display Ethernet&#39;
INTERFACE=Wi-Fi

# Ask for the administrator password upfront
sudo -v

# Keep-alive: update existing `sudo` time stamp until finished
while true; do sudo -n true; sleep 60; kill -0 &quot;$$&quot; || exit; done 2&amp;gt;/dev/null &amp;amp;

# trap ctrl-c and call disable_proxy()
function disable_proxy() {
    sudo networksetup -setsocksfirewallproxystate $INTERFACE off
    echo &quot;$(tput setaf 64)&quot; #green
    echo &quot;SOCKS proxy disabled.&quot;
    echo &quot;$(tput sgr0)&quot; # color reset
}
trap disable_proxy INT

# Let&#39;s roll
sudo networksetup -setsocksfirewallproxy $INTERFACE 127.0.0.1 9050 off
sudo networksetup -setsocksfirewallproxystate $INTERFACE on

echo &quot;$(tput setaf 64)&quot; # green
echo &quot;SOCKS proxy 127.0.0.1:9050 enabled.&quot;
echo &quot;$(tput setaf 136)&quot; # orange
echo &quot;Starting Tor...&quot;
echo &quot;$(tput sgr0)&quot; # color reset

tor
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Step 4. Make it &quot;executable&quot;&lt;/b&gt;

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;chmod +x tor.sh&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Step 5. Run it

&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;./tor.sh&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Step 6. Test it&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;https://check.torproject.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://check.torproject.org/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 7. Tell me ( Optional )&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;I am on twitter &lt;a href=&quot;http://twitter.com/motyar&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@motyar&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2017/03/using-tor-is-easy.html</link><author>noreply@blogger.com (bbbbbb)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUpllg_8RJ28TsYqSmxdtDO9JrE16R0oHFLCh4oi3mMwsFQxGdps68V4v5mz5ixUWOHVAiBx-gtwuT2WBH6g9ZU5CzvKq2ryv7ckVei46aACz6LMzYoxAfB3nbafsGuPzqpSlcfsQ1-O93/s72-c/RpgvvtYAQeqAIs1knERU_vegetables.jpg" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-5485503427166913519</guid><pubDate>Sat, 25 Feb 2017 08:42:00 +0000</pubDate><atom:updated>2017-02-25T14:29:57.080+05:30</atom:updated><title>Long tail keyword generator</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
Search en·gine op·ti·mi·za·tion is all about keywords, Keyword Research is most important part of an SEO Campaign.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Longtail keywords are more important than keywords&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Here are few long tails for keyword &quot;HTML5 Video&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0_O3Loo_AlnlXbrgMbyl-Thkpb2-1-LMhAxusKSCmJi8ghvmyVZS_58VCzlcrtLAJHI5QIU1VXD098eAQs1sAbuY1lR30-dr5kvQAGO5Muap6rq7boV4KYqO90Vit1Da1d2TfGjXhzV2S/s1600/Screen+Shot+2017-02-25+at+2.01.06+pm.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0_O3Loo_AlnlXbrgMbyl-Thkpb2-1-LMhAxusKSCmJi8ghvmyVZS_58VCzlcrtLAJHI5QIU1VXD098eAQs1sAbuY1lR30-dr5kvQAGO5Muap6rq7boV4KYqO90Vit1Da1d2TfGjXhzV2S/s1600/Screen+Shot+2017-02-25+at+2.01.06+pm.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
I wrote a PHP script that can generate all the longtail keywords just using the starting term.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://www.paypal.me/motyar/39&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Download &quot;Long tail keyword generator&quot; script for $39 now&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Will send you code via email after the payment. If you have any questions, I am twitter &lt;a href=&quot;http://twitter.com/motyar&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;@motyar&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2017/02/long-tail-keyword-generator.html</link><author>noreply@blogger.com (bbbbbb)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0_O3Loo_AlnlXbrgMbyl-Thkpb2-1-LMhAxusKSCmJi8ghvmyVZS_58VCzlcrtLAJHI5QIU1VXD098eAQs1sAbuY1lR30-dr5kvQAGO5Muap6rq7boV4KYqO90Vit1Da1d2TfGjXhzV2S/s72-c/Screen+Shot+2017-02-25+at+2.01.06+pm.png" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-1363763018628443853</guid><pubDate>Fri, 24 Feb 2017 10:46:00 +0000</pubDate><atom:updated>2017-02-24T16:20:07.291+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">golang</category><category domain="http://www.blogger.com/atom/ns#">Tutorials</category><title>Golang Web Development with Examples</title><description>&lt;b&gt;How fast Go ( Golang ) is growing?&lt;/b&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-zK8E2aMfzUKvcn-aEkgpf96OhDiqc0fPMN2aDTKQJTDEtCe9RwqmLsTMM7AGpwZE0SiWHUmbxtlDOaosEzTLbCIWrQu8fWCqoiaUaBbWKhbX8ImDE8QVtyx9v2JBHbzur42KFF6pEuG9/s1600/Screen+Shot+2017-02-24+at+3.56.39+pm.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;224&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-zK8E2aMfzUKvcn-aEkgpf96OhDiqc0fPMN2aDTKQJTDEtCe9RwqmLsTMM7AGpwZE0SiWHUmbxtlDOaosEzTLbCIWrQu8fWCqoiaUaBbWKhbX8ImDE8QVtyx9v2JBHbzur42KFF6pEuG9/s640/Screen+Shot+2017-02-24+at+3.56.39+pm.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;http://www.tiobe.com/tiobe-index/&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Because its open source and designed for building simple, fast, and reliable softwares.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Who is using Golang?&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;Check the list here &lt;a href=&quot;https://github.com/golang/go/wiki/GoUsers&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://github.com/golang/go/wiki/GoUsers&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://motyar.blogspot.in/2014/12/single-page-web-application-using.html&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Writing Web Applications using Go&lt;/b&gt;&lt;/a&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
Go is a good language for building
websites/web servers,&amp;nbsp;&lt;b&gt; &lt;/b&gt;Let&#39;s understand with few examples:-&lt;br /&gt;
&lt;br /&gt;
1. &lt;b&gt;&lt;a href=&quot;http://motyar.blogspot.in/2014/09/creating-static-webserver-in-go-golang.html&quot; target=&quot;_blank&quot;&gt;Static Web Server in Go&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
2. &lt;b&gt;Simple Hello Web Example&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;// hello-web.go
package main

import (
 &quot;fmt&quot;
 &quot;net/http&quot;
)

func main() {
 http.HandleFunc(&quot;/&quot;, func(w http.ResponseWriter, r *http.Request) {
  fmt.Fprintln(w, &quot;hello web&quot;)
 })

 http.ListenAndServe(&quot;:8080&quot;, nil)
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
3. &lt;b&gt;Register a Route / Path&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
// routes.go
package main

import (
 &quot;fmt&quot;
 &quot;net/http&quot;
)

func main() {
 
 http.HandleFunc(&quot;/hi/&quot;, func(w http.ResponseWriter, r *http.Request) {

  fmt.Fprintln(w, &quot;Hi web&quot;)
 })

 http.ListenAndServe(&quot;:8080&quot;, nil)
}&lt;/code&gt;&lt;/pre&gt;

Check more examples on &lt;a href=&quot;https://gowebexamples.github.io/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Go Web Examples&lt;/a&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2017/02/golang-web-development-with-examples.html</link><author>noreply@blogger.com (bbbbbb)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-zK8E2aMfzUKvcn-aEkgpf96OhDiqc0fPMN2aDTKQJTDEtCe9RwqmLsTMM7AGpwZE0SiWHUmbxtlDOaosEzTLbCIWrQu8fWCqoiaUaBbWKhbX8ImDE8QVtyx9v2JBHbzur42KFF6pEuG9/s72-c/Screen+Shot+2017-02-24+at+3.56.39+pm.png" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-2226698343633007191</guid><pubDate>Fri, 06 Jan 2017 04:53:00 +0000</pubDate><atom:updated>2017-01-06T10:23:15.127+05:30</atom:updated><title>Quick quotes generation Tool</title><description>Ever found a really interesting inspirations quotes and wanted to share?&lt;br /&gt;
&lt;br /&gt;
No? really?&lt;br /&gt;
&lt;br /&gt;
I had this feeling many times a day, so I suggested myself to “Scratch Your Own Itch” !&lt;br /&gt;
&lt;br /&gt;
Here is the tool&lt;br /&gt;
&lt;br /&gt;
Demo : - &lt;a href=&quot;http://motyar.info/quotes/&quot; target=&quot;_blank&quot;&gt;http://motyar.info/quotes/&lt;/a&gt;&lt;br /&gt;
Code :- &lt;a href=&quot;https://github.com/motyar/quotes&quot; target=&quot;_blank&quot;&gt;https://github.com/motyar/quotes&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How to use this?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Its easy, just put your quotes in this format&lt;br /&gt;
&lt;br /&gt;
&quot;Make your own Quotes ~ Motyar&quot;&lt;br /&gt;
&lt;br /&gt;
And hit ENTER&lt;br /&gt;
&lt;br /&gt;
You ll be redirected to something like this &lt;a href=&quot;http://motyar.info/quotes/Make%20your%20own%20Quotes%20~%20Motyar&quot; target=&quot;_blank&quot;&gt;http://motyar.info/quotes/Make%20your%20own%20Quotes%20~%20Motyar&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can edit it on this page if you make an typo etc, ( yes I used &quot;contenteditatble&quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Final result?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWZE-aDECzYL2BLvjSGAt1a5qLvrKhE-99R62SXnecjXUj7jVx-hrlNrjT7q_iafM3yJPAeP6t1Zuby1eaLDeY081_7XkGw4sfXQY8LyaT_ZSELJvr1k5VZDgwTLMylfjcIP4penVxa6RS/s1600/Screen+Shot+2017-01-06+at+10.20.27+am.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;156&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWZE-aDECzYL2BLvjSGAt1a5qLvrKhE-99R62SXnecjXUj7jVx-hrlNrjT7q_iafM3yJPAeP6t1Zuby1eaLDeY081_7XkGw4sfXQY8LyaT_ZSELJvr1k5VZDgwTLMylfjcIP4penVxa6RS/s320/Screen+Shot+2017-01-06+at+10.20.27+am.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Whats next?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
What if you can import quotes as png? or jpg? or can edit the font? or colors too? and backgroud?&lt;br /&gt;
&lt;br /&gt;Let me know what you think, I am on twitter as &lt;a href=&quot;http://twitter.com/motyar&quot; target=&quot;_blank&quot;&gt;@motyar&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2017/01/quick-quotes-generation-tool.html</link><author>noreply@blogger.com (bbbbbb)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWZE-aDECzYL2BLvjSGAt1a5qLvrKhE-99R62SXnecjXUj7jVx-hrlNrjT7q_iafM3yJPAeP6t1Zuby1eaLDeY081_7XkGw4sfXQY8LyaT_ZSELJvr1k5VZDgwTLMylfjcIP4penVxa6RS/s72-c/Screen+Shot+2017-01-06+at+10.20.27+am.png" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-416803157867948290</guid><pubDate>Sun, 28 Aug 2016 14:24:00 +0000</pubDate><atom:updated>2016-08-28T19:54:41.759+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">facebook_graph_api</category><category domain="http://www.blogger.com/atom/ns#">oauth</category><category domain="http://www.blogger.com/atom/ns#">php</category><category domain="http://www.blogger.com/atom/ns#">Tutorials</category><title>Login with Facebook ( In 20 lines of PHP code ) </title><description>Step 1: &lt;a href=&quot;https://developers.facebook.com/apps&quot; target=&quot;_blank&quot;&gt;Click here&lt;/a&gt; to create a Facebook application.&lt;br /&gt;
&lt;br /&gt;
Step 2: Configure App Id and App Secret and redirect url etc.&lt;br /&gt;
&lt;br /&gt;
Here is the code you need to use.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/motyar/25f07d7727541c7d7280a8a919c3932b.js&quot;&gt;&lt;/script&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2016/08/login-with-facebook-in-20-lines-of-php.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-3441613379970153653</guid><pubDate>Thu, 31 Mar 2016 05:54:00 +0000</pubDate><atom:updated>2016-03-31T11:24:33.558+05:30</atom:updated><title>IFTTT Hack: Save Pinterest pin Image to Dropbox </title><description>IFTTT is very helpful for automation. But few things are not possible because channels have few limitations, like Pinterest channel doesn&#39;t provide the pin Image Url.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOyVi4xQQmyDA863tXZ1HOEEaJGtL3Fd-_TvuJcs-IcnvlRDOtvjkG-foT8mvGtjOb6x8HNTS_MK1O50pjMFNveE93Z_MC8M-X1s57_ORe953Qef8F0-YkWCSl-bJMwfAmhCcAXb0qPfV8/s1600/Screen+Shot+2016-03-31+at+11.11.33+am.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;324&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOyVi4xQQmyDA863tXZ1HOEEaJGtL3Fd-_TvuJcs-IcnvlRDOtvjkG-foT8mvGtjOb6x8HNTS_MK1O50pjMFNveE93Z_MC8M-X1s57_ORe953Qef8F0-YkWCSl-bJMwfAmhCcAXb0qPfV8/s640/Screen+Shot+2016-03-31+at+11.11.33+am.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span id=&quot;goog_1542926251&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1542926252&quot;&gt;&lt;/span&gt;&lt;br /&gt;
Here we need to save the pin image when we like a pin.&lt;br /&gt;
&lt;br /&gt;
In this post we are going to use Pinterest API to get ImageUrl using PinId.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Here is the hack&lt;/b&gt;&lt;br /&gt;
Go to &lt;a href=&quot;https://developers.pinterest.com/tools/api-explorer/&quot; target=&quot;_blank&quot;&gt;Pinterest API explorer&lt;/a&gt; and get &lt;i&gt;API access Token &lt;/i&gt;by clicking &quot;Get Token&quot;. A popup window will open and you will be asked to &quot;Allow&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Here is the script&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
$data = json_decode(file_get_contents(&quot;https://api.pinterest.com/v1/pins/&quot;.trim($_GET[&#39;pinId&#39;]).&quot;/?access_token=TOKEN&amp;amp;fields=image&quot;),true);
                                                                      
$imgUrl = $data[&#39;data&#39;][&#39;image&#39;][&#39;original&#39;][&#39;url&#39;];
header(&quot;Location:&quot;.$imgUrl); 

&lt;/code&gt;&lt;/pre&gt;
Host this PHP script somewhere, lets say at http://example.com/pinterest.php&lt;br /&gt;
&lt;br /&gt;
Create a new Recipe and put the &quot;File URL&quot; = http://example.com/pinterest.php?pinId={{PinID}}&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgScTgxiIDmnpHTC2owgK-wF3Dx0xmvZazDEx4BM7HSe0thg4LfEhaDtI6qY762H8QChRXx7a4gC0uvvHtuvjA3W2t4rHs-LPVHonjJL1gHJFNnngU3axbxIOAbO2-JH21fC_-NeInaSI1_/s1600/Screen+Shot+2016-03-31+at+11.20.56+am.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;372&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgScTgxiIDmnpHTC2owgK-wF3Dx0xmvZazDEx4BM7HSe0thg4LfEhaDtI6qY762H8QChRXx7a4gC0uvvHtuvjA3W2t4rHs-LPVHonjJL1gHJFNnngU3axbxIOAbO2-JH21fC_-NeInaSI1_/s640/Screen+Shot+2016-03-31+at+11.20.56+am.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Thats all !!!
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2016/03/ifttt-hack-save-pinterest-pin-image-to.html</link><author>noreply@blogger.com (bbbbbb)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOyVi4xQQmyDA863tXZ1HOEEaJGtL3Fd-_TvuJcs-IcnvlRDOtvjkG-foT8mvGtjOb6x8HNTS_MK1O50pjMFNveE93Z_MC8M-X1s57_ORe953Qef8F0-YkWCSl-bJMwfAmhCcAXb0qPfV8/s72-c/Screen+Shot+2016-03-31+at+11.11.33+am.png" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-903931200047344275</guid><pubDate>Thu, 10 Mar 2016 15:45:00 +0000</pubDate><atom:updated>2017-01-10T13:16:05.443+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">golang</category><title>Foreach in Golang ( golang foreach )</title><description>Sorry there is no &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;foreach&lt;/span&gt; in Golang!&lt;br /&gt;
&lt;br /&gt;
But using a &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;for&lt;/span&gt; statement with &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;range&lt;/span&gt; clause we can iterate through all entries of an array, slice, string or map, or values received on a channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
for index,element := range someSlice {
  // index is the index where we are
  // element is the element from someSlice for where we are
}
&lt;/code&gt;&lt;/pre&gt;
You can simply ignore the &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;index&lt;/span&gt; using &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;_&lt;/span&gt; like:-
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
for _,element := range someSlice {
  // element is the element from someSlice for where we are
}
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2016/03/foreach-in-go.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-7876081687883213208</guid><pubDate>Fri, 04 Mar 2016 10:08:00 +0000</pubDate><atom:updated>2016-03-04T15:38:56.470+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">mongodb</category><category domain="http://www.blogger.com/atom/ns#">Tip</category><category domain="http://www.blogger.com/atom/ns#">Tutorials</category><title>Upgrade MongoDB to Latest Version on Linux</title><description>Here is quick process :-&lt;br /&gt;
&lt;br /&gt;
Check your current version, using&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;mongo --version&lt;/code&gt;&lt;/pre&gt;
&lt;a href=&quot;https://www.mongodb.org/downloads?jmp=docs#production&quot;&gt;Download latest version from website&lt;/a&gt;:-&lt;br /&gt;
&amp;nbsp;Copy the URL to download, in my case it was &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;https://fastdl.mongodb.org/linux/mongodb-linux-i686-3.2.3.tgz&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt;wget https://fastdl.mongodb.org/linux/mongodb-linux-i686-3.2.3.tgz&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt;tar -xvzf mongodb-linux-i686-3.2.3.tgz&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt;cp mongodb-linux-i686-3.2.3/bin/* /usr/bin/&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Check if it worked:-
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt;mongo --version&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2016/03/upgrade-mongodb-to-latest-version-on.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-1875605305664603497</guid><pubDate>Fri, 04 Mar 2016 04:23:00 +0000</pubDate><atom:updated>2016-03-04T09:57:06.397+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">api</category><category domain="http://www.blogger.com/atom/ns#">golang</category><title>Simple REST API client in Go ( Google Go )</title><description>After writting many Golang REST APIs, I realised need of a REST API client to test these APIs. Becuase CURL commands are complex.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the code&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/motyar/d3ab27edad5069dc948d.js&quot;&gt;&lt;/script&gt;


&lt;b&gt;Here is an example use case for &lt;a href=&quot;https://github.com/motyar/go-rest-mongo&quot;&gt;Go JSON REST API with mongoDb database&lt;/a&gt;&lt;/b&gt;

&lt;br /&gt;
&lt;h3&gt;
List all the Pandas&lt;/h3&gt;
&lt;code&gt;
go run client.go -url=https://rest-golangapi.rhcloud.com/pandas -method=get
&lt;/code&gt;&lt;br /&gt;
&lt;h3&gt;
Create new Panda&lt;/h3&gt;
&lt;code&gt;
go run client.go -url=https://rest-golangapi.rhcloud.com/pandas/ -method=post -data=&#39;{&quot;Name&quot;:&quot;Name of Panda&quot;}&#39;
&lt;/code&gt;&lt;br /&gt;
&lt;h3&gt;
Delete existing Panda&lt;/h3&gt;
&lt;code&gt;
go run client.go -url=https://rest-golangapi.rhcloud.com/pandas/{Id} -method=delete
&lt;/code&gt;&lt;br /&gt;
&lt;h3&gt;
Update existing Panda&lt;/h3&gt;
&lt;code&gt;go run client.go -url=https://rest-golangapi.rhcloud.com/pandas/{Id} -method=put -data=&#39;{&quot;Name&quot;:&quot;New name&quot;}&#39;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2016/03/simple-rest-api-client-in-go-google-go.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-8708916082321879733</guid><pubDate>Tue, 17 Nov 2015 07:49:00 +0000</pubDate><atom:updated>2015-11-17T13:20:48.564+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">golang</category><title>Optional Parameters in Go function</title><description>To add optional parameters in a Go function, we can use variadic arguments or variadic function.&lt;br /&gt;
&lt;br /&gt;
See this &lt;a href=&quot;http://play.golang.org/p/MF__T9LXQF&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;example&lt;/a&gt;:-

&lt;iframe frameborder=&quot;0&quot; src=&quot;http://play.golang.org/p/MF__T9LXQF&quot; style=&quot;height: 100%; width: 100%;&quot;&gt;&lt;a href=&quot;http://play.golang.org/p/MF__T9LXQF&quot;&gt;see this code in play.golang.org&lt;/a&gt;&lt;/iframe&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2015/11/optional-parameters-in-go-function.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-6382331644987017256</guid><pubDate>Fri, 03 Jul 2015 08:16:00 +0000</pubDate><atom:updated>2015-07-10T11:25:00.124+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">golang</category><category domain="http://www.blogger.com/atom/ns#">Tutorials</category><title>Job queue example in Golang</title><description>What is a Job Queue?
&lt;br /&gt;
&lt;blockquote&gt;
A job queue, is a data structure maintained by &lt;b&gt;job scheduler software&lt;/b&gt; containing jobs to run.

Users submit their programs that they want executed, &quot;jobs&quot;, to the queue for batch processing. The scheduler software maintains the queue as the pool of jobs available for it to run.&lt;/blockquote&gt;
via &lt;a href=&quot;https://en.wikipedia.org/wiki/Job_queue&quot; target=&quot;_blank&quot;&gt;Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
You can write highly concurrent Job queue system using Golang.

&lt;br /&gt;
Here is the example code by &lt;a href=&quot;https://twitter.com/blakecaldwell/status/616636337983213568&quot; target=&quot;_blank&quot;&gt;@blackecaldwell&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
//
// Example of a simple job queue
//
// - Each job is a series of tasks.
// - We finish all of a job&#39;s tasks before moving onto the next one.
//
// Blake Caldwell
// http://blakecaldwell.net
// http://twitter.com/blakecaldwell
// 

package main

import (
 &quot;fmt&quot;
 &quot;time&quot;
)

// Run a job - blocks until the job is done
func runJob(jobQueue chan chan string, name string) {

 // our job is a series of tasks
 taskQueue := make(chan string)
 defer close(taskQueue)

 // Queue our tasks in the job queue
 jobQueue &amp;lt;- taskQueue

 // job queue made room for us - queue up each of our tasks
 fmt.Printf(&quot;Starting job %s\n&quot;, name)
 for i := 1; i &amp;lt;= 5; i++ {
  taskQueue &amp;lt;- fmt.Sprintf(&quot;%s: %d&quot;, name, i)
  time.Sleep(1000 * time.Millisecond)
 }
 fmt.Printf(&quot;Job %s done!\n\n&quot;, name)

}

func main() {

 // This is our job queue - a channel of channels. We write channels of tasks into it.
 jobQueue := make(chan chan string)
 defer close(jobQueue)

 // simulate multiple requests to use the job queue
 fmt.Println(&quot;Begin: Kicking off workers that want to use the job queue&quot;)
 go runJob(jobQueue, &quot;A&quot;)
 go runJob(jobQueue, &quot;B&quot;)
 go runJob(jobQueue, &quot;C&quot;)
 fmt.Println(&quot;End: Kicking off workers that want to use the job queue\n&quot;)

 // this is just for the example - this would be handled differently in a real service
 remainingJobs := 3

 // handle each job in the queue
 for job := range jobQueue {

  // Execute each of the tasks
  for task := range job {
   fmt.Printf(&quot;Handling: %s\n&quot;, task)
  }

  // break out when done
  remainingJobs--
  if remainingJobs == 0 {
   break
  }

 }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;a href=&quot;http://play.golang.org/p/rC-ZAQWL93&quot; target=&quot;_blank&quot;&gt;Try this example&lt;/a&gt;

Update: Here is an &lt;a href=&quot;http://nesv.github.io/golang/2014/02/25/worker-queues-in-go.html&quot; target=&quot;_blank&quot;&gt;more detailed code by Nick Saika&lt;/a&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2015/07/job-queue-example-in-golang.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-3350499423029942947</guid><pubDate>Tue, 16 Dec 2014 09:37:00 +0000</pubDate><atom:updated>2014-12-16T15:07:43.861+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">angularJs</category><category domain="http://www.blogger.com/atom/ns#">api</category><category domain="http://www.blogger.com/atom/ns#">Application</category><category domain="http://www.blogger.com/atom/ns#">golang</category><category domain="http://www.blogger.com/atom/ns#">MySql</category><title>Single Page Web Application using Golang and AngularJS</title><description>A single page application (SPA) is an application that intracts with server via RESTfull API using JavaScript code on Client side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;RESTfull API on Backend&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This part is created using Golang on server, we are using MySql as database. Here is blog post about it &lt;a href=&quot;http://motyar.blogspot.fr/2014/09/restful-api-for-mysql-in-go.html&quot; target=&quot;_blank&quot;&gt;REST API in Golang&lt;/a&gt; and code is hosted on Github here &lt;span class=&quot;nx&quot;&gt;&lt;a href=&quot;https://github.com/motyar/restgomysql&quot; target=&quot;_blank&quot;&gt;Github / motyar / restgomysql&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Front-end AngularJS&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Using AngularJS on front-end, BTW you can use jQuery or simple Ajax code too. 

Here is the &lt;a href=&quot;http://motyar.info/angular/todos/&quot; target=&quot;_blank&quot;&gt;application working live&lt;/a&gt;.

&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2014/12/single-page-web-application-using.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-7894120390762318008</guid><pubDate>Fri, 26 Sep 2014 13:55:00 +0000</pubDate><atom:updated>2014-09-26T19:25:00.424+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">golang</category><category domain="http://www.blogger.com/atom/ns#">Tutorials</category><title>WaterMark Image with Golang</title><description>Go is powerful, Golang&#39;s package &#39;image&#39; can be used to watermarning an image with another image.&lt;br /&gt;
&lt;br /&gt;
Here is the code, I found on StackOverFlow:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package main

import (
    &quot;image&quot;
    &quot;image/draw&quot;
    &quot;image/jpeg&quot;
    &quot;image/png&quot;
    &quot;os&quot;
)

func main() {
    imgb, _ := os.Open(&quot;input.jpg&quot;)
    img, _ := jpeg.Decode(imgb)
    defer imgb.Close()

    wmb, _ := os.Open(&quot;watermark.png&quot;)
    watermark, _ := png.Decode(wmb)
    defer wmb.Close()

    offset := image.Pt(100, 100)
    b := img.Bounds()
    m := image.NewRGBA(b)
    draw.Draw(m, b, img, image.ZP, draw.Src)
    draw.Draw(m, watermark.Bounds().Add(offset), watermark, image.ZP, draw.Over)

    imgw, _ := os.Create(&quot;output.jpg&quot;)
    jpeg.Encode(imgw, m, &amp;amp;jpeg.Options{jpeg.DefaultQuality})
    defer imgw.Close()
}

&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2014/09/watermark-image-with-golang.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-958981573410100831</guid><pubDate>Sun, 21 Sep 2014 01:56:00 +0000</pubDate><atom:updated>2014-09-21T07:26:02.959+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">api</category><title>REST </title><description>You have an URI ( its same as URL) that talks. Really?&lt;br /&gt;
&lt;br /&gt;
Yes!&lt;br /&gt;
&lt;br /&gt;
How?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Client&lt;/b&gt; ( Web Browser or CURL or HTTP client in code ) and sends a Request. Each HTTP request have a &#39;methods&#39; parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Server&lt;/b&gt; ( Where the URL points ) reads the HTTP.&lt;b&gt;method&lt;/b&gt; and can behave according to that.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Method&lt;/b&gt; may be GET , POST,&amp;nbsp; PUT or DELETE, Server performs actions according to the Method and Returns result data (JSON, XML etc).&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2014/09/rest.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-2701488033346270094</guid><pubDate>Fri, 12 Sep 2014 02:01:00 +0000</pubDate><atom:updated>2014-09-12T07:33:35.200+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">golang</category><title>RESTful API for MySQL in Go </title><description>Most of the mobile and webapp uses REST APIs these days. Client side code uses CURD operations to READ, WRITE, UPDATE and DELETE etc.&lt;br /&gt;
&lt;br /&gt;
The backend of REST APIs can be written with GO ( golang ).&lt;br /&gt;
&lt;br /&gt;
You can use &lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span class=&quot;nx&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;NewServeMux()&lt;/span&gt; to handle path and to decide what to serve. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span class=&quot;nx&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;HandlerFunc&lt;/span&gt; can define which function will handle the &lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;http&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;Request&lt;/span&gt;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;nx&quot;&gt;In this function we can check what type of &lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;Method&lt;/span&gt; it is, code can act accordingly ( READ, WRITE, DELETE or UPDATE database) and write back the output (in JSON) to &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span class=&quot;nx&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ResponseWriter&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;nx&quot;&gt;I have shared the code on &lt;a href=&quot;https://github.com/motyar/restgomysql&quot; target=&quot;_blank&quot;&gt;Github / motyar / restgomysql&lt;/a&gt; &lt;/span&gt; Feel free to fork and improve.
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;nx&quot;&gt;You can discuss more on &lt;a href=&quot;http://www.reddit.com/r/golang/comments/2fzl75/rest_api_in_golang_with_mysql_database/&quot; target=&quot;_blank&quot;&gt;Reddit here&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2014/09/restful-api-for-mysql-in-go.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-5202011309119882005</guid><pubDate>Mon, 08 Sep 2014 13:03:00 +0000</pubDate><atom:updated>2014-09-08T18:33:31.434+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Application</category><category domain="http://www.blogger.com/atom/ns#">golang</category><title>Creating Static WebServer in Go ( golang )</title><description>I am learning &lt;a href=&quot;http://golang.org/&quot; target=&quot;_blank&quot;&gt;golang&lt;/a&gt;, I have go through the &lt;a href=&quot;http://golang.org/&quot; target=&quot;_blank&quot;&gt;golang tour&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I found it a very easy and fast language for web backend.&lt;br /&gt;
&lt;br /&gt;
In this post I want to share a very simple static file server we can create in few line of Go (golang)&lt;br /&gt;
&lt;br /&gt;
Here is the code you have to put in server.go ( or any name dot go)&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package main                                                          
                                                                      
import (                                                              
    &quot;log&quot;                                                             
    &quot;net/http&quot;                                                        
)                                                                     
                                                                      
func main() {                                                         
    // Simple static webserver:                                       
    log.Fatal(http.ListenAndServe(&quot;:8080&quot;, http.FileServer(http.Dir(&quot;.&quot;))))                                                                           
} 
&lt;/code&gt;
&lt;/pre&gt;
You can change the dot with any path or dir that you want to server on port 8080.&lt;br /&gt;
Port can be anything too.
Run this code like this
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
go run server.go
&lt;/code&gt;
&lt;/pre&gt;
Now open &lt;a href=&quot;http://localhost:8080/&quot; target=&quot;_blank&quot;&gt;http://localhost:8080/&lt;/a&gt; or &lt;a href=&quot;http://ipofyourvpn:8080/&quot; target=&quot;_blank&quot;&gt;http://IPofYourVPN:8080&lt;/a&gt;

&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2014/09/creating-static-webserver-in-go-golang.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-5034461545992238538</guid><pubDate>Wed, 20 Aug 2014 01:43:00 +0000</pubDate><atom:updated>2014-08-20T07:15:18.172+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">angularJs</category><category domain="http://www.blogger.com/atom/ns#">api</category><category domain="http://www.blogger.com/atom/ns#">mongodb</category><category domain="http://www.blogger.com/atom/ns#">nodejs</category><category domain="http://www.blogger.com/atom/ns#">Web-service</category><title>REST APIs for your MEAN Stack Application</title><description>You can use JavaScript throughout your stack. This is called&amp;nbsp; MEAN stack:­ &lt;a href=&quot;http://mongodb.org/&quot; target=&quot;_blank&quot;&gt;MongoDB&lt;/a&gt;, &lt;a href=&quot;http://expressjs.com/&quot; target=&quot;_blank&quot;&gt;ExpressJS&lt;/a&gt;, &lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;, and &lt;a href=&quot;http://nodejs.org/&quot; target=&quot;_blank&quot;&gt;Node.js&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
MongoDB as Database, ExpressJS for routing and HTTP server, All logic on beckend in Node.js, and AngularJS on front end to Handle REST APIs and Client side routing.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
In this post we are going to write the beck-end part for a simple MEAN stack app, REST APIs to handle data.&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;
Pandas in bamboo farm&lt;/h1&gt;
&lt;h2&gt;
&lt;a href=&quot;https://github.com/motyar/rest_api_mean&quot; target=&quot;_blank&quot;&gt;REST API using NodeJS, Express and MongoDB&lt;/a&gt;.&lt;/h2&gt;
&lt;h3&gt;
Installation&lt;/h3&gt;
You must have MongoDB and NodeJS installted on your server.
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
    git clone https://github.com/motyar/rest_api_mean
    cd rest_api_mean
    npm install
    node server.js
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;
Nothing but (cute) Pandas&lt;/h3&gt;
GET /api/pandas to get all the pandas.&lt;br /&gt;
GET /api/pandas/panda_id to get that panda&#39;s info&lt;br /&gt;
POST /api/pandas to add new panda&lt;br /&gt;
DELETE /api/pandas/panda_id to remove that one panda.&lt;br /&gt;
PUT /api/pandas/panda_id to update details&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Tools&lt;/h3&gt;
You can use &lt;a href=&quot;http://www.hurl.it/&quot; target=&quot;_blank&quot;&gt;HurlIt&lt;/a&gt; to test REST APIs.
&lt;br /&gt;
&lt;h3&gt;
&amp;nbsp;&lt;/h3&gt;
&lt;h3&gt;
Whats next?&lt;/h3&gt;
Stay tuned, we will be working on front end of this app, using AngularJS.
&lt;br /&gt;
&lt;h2&gt;
&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;
You can &lt;a href=&quot;mailto:dharmmotyar@gmail.com&quot; target=&quot;_blank&quot;&gt;hire me&lt;/a&gt; for your next fullstack JavaScript application, I am available&lt;/h2&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2014/08/rest-apis-for-your-mean-stack.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-5658489044290371672</guid><pubDate>Mon, 04 Aug 2014 07:45:00 +0000</pubDate><atom:updated>2014-08-04T13:15:10.209+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Javascript</category><category domain="http://www.blogger.com/atom/ns#">json</category><category domain="http://www.blogger.com/atom/ns#">xml</category><title>Xml2Json in JavaScript</title><description>Here is the simple function via &lt;a href=&quot;http://davidwalsh.name/convert-xml-json&quot;&gt;DWB (DavidWalshBlog)&lt;/a&gt;. You can use to convert XML to JSON in your JavaScript code.

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
// Changes XML to JSON
function xmlToJson(xml) {
 
 // Create the return object
 var obj = {};

 if (xml.nodeType == 1) { // element
  // do attributes
  if (xml.attributes.length &amp;gt; 0) {
  obj[&quot;@attributes&quot;] = {};
   for (var j = 0; j &amp;lt; xml.attributes.length; j++) {
    var attribute = xml.attributes.item(j);
    obj[&quot;@attributes&quot;][attribute.nodeName] = attribute.nodeValue;
   }
  }
 } else if (xml.nodeType == 3) { // text
  obj = xml.nodeValue;
 }

 // do children
 if (xml.hasChildNodes()) {
  for(var i = 0; i &amp;lt; xml.childNodes.length; i++) {
   var item = xml.childNodes.item(i);
   var nodeName = item.nodeName;
   if (typeof(obj[nodeName]) == &quot;undefined&quot;) {
    obj[nodeName] = xmlToJson(item);
   } else {
    if (typeof(obj[nodeName].push) == &quot;undefined&quot;) {
     var old = obj[nodeName];
     obj[nodeName] = [];
     obj[nodeName].push(old);
    }
    obj[nodeName].push(xmlToJson(item));
   }
  }
 }
 return obj;
};
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2014/08/xml2json-in-javascript.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-1820689138268705245</guid><pubDate>Mon, 04 Aug 2014 06:17:00 +0000</pubDate><atom:updated>2017-07-10T13:39:34.265+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">angularJs</category><category domain="http://www.blogger.com/atom/ns#">api</category><category domain="http://www.blogger.com/atom/ns#">Web-service</category><category domain="http://www.blogger.com/atom/ns#">xml</category><title>How to parse XML in Angular JS</title><description>Still many webServices and REST APIs provide output in XML, AngularJS doent work with XML data.&lt;br /&gt;
&lt;br /&gt;
We are going to use &lt;a href=&quot;https://code.google.com/p/x2js/&quot; target=&quot;_blank&quot;&gt;x2js&lt;/a&gt;, to convert XML data to JSON object. All other code will not be effected any way.&lt;br /&gt;
&lt;br /&gt;
We are going to parse this XML sample file
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/motyar/bcf1d2b36e8777fd77d6.js&quot;&gt;&lt;/script&gt;
Here is very basic example code.&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/motyar/66648905781924c1e4a5.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2014/08/how-to-parse-xml-in-angular-js.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-8020357244281636919</guid><pubDate>Thu, 24 Jul 2014 10:28:00 +0000</pubDate><atom:updated>2014-07-24T15:58:51.513+05:30</atom:updated><title>Making MongoDB and MySql run simultaneously on Ubuntu</title><description>I am using a &lt;a href=&quot;https://www.digitalocean.com/?refcode=34a8a2d54244&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;linux VPS&lt;/a&gt; for development. Was using it for PHP application, but as I started with NodeJS, I &lt;a href=&quot;http://motyar.blogspot.com/2014/07/installing-and-running-mondodb-on.html&quot; target=&quot;_blank&quot;&gt;installed MongoDB&lt;/a&gt; on it.&lt;br /&gt;
&lt;br /&gt;
Everything was working well but suddenly MySql stopped working.&lt;br /&gt;
&lt;br /&gt;
I checked the and found this error&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;/usr/sbin/mysqld: Can&#39;t create/write to file &#39;/tmp/ibAJK&#39; (Errcode: 13)&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution?&lt;br /&gt;
&lt;br /&gt;
Following commands solved the issue, I think it was a permission problem.

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
chown root:root /tmp
chmod 1777 /tmp
service mysql start
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
But I got this error in mongoDB log&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;locale::facet::_S_create_c_locale name not valid&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Solution?
Yes, Run this command in terminal:
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
export LC_ALL=C
mongod --fork --logpath /var/log/mongodb.log
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Now both MongoDB and MySql are running on my VPS. 


&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2014/07/making-mongodb-and-mysql-run.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-7476581469871766533</guid><pubDate>Thu, 10 Jul 2014 04:57:00 +0000</pubDate><atom:updated>2014-07-10T10:34:47.765+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">mongodb</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>Installing and running MondoDB on Ubuntu / Linux</title><description>&lt;b&gt;Installation:-

&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

echo &#39;deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen&#39; | sudo tee /etc/apt/sources.list.d/10gen.list

sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install mongodb-10gen

&lt;/code&gt;
&lt;/pre&gt;
&lt;b&gt;Change configurations:-
&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
vi /etc/mongodb.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Check for error/logs:-

&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
tail -f /var/log/mongodb/mongodb.log
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
Create the &lt;b&gt;dbpath&lt;/b&gt; dir if not exists, and give permissions:-
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
sudo chown -R mongodb:mongodb /root/data/db
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Start mongod as a Daemon:-

&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
mongod --fork --logpath /var/log/mongodb.log
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
Ref - &lt;a href=&quot;http://docs.mongodb.org/manual/tutorial/manage-mongodb-processes/&quot; target=&quot;_blank&quot;&gt;http://docs.mongodb.org/manual/tutorial/manage-mongodb-processes/&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2014/07/installing-and-running-mondodb-on.html</link><author>noreply@blogger.com (bbbbbb)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7339286656747792301.post-1545715255883122354</guid><pubDate>Wed, 09 Jul 2014 10:21:00 +0000</pubDate><atom:updated>2014-07-10T11:51:56.255+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">angularJs</category><category domain="http://www.blogger.com/atom/ns#">api</category><category domain="http://www.blogger.com/atom/ns#">php</category><title>Simple Todo app: Using AngularJS and REST APIs</title><description>While learning AngularJs, I read many tutorials, watched few videos. I found Angular so fast and as its MVVC, Your code is clean easy to understand.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As most of my work is related to REST APIs, I wrote this simple example of Todo app, that:-&lt;br /&gt;
&lt;br /&gt;
1. Fetches Todos from API and displays them in list. &lt;b&gt;GET call&lt;/b&gt;.&lt;br /&gt;
2. Can add Todo to Server Database using &lt;b&gt;POST call&lt;/b&gt;.&lt;br /&gt;
3. Can delete Todo from Server Database using &lt;b&gt;DELETE call&lt;/b&gt;.&lt;br /&gt;
4. Basic Search using &lt;b&gt;filter&lt;/b&gt;.
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://motyar.info/angular/todos/&quot;&gt;Here is the working demo&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The code is hosted on Github, you can &lt;a href=&quot;https://github.com/motyar/angular_todos&quot;&gt;check here&lt;/a&gt;.

Feel free to get back to me about any help you need about the code.
 &lt;div class=&quot;blogger-post-footer&quot;&gt;http://codeplayers.com&lt;/div&gt;</description><link>http://motyar.blogspot.com/2014/07/simple-todo-app-using-angularjs-and.html</link><author>noreply@blogger.com (bbbbbb)</author></item></channel></rss>