h - Move left
j - Move down
k - Move up
l - Move right
$ - Move to end of line
0 - Move to beginning of line (including whitespace)
#!/bin/bash | |
# | |
# Convert ssh-agent output to fish shell | |
# | |
eval "$(ssh-agent)" >/dev/null | |
echo "set SSH_AUTH_SOCK \"$SSH_AUTH_SOCK\"; export SSH_AUTH_SOCK" | |
echo "set SSH_AGENT_PID \"$SSH_AGENT_PID\"; export SSH_AGENT_PID" |
""""""""""""""""""""""""""""""""""""" | |
" Lorenzo Sinisi Vimrc configuration | |
""""""""""""""""""""""""""""""""""""" | |
set nocompatible | |
syntax on | |
set nowrap | |
set ignorecase | |
set smartcase | |
set encoding=utf8 | |
set mouse=nicr |
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
void setup() { | |
Serial.begin(57600); | |
for(int i = 2; i <= 10; i+=2){ | |
pinMode(i, OUTPUT); | |
} | |
} | |
void loop() { | |
String s = ""; |
tail -f faltas_suplencias.log | awk ' | |
/info/ {print "\033[32m" $0 "\033[39m"} | |
/debug/ {print "\033[34m" $0 "\033[39m"} | |
/warn/ {print "\033[33m" $0 "\033[39m"} | |
/error/ {print "\033[31m" $0 "\033[39m"} | |
' | |
tail -f ecto_sql.log | awk ' | |
/SELECT/ {print "\033[32m" $0 "\033[39m"} | |
/debug/ {print "\033[32m" $0 "\033[39m"} |
El siguiente es un ejercicio para codificar, refactorizar y hacer pruebas, en el cual puedes invertir de 15 a 30 minutos para resolverlo gradualmente.
- Intenta no adelantar la lectura.
- Realiza una tarea a la vez. El truco para aprender es el trabajo incremental.
- Asegurate de hacer las pruebas para las entradas correctas. No hay necesidad de probar entradas inválidas.
- De vez en cuando haz un refactor de tu código.
#include <stdio.h> | |
void guess(int n, int low, int upper){ | |
int guess_number = (upper + low) / 2; | |
if(guess_number < n){ | |
printf("Tu número no es %d\n", guess_number); | |
guess(n, guess_number, upper); | |
} | |
if(guess_number > n){ | |
printf("Tu número no es %d\n", guess_number); |
# migrating from https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh | |
# Aliases | |
alias g='git' | |
#compdef g=git | |
alias gst='git status' | |
#compdef _git gst=git-status | |
alias gd='git diff' | |
#compdef _git gd=git-diff | |
alias gdc='git diff --cached' |