sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
#/bin/bash | |
git config --global alias.pushall '!git remote | xargs -L1 git push --all' |
#!/usr/bin/env bash | |
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done | |
git fetch --all | |
git pull --all |
namespace :deploy do | |
desc "reload the database with seed data" | |
task :seed do | |
on roles(:all) do | |
within current_path do | |
execute :bundle, :exec, 'rails', 'db:seed', 'RAILS_ENV=production' | |
end | |
end | |
end | |
end |
The connection failed because by default psql
connects over UNIX sockets using peer
authentication, that requires the current UNIX user to have the same user name as psql
. So you will have to create the UNIX user postgres
and then login as postgres
or use sudo -u postgres psql database-name
for accessing the database (and psql
should not ask for a password).
If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres
(as pointed out by @meyerson answer) will solve your immediate problem.
But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf
* line:
from
# http://webapps.stackexchange.com/questions/39587/view-estimated-size-of-github-repository-before-cloning | |
# tested on macOS | |
echo https://github.com/torvalds/linux.git | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:\.git)?$!' | xargs -I{} curl -s -k https://api.github.com/repos/'{}' | grep size | |
# output: | |
# "size": 1746294, |
//Import Statements | |
public class ActivityName extends AppCompatActivity { | |
private RecyclerView mRecyclerView; | |
private RecyclerView.Adapter mAdapter; | |
private RecyclerView.LayoutManager mLayoutManager; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
How to have some fun using the terminal.
sudo apt-get install cowsay
sudo apt-get install fortune
sudo apt-get install figlet
ruby -v
gem install lolcat
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |