Skip to main content

Posts

Redis & nginx configuration for websocket/actionCable

Start redis server => redis-server redis console => redis-cli view available databases => config get databases pubsub channels global* pubsub channels global_notification_2 pubsub channels global_notification pubsub channels * => Lists all the available channels pubsub numsub global_notification_2 => returns the number of subscribers From unix command line directly redis-cli PUBSUB CHANNELS redis-cli PUBSUB NUMSUB global_notification_2 [root@api prod-openmednet-api]# redis-cli PUBSUB CHANNELS 1) "_action_cable_internal" 2) "global_notification_2" [root@api prod-openmednet-api]# redis-cli PUBSUB CHANNELS global_notification_2 1) "global_notification_2" [root@api prod-openmednet-api]# redis-cli PUBSUB NUMSUB global_notification_2 1) "global_notification_2" 2) (integer) 2 NGINX configuration:  worker_processes   auto; worker_rlimit_nofile 500000;  #=> refer RLIM
Recent posts

Mac stuffs

vi command description 0 move to beginning of the current line $ move to end of line H move to the top of the current window (high) M move to the middle of the current window (middle) L move to the bottom line of the current window (low) 1G move to the first line of the file 20G move to the 20th line of the file G move to the last line of the file

Postgres points

Export sql data to file copy (select * from table-name) to '/tmp/cta.pl.list' in root dnf install postgresql-server postgresql-devel service postgresql start mkdir /home/pgdir chown postgres:postgres /home/pgdir -R chmod 777 /home/pgdir -R  su postgres initdb -D /home/pgdir pg_ctl -D /home/pgdir -l /home/pgdir/log start 

Sublime

1. Accessing remote files in sublime ssh -R 52698:localhost:52698 root@192.xxx.xxx.xxx => run this command in local  root@192.xxx.xxx.xxx  - it is the target remote ip from where you are referring the file to edit in local Install remote sublime at remote server curl -o /usr/local/bin/rmate https://raw.githubusercontent.com/aurora/rmate/master/rmate sudo chmod +x /usr/local/bin/rmate rmate filename

Linux/Unix useful commands

Find count of files in a folder ls -l /san1/home/ports/Quest/QuestHL7incoming/new/prod/comite_part1_2xx/ | wc -l Enable/Disable firewall CentOS V < 7 service iptables list service iptables start service iptables stop CentOS V >= 7 Status: systemctl status firewalld   Start: systemctl start firewalld   Stop: systemctl stop firewalld   Login to a server without password run  ssh-keygen from source machine will create key stored at  ~/.ssh/id_rsa.pub copy the code alone and paste in the destination server > autorised_keys  /root/.ssh/authorized_keys => if not exists in the destination server, you can create it

UNIX - Process/Jobs

Playing the commands fg , ctrl+z , bg and jobs In this post I would like to share few basic process or job specific tricks in UNIX. 1. If you want to run a process in bacground just add a & as suffix with a space  Eg: [root@localhost kannan]# ruby test.rb & here this process test.rb will run in background  2. If you want list available background tasks/processes/jobs , just use the command 'jobs' Eg: [root@localhost kannan]# jobs here the result would be  [1]+ Running ruby test.rb  3. If you want to bring a background process in front (foreground) just use fg [#<job number>] Eg [root@localhost kannan]# fg #1  It will bring the above 'ruby test.rb' process in front. 4. If you want to again move a already running process to background , use two combination of commands     a. First pass Ctrl+Z , here you will get a message like 'stopped' don't get upset, it will just suspend