Tuesday, May 24, 2016

git

git diff
git diff --cached
git l --name-only
git status -s
git reflog expire --all --expire=now
git prune --dry-run
git fsck --unreachable

bare
non bare
clean dirty

staged

Monday, May 2, 2016

Go race conditions

A data race occurs whenever two goroutines access the same variable concurrently and at least one of the accesses is a write.It follows from this definition that there are three ways to avoid adata race.

The first way is not to write the variable - load it beforehand and only give read access.

The second way to avoid a data race is to avoid accessing the variable from multiple goroutines - a monitor goroutine which selects on multiple channels.

Even when a variable cannot be confined to a single goroutine for its entire lifetime, confinement may still be a solution to the problem of concurrent access.For example, it's common to share a variable between goroutines in a pipeline by passing its address from one stage to the next over a channel.If each stage of the pipeline refrains from accessing the variable after sending it to the next stage, then all accesses to the variable are sequential.




Monday, April 25, 2016

installing ssl certificate/enabling https on apache,amazon linux with letsencrypt

yum install mod24_ssl openssl
cd letsencrypt/
./letsencrypt-auto --debug certonly --webroot -w /var/www/html/abc -d www.abc.com

Edit httpd.conf

<IfModule mod_ssl.c>
    Listen 443
</IfModule>

<VirtualHost *:443>
        SSLEngine on
        SSLCertificateFile /etc/letsencrypt/live/www.abc.com/cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/www.abc.com/privkey.pem
        SSLCertificateChainFile /etc/letsencrypt/live/www.abc.com/fullchain.pem
        <Directory "/var/www/html/abc">
                Options Indexes FollowSymLinks
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
        DocumentRoot "/var/www/html/abc"
        ServerName www.abc.com
</VirtualHost>

service httpd restart

Blog Archive