This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def res params | |
begin | |
# do something | |
Rails.logger.info "debug #{Time.now.to_datetime}" | |
Rails.logger.info params | |
rescue Exception => e | |
Rails.logger.info "debug_Exception #{Time.now.to_datetime}" | |
Rails.logger.info e.message | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sshpass -p "PaSSwOrD" rsync -avz -e 'ssh -p 222' /home/user/projects/local/ admin@144.444.444.444:/var/www/public/ --ignore-errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) | |
# E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it? | |
sudo lsof /var/lib/dpkg/lock | |
sudo kill -9 <PID> && sudo dpkg --configure -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'rack-cors' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $END$ - куди поставити курсор | |
console.log('', $END$); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WAY 1 | |
url = 'https://www.example.com/post/hello-world' | |
subdomain = 'blog' | |
index = url.index('://www.') ? url.index('://www.') + 7 : url.index('://') + 3 | |
url.insert(index, subdomain + '.') | |
p url | |
# WAY 2 | |
url = 'https://www.example.com/post/hello-world' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Applications | |
/usr/share/applications/ | |
Default aplications list | |
/etc/gnome/defaults.list | |
Sublime text exec | |
/snap/sublime-text/current/opt/sublime_text/sublime_text | |
/opt/sublime_text/sublime_text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = true | |
b = false | |
# if one of variable false run exception | |
if !a or !b | |
p 'ERROR 1' # + | |
end | |
unless a or b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run command by time interval | |
watch -n 60 index.sh | |
# Find file on disk | |
find / -name "myfile" | |
find / -name "%myfile%" | |
# Script output to file | |
ls > log.txt | |
ls >> log.txt # don't rewrite file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkill -o chrome && pkill -o chromium |
OlderNewer