Linux: Kill process running on Port
sudo fuser -k 80/tcp
Related cards:
Sidekiq: Start the sidekiq process
bundle exec sidekiq -e staging -d -L log/sidekiq.log
sidekiq -h
-c, –concurrency INT processor threads to use
-d, –daemon Daemonize process
-e, –environment ENV...
Nginx: Restart
IF YOU HAVE init.d
sudo /etc/init.d/nginx restart
/etc/init.d/nginx: location of nginx startup script
IF YOU DO NOT HAVE init.d
service nginx restart
/opt/nginx variety:
sudo kill $(cat /opt/nginx/log...
Linux: Compress and Archive Directory
tar -zcvf archive-name.tar.gz directory-name
The resulting .tar.gz file is actually the product of two different things, tar basically just packages a group of files into a single file bundle but doesn’t offer compression on it’s own, thus t...
Ruby on Rails: Start Unicorn service
unicorn_rails -c config/unicorn.rb -D -E staging
-D flag: Start as daemon process (i.e. in background.)
-c flag: config file
-E flag: environment to run in
Linux: Create new user with root privileges
-
Create the user
$ adduser user_name
-
Give root privileges
$ visudo
Add user to privileges
user_name ALL=(ALL:ALL) ALL
Linux: Primary vs Secondary Groups
In /etc/passwd you'll see a primary group assigned to each user like this:
Code:
john:x:1001:1001:John:/home/john:/bin/bash
User "john" here has uid 1001 and his primary group is also 1001. When john creates files, they will be owned by john...