Skip to content

Latest commit

 

History

History
106 lines (67 loc) · 2 KB

File metadata and controls

106 lines (67 loc) · 2 KB

##Linux

Cron job to trigger daily notificaitons from rails

# Put this line in the crontab -e file.
00 11 * * * (curl http://example.com/api/v1/TriggerNotification -H 'Authorization: Token token="api_token_goes_here"';echo) >> ~/logs/cron_jobs/notification.log

Remove all .svn folders in a project folder

# Execute this from the project folder
$ rm -rf `find . -type d -name .svn`

Tail command

# Check the last lines of the file
$ tail production.log

# Live output
$ tail -f production.log

Ubuntu system wide environment variable.

# Put below line in the environment file.
$ vi /etc/environment

GREEN_QUIZYY_HOST="green.quizyy.com"

Note: Safest way to activate this change is to log out and login.

Mac OS X Rails ENV variable.

# Put below line in the .bash_profile file.
$ vi ~/.bash_profile

export GREEN_QUIZYY_HOST="green.quizyy.com"

# Reload bash_profile
. ~/.bash_profile

Change default kernel version for Ubuntu grub

https://help.ubuntu.com/community/Grub2/Submenus

$ sudo update-grub

$ grep menuentry /boot/grub/grub.cfg

$ sudo vim /etc/default/grub

# Set the required entry fetched from grub.cfg as default in /etc/default/grub
# use > for sub-menu entry
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 3.5.0-25-generic"

$ sudo update-grub

# Changes are reflected in the file /boot/grub/grub.cfg

Show grub menu by default

https://help.ubuntu.com/community/Grub2#Hidden

Comment out below lines from /etc/default/grub

#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true

Check currently running kernel version

$ uname -a

or

$ uname -r

Unicorn zombiee process

# List PID's
$ lsof /tmp/my_app.socket

# Kill
$ kill -9 pid

# If above steps don't work, try this.
$ ps aux | grep unicorn