Technical Recipes
If you need to display how many memory are using your commands running on a machine, you can execute the following command:
$ ps -u arturo -o rss,comm
arturo should be replaced for your current user. RSS means Resident Set Size and it shows the physical memory used by the process in kilobytes (kB).
Usually you need to get upstream changes to your forked repo. To do that, just execute these lines:
$ git fetch upstream $ git merge upstream/master
First line gets changes for upstream and second one merge these changes into your forked repository.
Just add the following lines to your nginx.conf file:
location /mydirectory { auth_basic "Restricted"; auth_basic_user_file htpasswd; }
The htpasswd could be create with the following command:
$ htpasswd -c htpasswd myuser
To see how to do that with Apache take a look here.
Sometimes it's very useful to protect a web directory with user/password. Apache web server offers us a simple method to do that based on HTTP basic authentication. We need to create a specific file called .htpasswd, then our conf. file should be changed for adding the protection. Let's do it:
$ htpasswd -c .htpasswd myuser
The previous command will create a new file called .htpasswd. This file should be located inside the directory which will be protected. Then we need to change our Apache's conf. file adding these lines:
<Location /mydirectory> AuthUserFile /home/myuser/mydirectory/.htpasswd AuthName "Protected area" AuthType Basic require valid-user </Location>
When a user access to protected directory Apache will display a dialog box asking for user/passwd.
Tags
My latest tweets
Improving programmers productivity http://t.co/0TVRcQD0
Comparing PHP vs Python vs Ruby http://t.co/gnziQuWd
Last toy http://t.co/7FgJSzoY
Learning a lot from @codeschool. I've just paid for a subscription. Well done!
Choosing Django Hosting provider http://t.co/6PWLApEK
Google is starting to use github http://t.co/jBvN0ehK




