- show where installed gem through source is:
bundle show spree- use more cores when running bundle https://coderwall.com/p/xplpua
bundle config --global jobs 4- uninstall all gems that includes spree in their name
eval $(gem list | grep spree | awk '{ print "gem uninstall " $1}')- uninstall all gems
for i in `gem list --no-versions`; do gem uninstall -aIx $i; done- run ruby http server from current directory
ruby -run -e httpd . -p5000- find unique lines in file
sort <file> | uniq -c- find files that matches name and remove them
find . -name "desktop.ini" -exec rm {} \;- find all files with .rb extension and convert newlines from dos to unix style (CRLF => LF)
find project/path -name '*.rb' -exec dos2unix {} +Postgres/MySqlsearch by columns or tables
select * from information_schema.columns
where column_name like '%column_name%'
and table_name like '%table_name%'
and table_schema = 'schema_name';MySqlfind on which table has which indexes: source
SELECT table_name AS `Table`,
index_name AS `Index`,
GROUP_CONCAT(column_name ORDER BY seq_in_index) AS `Columns`
FROM information_schema.statistics
WHERE table_schema = 'your_db_name'
GROUP BY 1,2;Set mysql user's password
mysqladmin -u root password NEWPASSWORD
Allow connections to postgres
sudo vim /etc/postgresql/9.3/main/pg_hba.confadd a line host all all 192.168.156.1/24 md5
with correct IP.
sudo vim /etc/postgresql/9.3/main/postgresql.confSearch for listen_address and set it to '*'.
sudo service postgresql restartAllow connections to MySQL
mysql -uroot -proot
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.56.1' IDENTIFIED BY 'root' WITH GRANT OPTION;
\qEdit: my.cnf
sudo vim /etc/mysql/my.cnf
# Change `bind-address = 127.0.0.1` to `#bind-address = 127.0.0.1`
sudo service mysql stop
sudo service mysql start- checkout jquery version
$.fn.jquery- remove remote branch
git push origin --delete <branchName>- remove remote tag
git tag -d v1.0.1
git push origin :refs/tags/v1.0.1- set/check how newline setting is defined for git
git config --global core.autocrlf input- move recent commits into new branch
git branch newbranch
git reset --hard HEAD~3 # Go back 3 commits. You *will* lose uncommitted work.
git checkout newbranch- list open ports on machine
sudo lsof -i -P | grep -i "listen"