index.html 13.4 KB
Newer Older
Pallav Agarwal's avatar
Pallav Agarwal committed
1
<title>Tips - VARSTACK</title>
2 3 4 5 6 7 8
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5";
fjs.parentNode.insertBefore(js, fjs);
9 10 11 12
}(document, 'script', 'facebook-jssdk'));
var host = "varstack.com";
var hostwww = "www.varstack.com";
if (((host == window.location.host) || (hostwww == window.location.host))
13
        && (window.location.protocol != 'https:'
Pallav Agarwal's avatar
Pallav Agarwal committed
14
            || window.location.toString().match(/http.?:\/\/var/))){
15
  window.location = window.location.toString().replace(/^http:/, "https:").replace(/https:\/\/varstack/, "https://www.varstack");
16 17
}
</script>
Pallav Agarwal's avatar
Pallav Agarwal committed
18
<meta name=viewport content="width=device-width, initial-scale=1">
Pallav Agarwal's avatar
Pallav Agarwal committed
19 20
<meta charset="utf-8"/>

Pallav Agarwal's avatar
Pallav Agarwal committed
21
<noscript>
Pallav Agarwal's avatar
Pallav Agarwal committed
22
    <link href="/css/bootstrap.min.css" rel="stylesheet">
Pallav Agarwal's avatar
Pallav Agarwal committed
23 24 25 26 27
    <link href="/css/highlighting.css" rel="stylesheet">
    <link href="/css/style.css" rel="stylesheet">
    
</noscript>
<script id="loadcss">function loadCSS(e,n,o,t){"use strict";var d=window.document.createElement("link"),i=n||window.document.getElementsByTagName("script")[0],r=window.document.styleSheets;return d.rel="stylesheet",d.href=e,d.media="only x",t&&(d.onload=t),i.parentNode.insertBefore(d,i),d.onloadcssdefined=function(e){for(var n,o=0;o<r.length;o++)r[o].href&&r[o].href===d.href&&(n=!0);n?e():setTimeout(function(){d.onloadcssdefined(e)})},d.onloadcssdefined(function(){d.media=o||"all"}),d}
Pallav Agarwal's avatar
Pallav Agarwal committed
28
loadCSS( "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css", document.getElementById("loadcss"));
Pallav Agarwal's avatar
Pallav Agarwal committed
29 30 31 32
loadCSS( "/css/highlighting.css", document.getElementById("loadcss"));
loadCSS( "/css/style.css", document.getElementById("loadcss"));
    
</script>
Pallav Agarwal's avatar
Pallav Agarwal committed
33 34 35 36 37 38 39 40 41

<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    
    <div class="container">
        <div class="row" id="menu">
Pallav Agarwal's avatar
Pallav Agarwal committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55
            <div class="col-md-3 col-xs-8 menu" id="site_title">
                <a href="/" style="color:black;">VARSTACK</a>
            </div>
            <div class="col-md-3 col-md-push-6 col-xs-4 menu">
                <form action="/search/" id='search-form'>
                    <input id="search-box" type="text" name="query" placeholder="Search..">
                </form>
            </div>
            <div class="col-md-6 col-md-pull-3 col-xs-12 menu">
                <div class="row" id="top_menu">
                    <ul class="nav nav-pills">
                        <li class="active" id="blog"><a class="color_change" href="/">Blog</a></li>
                        <li id="tips"><a class="color_change" href="/tips/">Tips</a></li>
                        <li id="algo"><a class="color_change" href="/algo/">Behind The Scenes</a></li>
56
                        <li id="gsoc"><a class="color_change" href="/gsoc/">GSoC_2016</a></li>
Pallav Agarwal's avatar
Pallav Agarwal committed
57 58
                        <li id="about"><a class="color_change" href="/about_me/">About Me</a></li>
                    </ul>
Pallav Agarwal's avatar
Pallav Agarwal committed
59 60 61 62 63
                </div>
            </div>
        </div>
        
        <div class="row" id="content">
Pallav Agarwal's avatar
Pallav Agarwal committed
64 65 66 67 68 69 70 71
            <div class="col-md-7 col-md-push-3">
                <div class="row" id="data">
                    <div class="col-md-12">
                        <br />
                        <h3>Tips</h3>
                        <hr />
                        <div class="row text-justify" id="content-holder">
                            <div class="col-md-12">
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
                                <p><strong><a href="/2016/04/27/SSH-keys/">EASY SHARING OF SSH KEYS</a></strong></p>

<p>This tip may be obvious to many people, but I feel this worth mentioning. A lot of us
have SSH keys set up for github. I found out today, from a friend (github/sakshamsharma)
that you can actually share your public keys with others by giving them your github
username.
For example,</p>


<p> curl https://github.com/pallavagarwal07.keys &gt;&gt; ~/.ssh/authorized_keys</p>

<p>would give me ssh/scp access to your PC.</p>


<p><br /></p>

<p><strong><a href="/2015/08/01/SSH-from-Windows/">USING SSH FROM WINDOWS 10 WITHOUT PUTTY</a></strong></p>
89 90 91 92 93 94 95 96 97

<p>With the recent upgrade to Windows 10, Microsoft fixed many of the things that I despised in Windows 8. I don't usually use Windows if I can avoid it, but unfortunately, some of my work requires me to use it anyway. For those times, one of the basic needs for me is an SSH client. A LOT of the time I'm programming directly on a SSHed server machine.</p>


<p> <p>Till a...</p></p>

<p><br /></p>

<p><strong><a href="/2015/07/27/Boost-Python-Performance/">CYTHON: BOOST PYTHON CODE PERFORMANCE</a></strong></p>
Pallav Agarwal's avatar
Pallav Agarwal committed
98

Pallav Agarwal's avatar
Pallav Agarwal committed
99
<p>This tip is for those people who have been working on large python projects and the fact that python is a slow language as compared to statically compiled languages has finally caught up with them. This tip is about Cython, what it is and where can you use it for maximum effect.</p>
Pallav Agarwal's avatar
Pallav Agarwal committed
100 101


Pallav Agarwal's avatar
Pallav Agarwal committed
102 103 104 105 106 107 108 109 110 111
<p> <p><br></p> <h4><strong>What is Cython?</strong></h4> <p>From the docs themselves,</p> <blockquote><p>Cython is an optimising static compiler for both the...</p></blockquote></p>

<p><br /></p>

<p><strong><a href="/2015/07/09/Wrath-of-Linux-Package-Managers/">WRATH OF LINUX PACKAGE MANAGERS</a></strong></p>

<p>We all love to characterise things as "More than the sum of it's parts". We'd like to say the same about our linux operating system. My <strong>ARCH</strong> is more than the sum of it's parts! Well.. no.</p>


<p> <p>A linux system is exactly the sum of it's parts. And most of those parts are connected to the base package manager, the beast that acts like a framework, holding everything together.</p> <p>Have...</p></p>
Pallav Agarwal's avatar
Pallav Agarwal committed
112 113 114 115 116

<p><br /></p>

<p><strong><a href="/2015/07/01/Vim-Mappings/">QUICK INTRO TO CUSTOM VIM MAPPINGS</a></strong></p>

Pallav Agarwal's avatar
Pallav Agarwal committed
117
<p>One of the best things about vim is its ability to create custom mappings for almost any key in all modes.</p>
Pallav Agarwal's avatar
Pallav Agarwal committed
118 119


Pallav Agarwal's avatar
Pallav Agarwal committed
120
<p> <p>Suppose you want Ctrl+S to save your document while you are in insert mode, because pressing</p>  &lt;Esc&gt;:w&lt;Enter&gt;i   <p>to switch to normal mode, save the file, and return back to insert mode is a bit too much. According to vim philosophy, it actually <strong>is</strong> too much, and thus you...</p></p>
Pallav Agarwal's avatar
Pallav Agarwal committed
121 122 123 124 125 126 127 128

<p><br /></p>

<p><strong><a href="/2015/06/30/Mouse-with-vim/">USING MOUSE WITH VIM IN THE TERMINAL</a></strong></p>

<p>Just when you thought vim couldn't surprise you anymore, vim strikes again. As it turns out, vim supports mouse integration even in the terminal. Not only that, the support is mind blowingly simple and amazing. You can move your cursor, select text and even resize your panes in a split screen.</p>


Pallav Agarwal's avatar
Pallav Agarwal committed
129
<p> <p>Most websites just say to use set mouse=a in your .vimrc to add mouse support to your vim. However,...</p></p>
Pallav Agarwal's avatar
Pallav Agarwal committed
130 131 132 133 134 135 136 137 138 139

<p><br /></p>

                            </div>
                        </div>
                    </div>
                </div>
                <hr /><br />
            </div>
            <div class="col-md-3 col-md-pull-7" id="recent">
Pallav Agarwal's avatar
Pallav Agarwal committed
140 141 142
                <h4>RECENT POSTS</h4>
                <ul class="nav nav-pills nav-stacked">
                    
143 144 145 146
                    <li>
                        <a href="/2016/05/06/SSH-port-forwarding-and-some-cool-uses/" class="color_change">SSH port forwarding and some cool...</a>
                    </li>
                    
147 148 149 150
                    <li>
                        <a href="/2015/12/12/Linux-commands-every-user-should-master/" class="color_change">Linux commands every user should master...</a>
                    </li>
                    
151 152 153 154
                    <li>
                        <a href="/2015/12/10/Configuration-Management-in-Linux/" class="color_change">Configuration Management in Linux</a>
                    </li>
                    
155 156 157 158
                    <li>
                        <a href="/2015/10/06/Introduction-to-Cimulator/" class="color_change">Introduction to Cimulator</a>
                    </li>
                    
Pallav Agarwal's avatar
Pallav Agarwal committed
159 160 161 162
                    <li>
                        <a href="/2015/08/24/Shared-TMUX-sessions/" class="color_change">Shared SSH sessions with TMUX -...</a>
                    </li>
                    
Pallav Agarwal's avatar
Pallav Agarwal committed
163 164 165 166
                </ul>
                <h4>RECENT TIPS</h4>
                <ul class="nav nav-pills nav-stacked">
                    
167 168 169 170
                    <li>
                        <a href="/2016/04/27/SSH-keys/" class="color_change">Easy sharing of SSH keys</a>
                    </li>
                    
171 172 173 174
                    <li>
                        <a href="/2015/08/01/SSH-from-Windows/" class="color_change">Using SSH from Windows 10 without...</a>
                    </li>
                    
Pallav Agarwal's avatar
Pallav Agarwal committed
175 176 177 178
                    <li>
                        <a href="/2015/07/27/Boost-Python-Performance/" class="color_change">Cython: Boost Python Code Performance</a>
                    </li>
                    
179 180 181 182
                    <li>
                        <a href="/2015/07/09/Wrath-of-Linux-Package-Managers/" class="color_change">Wrath of Linux Package Managers</a>
                    </li>
                    
Pallav Agarwal's avatar
Pallav Agarwal committed
183 184 185 186
                    <li>
                        <a href="/2015/07/01/Vim-Mappings/" class="color_change">Quick intro to custom Vim Mappings...</a>
                    </li>
                    
Pallav Agarwal's avatar
Pallav Agarwal committed
187
                </ul>
Pallav Agarwal's avatar
Pallav Agarwal committed
188 189
                <br />
                <br />
Pallav Agarwal's avatar
Pallav Agarwal committed
190
            </div>
Pallav Agarwal's avatar
Pallav Agarwal committed
191 192 193
            <div class="col-md-2">
            </div>
            <div class="row">
194
                <div class="col-md-7 col-md-offset-3 col-xs-10 col-xs-offset-1">
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
                    <div class="row">
                            <div class="col-xs-4">
                                <div class="fb-like" data-href="http://www.varstack.com" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
                            </div>
                            <div class="col-xs-8 text-right">
                                <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
                                <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
                                <script src="/js/SmoothScroll.js"></script>
                                <script src="/js/script.js"></script>
                                
                                <script src="/js/tips.js"></script>
                                
                                
                                <script type="text/javascript">var switchTo5x=true;</script>
                                <script type="text/javascript">stLight.options({publisher: "7839e2af-f9d1-4f68-9304-dcf13d3352ea", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
                                <span class='st_sharethis_large' displayText='ShareThis'></span>
                                <span class='st_facebook_large' displayText='Facebook'></span>
                                <span class='st_twitter_large' displayText='Tweet'></span>
                                <span class='st_googleplus_large' displayText='Google +'></span>
                                <span class='st_linkedin_large' displayText='LinkedIn'></span>
                                <span class='st_pinterest_large' displayText='Pinterest'></span>
                            </div>
                    </div>
                    <br/>
                </div>
                <div class="col-md-7 col-md-offset-3 col-xs-10 col-xs-offset-1">
                    <div id="disqus_thread"></div>
                    <script type="text/javascript" async>
Pallav Agarwal's avatar
Pallav Agarwal committed
223 224 225 226 227 228 229 230 231
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'varstack';

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
    var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
    dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
Pallav Agarwal's avatar
Pallav Agarwal committed
232 233 234 235 236 237 238
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-21768487-2', 'auto');
ga('send', 'pageview');
239 240 241
                    </script>
                    <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js" async></script>
                    <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
Pallav Agarwal's avatar
Pallav Agarwal committed
242
                </div>
Pallav Agarwal's avatar
Pallav Agarwal committed
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265
            </div>
        </div>
    </div>


    <div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span>
                        <span class="sr-only">Close</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        Image Preview
                    </h4>
                </div>
                <div class="modal-body">
                    <img src="" id="imagepreview" style="max-height: 100%; max-width: 100%;">
                </div>
            </div>
        </div>
    </div>