rake -T -A
Run from your Rails home directory to see all the tasks that rake knows about. Yours must be in that list for rake to run it.- http://stackoverflow.com/questions/12409544/how-to-disable-rack-mini-profiler-temporarily
- run rails in production mode lacaly:
bundle exec rake assets:clean && bundle exec rake assets:precompile && bundle exec rails s -e production_local
- bundle exec rake konacha:serve
rake time:zones:all
- all available time zones
- Reset all changes after last commit in git First reset the changes
git reset HEAD --hard
then clean out everything untrackedgit clean -fd
- Removing multiple files from a Git repo that have already been deleted from disk
git ls-files --deleted -z | xargs -0 git rm
- Pull A Git Branch from Remote http://www.wetware.co.nz/2009/07/pull-a-git-branch-from-remote/
- Multiple GitHub Accounts & SSH Config http://stackoverflow.com/questions/3225862/multiple-github-accounts-ssh-config
- get a list of git branches
git for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit - Force Git to overwrite local files on pull http://stackoverflow.com/questions/1125968/force-git-to-overwrite-local-files-on-pull
- Git Clean: Delete Already-Merged Branches http://stevenharman.net/git-clean-delete-already-merged-branches
- remove untracked files
git clean -f -n
http://stackoverflow.com/questions/61212/how-do-i-remove-local-untracked-files-from-my-current-git-branch - Stop tracking changes in file
git update-index --assume-unchanged <file-name>
http://stackoverflow.com/questions/936249/how-to-stop-tracking-and-ignore-changes-to-a-file-in-git
- Prettier, user friendly printing of Ruby objects to_yaml http://vitobotta.com/prettier-more-user-friendly-printing-ruby-objects/#sthash.qWy59q5T.dpbs
- start simple http server
ruby -run -ehttpd . -p8000
sudo apt-get update
. Install pg and dependenciessudo apt-get install postgresql postgresql-contrib libpq-dev
- chnage config file
subl /etc/postgresql/9.4/main/pg_hba.conf
to grant full access
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
- Create super user role in psql (same login as in system):
$ psql -U postgres
postgres=# create role obliviusm with login encrypted password 'pass';
postgres=# \du
postgres=# alter role obliviusm with superuser;
- PostgreSQL add or create a user account and grant permission for database http://www.cyberciti.biz/faq/howto-add-postgresql-user-account/
- PostgreSQL - creating and dropping roles http://articles.slicehost.com/2009/5/7/postgresql-creating-and-deleting-roles
- Trying to set up postgres for ror app
fe_sendauth: no password supplied
http://stackoverflow.com/questions/12452073/trying-to-set-up-postgres-for-ror-app-getting-error-fe-sendauth-no-password - If database is locked by another process just restart the server:
sudo service postgresql restart
- Instruction https://gist.github.com/operatino/392614486ce4421063b9dece4dfe6c21
- Commands:
brew install mysql@5.7
,brew link mysql@5.7 --force
- mysql -uroot
- sudo killall mysqld
- Convert Photoshop Drop Shadows to CSS3 Box & Text Shadows http://www.melanieceraso.com/psd-to-css3/#sthash.D3ElzRJT.Y0bLVC0L.dpbs
- http://cheat.errtheblog.com/s/rvm
- error setting certificate verify locations http://stackoverflow.com/questions/3160909/how-do-i-deal-with-certificates-using-curl-while-trying-to-access-an-https-url
- show last pushes to heroku
heroku releases -a hengage-staging
- capybara webkit build error: thoughtbot/capybara-webkit#846
sudo apt-get install
libqt5webkit5-dev, http://stackoverflow.com/questions/23703864/cmake-not-working-could-not-exec-qmakesudo apt-get install qt-sdk
- coffee rails error:
sudo apt-get install nodejs
- recursively delete all files of a specific extension in the current directory:
find . -name "*.lnk" -type f -delete
. Show list first:find . -name "*.lnk" -type f
- load constants
source .env
- Show all files (hidden too) with sizes
du -sch .[!.]* * |sort -h
orfind . -maxdepth 1 -mindepth 1 -type d -exec du -hs {} \;
- expose localhost to the internet
./ngrok http 3000
. resultForwarding http://1170cb30.ngrok.io -> localhost:3000
- find pid that uses port 9292
lsof -wni tcp:9292
ls -ltr
show list of files with dates sorted by modified date- my internal ip address
ip route get 8.8.8.8 | awk '{print $NF; exit}'
- open folder in GUI from terminal:
gnome-open .
- send dummy mail:
ActionMailer::Base.mail(
from: "info@tutor24.ch",
to: "lucí@hotmail.com <ms@rademade.com>",
subject: "Test",
body: "Test"
).deliver_later
- cannot stop container permission denied ubuntu:
sudo aa-status
sudo systemctl disable apparmor.service --now
sudo service apparmor teardown
sudo aa-status
docker-compose down
sudo systemctl enable apparmor.service --now
https://forums.docker.com/t/can-not-stop-docker-container-permission-denied-error/41142/6