Just a little git hook to sync password repositories.
This file supports my YouTube video, which lives here: https://youtu.be/2Ji7Ph8atus
#! /bin/bash | |
# dunstctl set-paused false | |
send_current() { | |
TODAY=$(date '+%-d') | |
month=$(ncal -bhMw) | |
BODY=$( tail -n7 <<< $month | sed "s/| /▕ /" | sed -z "s/ \($TODAY\) /<span bgcolor='white' color='black'> \1 <\/span>/1" | sed "s/\(.*\)\(.\{8\}\)$/\1<span color='IndianRed'>\2<\/span>/") | |
HEAD=$(echo "$month" | head -n1) | |
notify-send -a 'calendar' \ |
Just a little git hook to sync password repositories.
This file supports my YouTube video, which lives here: https://youtu.be/2Ji7Ph8atus
$ ssh [email protected]
$ mkdir test
$ cd test
#!/usr/bin/env python | |
import sys | |
import subprocess | |
diff_requirements = 'git diff ORIG_HEAD HEAD --exit-code -- requirements.txt' | |
exit_code = subprocess.call(diff_requirements.split()) | |
if exit_code == 1: | |
print 'The requirements file has changed! Remember to install new dependencies.' | |
else: |
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
<?php | |
function require_auth() { | |
$AUTH_USER = 'admin'; | |
$AUTH_PASS = 'admin'; | |
header('Cache-Control: no-cache, must-revalidate, max-age=0'); | |
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW'])); | |
$is_not_authenticated = ( | |
!$has_supplied_credentials || | |
$_SERVER['PHP_AUTH_USER'] != $AUTH_USER || | |
$_SERVER['PHP_AUTH_PW'] != $AUTH_PASS |
Sources: http://stackoverflow.com/questions/1753070/git-ignore-files-only-locally
The .git/info/exclude file has the same format as any .gitignore file. Another option is to set core.excludesFile to the name of a file containing global patterns.
Note, if you already have unstaged changes you must run the following after editing your ignore-patterns:
git update-index --assume-unchanged [<file>...]
Note on $GIT_DIR: This is a notation used all over the git manual simply to indicate the path to the git repository. If the environment variable is set, then it will override the location of whichever repo you're in, which probably isn't what you want.