Permalink
Browse files

Many minor changes

  • Loading branch information...
1 parent e559877 commit 3f0b1a951c87afd9a91aa471927ca0ae629147b1 @captn3m0 committed Sep 12, 2011
@@ -5,8 +5,9 @@
<title>{{ page.title }}</title>
<meta name="author" content="Abhay Rana">
<meta name="keywords" content="captnemo, abhay rana, sdslabs, github pages, piratecoders, iit roorkee, abhayumt">
+ <script type="text/javascript" src="/js/google-code-prettify/prettify.js"></script>
<link rel="stylesheet" href="/css/bootstrap-1.2.0.min.css">
- <link rel="stylesheet" href="/css/syntax.css" />
+ <link rel="stylesheet" href="/js/google-code-prettify/prettify.css" />
<link href="/atom.xml" rel="alternate" title="CaptNemo.in Atom Feed" type="application/atom+xml" />
<style>
.forkme {
@@ -45,7 +46,7 @@
})();
</script>
</head>
-<body style="padding-top: 50px;" >
+<body style="padding-top: 50px;" onload="prettyPrint()">
<a href="https://github.com/captn3m0/captn3m0.github.com" class="forkme">
<img src="https://a248.e.akamai.net/assets.github.com/img/4c7dc970b89fd04b81c8e221ba88ff99a06c6b61/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67" alt="Fork me on GitHub">
</a>
View
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>{{ page.title }}</title>
+ <meta name="author" content="Abhay Rana">
+ <meta name="keywords" content="captnemo, abhay rana, sdslabs, github pages, piratecoders, iit roorkee, abhayumt">
+ <script type="text/javascript" src="/js/google-code-prettify/prettify.js"></script>
+ <link rel="stylesheet" href="/css/bootstrap-1.2.0.min.css">
+ <link rel="stylesheet" href="/js/google-code-prettify/prettify.css" />
+ <link href="/atom.xml" rel="alternate" title="CaptNemo.in Atom Feed" type="application/atom+xml" />
+ <style>
+ .forkme {
+ position: absolute;
+ width: 149px;
+ height: 149px;
+ top: 0;
+ right: 0;
+ z-index: 99999;
+ opacity: 0.7;
+ -webkit-transition-duration: 500ms;
+ -moz-transition-duration: 500ms;
+ -o-transition-duration: 500ms;
+ }
+ .imagedropshadow {
+ padding: 5px;
+ border: solid 1px #EFEFEF;
+ }
+ a:hover img.imagedropshadow {
+ border: solid 1px #CCC;
+ -moz-box-shadow: 1px 1px 5px #999;
+ -webkit-box-shadow: 1px 1px 5px #999;
+ box-shadow: 1px 1px 5px #999;
+ }
+ </style>
+ <!-- Google Analytics -->
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-5922129-9']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+ </script>
+ </head>
+<body style="padding-top: 50px;" onload="prettyPrint()">
+ <a href="https://github.com/captn3m0/captn3m0.github.com" class="forkme">
+ <img src="https://a248.e.akamai.net/assets.github.com/img/4c7dc970b89fd04b81c8e221ba88ff99a06c6b61/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67" alt="Fork me on GitHub">
+ </a>
+ <header>
+ <div class="topbar">
+ <div class="topbar-inner">
+ <div class="container">
+ <h3><a href="/">CaptNemo.in</a></h3>
+ <ul class="nav">
+ <li class="active"><a href="/">Home</a></li>
+ <li><a href="/projects/" title="Projects">Projects</a></li>
+ <li><a href="/contact/" title="Contact">Contact</a></li>
+ </ul>
+ </div>
+ </div><!-- /topbar-inner -->
+ </div>
+ </header>
+ <div class="row container">
+ <div class="span16 columns">
+ <div class="page-header">
+ <h1>{{ page.title }}</h1>
+ </div>
+ {{content}}
+ </div>
+ </div>
+</body>
+</html>
@@ -10,9 +10,9 @@ Here is my current setup :
* Dell Inspiron 1545
* T-6400 Intel Core 2 Duo
-* Ubuntu Natty Narwhal 11.04 (Default OS)
+* Ubuntu Oneric Ocelot 11.10 (Default Primary OS)
* <del>[Elementary OS][eos] (Under Testing)</del> Will be moving to Gnome Shell soon
-* [Samurai WTF][samurai], [Backtrack 5][bt5] for pen-tests
+* <del>[Samurai WTF][samurai], [Backtrack 5][bt5]</del> for pen-tests
* Moved from Windows after remaining a staunch supporter for 5 years
@@ -23,11 +23,11 @@ Sparkleshare asks you to setup a git-server somewhere and use it as a remote sto
###Setup Gitolite
####Assumptions :
1. You are running a stable Linux OS (Fedore/Debian/Ubuntu etc)
-2. user@host1 is your own computer
-3. user2@host2 is the primary computer where you intend to start the server
-4. The gitolite username is sparkle
+2. `user@host1` is your own computer
+3. `user2@host2` is the primary computer where you intend to start the server
+4. The gitolite username is `sparkle`
-{% highlight bash linenos %}
+<pre class="prettyprint lang-sh">
#On your host machine (which will be remote admin to the git share)
ssh-copy-id user2@host2:/tmp/user.tmp
#should not ask for password:
@@ -40,19 +40,18 @@ git clone sparkle@host2:gitolite-admin
#Should work, or else you did something wrong. Go read the [gitolite docs](http://sitaramc.github.com/gitolite/doc/)
cd gitolite-admin
nano conf/gitolite.conf
-{% endhighlight %}
+</pre>
###Setup WildRepos
Edit the file and add the following lines at the bottom :
-
-{% highlight perl %}
+<pre class="prettyprint lang-pl">
repo share/[a-z0-9]{6}
C = @all
RW+ = CREATOR
-{% endhighlight %}
+</pre>
Now we need a method to allow anyone to create git repositories on the server. This is accomplished via Gitolite's very powerful Wildcard Repositories feature.
-{% highlight linenos bash %}
+<pre class="prettyprint lang-sh">
#Login back to server
ssh user2@host2
#Since we are using package install method, sparkle's password needs to be set
@@ -64,34 +63,38 @@ logout
#Now we push our admin repo to add the wildrepo settings
#you're still inside the gitolite-admin directory, right
git push
-{% endhighlight %}
+</pre>
###Setup Client
Now, your server is all setup, but there is still stuff to be done :
-{% highlight bash linenos %}
+<pre class="prettyprint lang-sh">
#On user1@host1
mkdir -p ~/.ssh
sudo add-apt-repository ppa:warp10/sparkleshare
sudo apt-get update
sudo apt-get install sparkleshare libwebkit1.1-cil git-core
sparkleshare start &
sparkleshare stop
-{% endhighlight %}
+</pre>
When you run sparkleshare for the first time, it asks you for a few things, including your email-id. Fill in those details, but do not setup your repository yet. You need to first allow your sparkleshare account access to gitolite.
-{% highlight bash %}
+
+<pre class="prettyprint lang-sh">
cd ~/.config/sparkleshare
ls #Should reveal files called sparkleshare.email.key and sparkleshare.email.key.pub
cp sparkleshare.email.key.pub /path/to/gitolite-admin/keydir/
cd /path/to/gitolite-admin/
git commit -am "Added sparkleshare client1"
git push
-{% endhighlight %}
+</pre>
+
Now if all goes well, you'd have allowed acess to gitolite for this user. We now need to re-run the sparkeshare setup again. Find it in your Applications. Now when it asks you to fill a repository path, type in the following details :
-{% highlight yaml %}
+
+<pre class="prettyprint lang-yaml">
Server: ssh://sparkle@host2
Path: /share/fh73ah
-{% endhighlight %}
+</pre>
+
Please take care of the slashes, otherwise sparkleshare fails to recognize it as a valid ssh address. Instead of fh73ah, you can type any alphanumeric string of 6 characters. You can change this in your gitolite-admin conf.
@@ -27,6 +27,7 @@ Google's announced its next big thing, [Google+](http://plus.google.com) to take
The [famous announcement of Linux Kernel](http://www.thelinuxdaily.com/2010/04/the-first-linux-announcement-from-linus-torvalds/) on the `comp.os.minix` mailing list is well-known. Slightly re-written, this is how Linus might have announced Google+.
+<pre>
>From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
>Newsgroups: web.social.facebook
>Subject: What would you like to see most in facebook
@@ -45,3 +46,4 @@ The [famous announcement of Linux Kernel](http://www.thelinuxdaily.com/2010/04/t
>PS. Yes – it’s free of any facebook code, and it has pipelined js. It is NOT protable (uses google accounts), and it probably never will support anything other than Google App Engine, as that’s all I have :-(.
+</pre>
@@ -2,9 +2,13 @@
title: Learning Ruby on Rails
layout: post
---
-Continuing my quest on Web Designing, I've started learning [Ruby On Rails][ror], which is like *the* most-hyped web framefork of the moment. After all, [Github][gh] runs on Ruby On Rails, [Redmine][red] uses Rails, and so do ,[Basecamp](http://basecamphq.com),[Hulu](http://hulu.com),[Scribd](http://scribd.com), and even [Twitter](http://twitter.com). Even though RoR has Ruby in its name, its just a namesake. Learning Ruby and learning Rails are entirely two different routes, and learning one only gives you a slight advantage in the other. I'm learning Rails by the excellent book, [Ruby On Rails 3 Tutorial][ror3t], by Michael Hartl. It covers Rails 3, which is one reason I picked it as Rails 3 is quite different from Rails 2 in comparision.
+Continuing my quest on Web Designing, I've started learning [Ruby On Rails][ror], which is like *the* most-hyped web framefork of the moment. After all, [Github][gh] runs on Ruby On Rails, [Redmine][red] uses Rails, and so do [Basecamp](http://basecamphq.com),[Hulu](http://hulu.com),[Scribd](http://scribd.com), and even [Twitter](http://twitter.com). Even though RoR has Ruby in its name, its just a namesake.
-Rails in a few words would be described as *a Web framework that makes writing web applications really, really easy*. And I really mean that. I've been programming in Rails for ~2 days, and I can confortably say that it is better than any other PHP framework (viz [CakePHP](http://cakephp.org), [CodeIgniter](http://codeigniter.com), [Kohana](http://kohanaphp.com)) simple because it is powered by Ruby. And the beauty of Ruby is not in its implementation, but in its elegance. Reading ruby code is lie reading seeing a visual presentation. While PHP is the paragraphed, prose version of the same stuff. Simply put, PHP allows you to do the same things, but essentialy it was not readable enough to match Ruby's elegance.
+Learning Ruby and learning Rails are entirely two different routes, and learning one only gives you a slight advantage in the other. I'm learning Rails by the excellent book, [Ruby On Rails 3 Tutorial][ror3t], by Michael Hartl. It covers Rails 3, which is one reason I picked it as Rails 3 is quite different from Rails 2 in comparision.
+
+Rails in a few words would be described as *a Web framework that makes writing web applications really, really easy*. And I really mean that. I've been programming in Rails for ~2 days, and I can confortably say that it is better than any other PHP framework (viz [CakePHP](http://cakephp.org), [CodeIgniter](http://codeigniter.com), [Kohana](http://kohanaphp.com)) simple because it is powered by Ruby.
+
+And the beauty of Ruby is not in its implementation, but in its elegance. Reading ruby code is lie reading seeing a visual presentation. While PHP is the paragraphed, prose version of the same stuff. Simply put, PHP allows you to do the same things, but essentialy it was not readable enough to match Ruby's elegance.
Rails follows the [MVC pattern][mvc] (Model-View-Controller) for development, and uses it strictly. It has got its own conventions, but as I found out, the concept of convention over Configuration makes much more sense in Rails than it ever did in PHP. All that time I spent in the CakePHP console was nothing compared to the interactivity of the Rails Console(`rails c`). Starting development server(`rails s`) is as easy as running the production server(`rails s --environment production`).
@@ -13,20 +13,20 @@ Soon, V8 was developed as a backend to an evented IO library, that is now known
Basically node allows you bring home the same good anonymous functions from [JQuery](http://jquery.org) on your server. In advanced terms, node allows evented input/output, meaning all the IO calls are non-blocking and evented, or scheduled in parallel.
###Traditional I/O:
-{% highlight javascript %}
+<pre class="prettyprint">
data = file.read("/foo/bar");
// wait...
doSomething(data);
-{% endhighlight %}
+</pre>
###Evented I/O:
-{% highlight javascript %}
+<pre class="prettyprint">
file.read("/foo/bar", function(data) {
// called after data is read
doSomething(data);
});
otherThing(); // execute immediately;
-{% endhighlight %}
+</pre>
##How To Install
@@ -93,16 +93,14 @@ node.js comes with "batteries included", and part of that battery is node's abil
This is a very simple HTTP server, written using the http module(included) in node :
-{% highlight javascript %}
-var http=require('http');
+<pre class="prettyprint">var http=require('http');
http.createServer(function(request, response) {
var headers = { "Content-Type": "text/plain" };
response.sendHeader(200, headers);
response.sendBody("Hello, World!\n");
response.finish();
}).listen(8000);
-{% endhighlight %}
-
+</pre>
As you can see, the createServer function takes a callback function as its argument. The callback function is called for each of the requests. All events are handled easily and instead of a server handling threads, memory etc, node just handles requests. In essence, a request generates an *event*, which is then handled by the callback function provided.
This is quite similar to the way we program event loops in javascript on the browser.
@@ -112,8 +110,6 @@ There are loads of interesting projects using node. Visit the [modules section](
I'd recommend starting out with [Connect](https://github.com/senchalabs/Connect) which is a middleware for node, and allows you to wrap your application easily around it. For databases, you can either go with the standard Relational ones(like mysql) or be brave, and take a spin with the noSQL ones like CouchDB, Cassandra, or MongoDB. All of them have native bindings available for node.js.
-#Links
-
##References
* [Node On GitHub](https://github.com/joyent/node/), including the wiki, documentation & code
* [Nodejs.org](http://nodejs.org/)
@@ -127,7 +123,7 @@ I'd recommend starting out with [Connect](https://github.com/senchalabs/Connect)
* [The node Beginner book](http://nodebeginner.org/)
* [NodeCasts](http://nodecasts.org/)
-##Some Introductory [StackOverflow](http://stackoverflow.com) Questions on node
+##[StackOverflow](http://stackoverflow.com) Questions on node
* [How to store Node.js deployment settings/configuration files?](http://stackoverflow.com/questions/5869216)
* [How do I get started with NodeJS](http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-nodejs)
* [What is node.js](http://stackoverflow.com/questions/1884724/what-is-node-js)
@@ -1,5 +1,5 @@
---
-layout: page
+layout: single
title: IIT-jEE 2011 Results
---
<div><style>

0 comments on commit 3f0b1a9

Please sign in to comment.