Saturday, January 21, 2017

intellij idea setting java language level to 8

Project Settings -> Modules -> Sources -> Language level : 8
Project Settings -> Project -> Project SDK -> 1.8
Project Settings -> Project -> Project Language Level -> 8
File > Settings > Build, Execution, Deployment > Java Compiler >
Project Bytecode version -> 1.8
File > Settings > Build, Execution, Deployment > Java Compiler > Per
module Bytecode version -> 1.8

Friday, January 20, 2017

today's summary

select/poll/epoll used by memcached/redis/nodejs/golang
epoll is latest and linux only.
30% of world's computers are still Windows XP.

nodejs vs golang async
golang - goroutines on top of OS threads, proud to be blocking (goroutine will take care of that), goroutines are cheap
nodejs - single threaded, use callback else it will be blocked

websocket server - Golang is the right compro, perf less than C++ but code much simpler. Nodejs far behind.

In GoLang - you can use utf-8 characters as var names

redis and tiles38 for geospatial data
tiles38 has replication as well and uses Redis RESP protocol

Thursday, January 19, 2017

nginx setup amazon linux

tar -xvzf nginx-1.11.8.tar.gz
cd nginx-1.11.8
./configure --sbin-path=/usr/local/sbin --with-http_ssl_module
make
make install


vim /usr/local/nginx/conf/nginx.conf

Add the following to server section:
   listen       80;
        server_name  domain.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root  /var/www/html/folder;
            index  index.php index.html index.htm;
        }
        location ~ \.php$ {
                fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  /var/www/html/folder$fastcgi_script_name;
                include        fastcgi_params;
        }




nginx(simple to start) or /usr/local/sbin/nginx
nginx -s stop

sudo yum install php56-fpm
nginx -t to locate config file
service php-fpm start/stop/restart
vim  /etc/php-fpm.d/www.conf -> change user and group
vim /etc/php-fpm.conf

summing memory used on linux

 ps aux --sort rss | awk '{sum+=$5;print $5,sum}'
for RSS
 ps aux --sort rss | awk '{sum+=$4;print $4,sum}'
for VSZ

Blog Archive