Skip to content

Instantly share code, notes, and snippets.

View rusllonrails's full-sized avatar
💭
👨‍💻 💻 🖱️ 🍻 🏋️‍♂️

rusllonrails rusllonrails

💭
👨‍💻 💻 🖱️ 🍻 🏋️‍♂️
  • Tbilisi, Georgia
View GitHub Profile
@rusllonrails
rusllonrails / POSTGRESQL JSONB BEST TUTORIALS
Last active October 10, 2021 04:52
POSTGRESQL JSONB BEST TUTORIALS
MIKE WANT US TO CARE ABOUT:
1) INDEXES
http://blog.2ndquadrant.com/jsonb-type-performance-postgresql-9-4/
2) TRY TO USE VIEW ON SIMPLE SEARCH
http://www.postgresql.org/docs/9.3/static/rules-materializedviews.html
GUIDES
1) http://schinckel.net/2014/05/25/querying-json-in-postgres/
@rusllonrails
rusllonrails / Ubuntu 15.04 Couchdb db issue with running
Created May 29, 2015 12:24
Ubuntu 15.04 Couchdb db issue with running
1) you can then run your change owner command
```
sudo chown -R couchdb /var/run/couchdb
```
2) Start couchdb
```
$ sudo -i -u couchdb couchdb -b
1) see the list of opened ports
```
$ netstat -ntlp | grep LISTEN
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN -
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:5433 0.0.0.0:* LISTEN -
@rusllonrails
rusllonrails / ALLOW TO REBOOT TO NON ROOT USER
Created May 26, 2015 15:42
ALLOW TO REBOOT TO NON ROOT USER
nano /etc/sudoers.d/<you user name>
Adding the line below to that file, assume mysurface is the user that allow to shutdown without password.
```
mysurface ALL = NOPASSWD: /sbin/shutdown
```
For ubuntu, usually the default user is in the %admin group. Therefore, you can also allow all users from the %admin group to shutdown without password.
```
%admin ALL = NOPASSWD: /sbin/shutdown
@rusllonrails
rusllonrails / USEFULL CRON COMMANDS
Created May 26, 2015 09:09
USEFULL CRON COMMANDS
crontab -l view list of cron commands
crontab -r remove cron commands
crontab -e edit cron commands
whenever:
```
every :day, at: '00:05am' do
# here your reboot
end
```
@rusllonrails
rusllonrails / USEFULL CSS SERVICES
Last active August 29, 2015 14:20
USEFULL CSS SERVICES
http://preloaders.net/en
http://loading.io/
http://border-radius.com/
http://www.iconarchive.com
http://cssarrowplease.com/
http://apps.eky.hk/css-triangle-generator/
http://fortawesome.github.io/Font-Awesome/icons/
Online addition of text blocks plugin
http://fancyproductdesigner.com/jquery/
@rusllonrails
rusllonrails / FIND FIRST 100 lines with grepped keyword in log
Created March 3, 2015 10:58
FIND FIRST 100 lines with grepped keyword in log
head -100 log/nginx.error.log | grep "failed"
@rusllonrails
rusllonrails / RSPEC REDUCE LOGGING
Created January 28, 2015 08:58
RSPEC REDUCE LOGGING
to spec/spec_helper.rb (or rails_helper.rb)
ActiveRecord::Base.logger.level = 2
@rusllonrails
rusllonrails / RBENV UPGRADE
Created January 26, 2015 12:47
RBENV UPGRADE
1) RBENV UPGRADE
cd ~/.rbenv
git checkout master
git pull origin master
2) RUBY_BUILD UPDATE
cd ~/.rbenv/plugins/ruby-build
git checkout master
git pull origin master
@rusllonrails
rusllonrails / git bower 128
Created January 22, 2015 11:45
GIT Problem with fetching by git:// Git / Bower Errors: Exit Code # 128 & Failed connect
git config --global url."https://".insteadOf git://