- Access the developer console https://console.developers.google.com
- Create a new project
- In APIs and Oauth section:
a. In APIs section - enable gmail api
b. In Credentials section -
1. Click Create new client ID
2. Fill email and project name
3. Save
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eo pipefail | |
host="$(hostname --ip-address || echo '127.0.0.1')" | |
user="${POSTGRES_USER:-postgres}" | |
db="${POSTGRES_DB:-$POSTGRES_USER}" | |
export PGPASSWORD="${POSTGRES_PASSWORD:-}" | |
args=( | |
# force postgres to not use the local unix socket (test "external" connectibility) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table town(id, label); | |
create table road(id, start_town_id, end_town_id); | |
create table travel(id, road_id); | |
-- I want all town, both start and end | |
select | |
unnest(array[start_town_id, end_town_id]) | |
from travel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set imap_user="[email protected]" | |
set imap_pass=`/usr/bin/security find-generic-password -w -a '[email protected]' -s 'Gmail'` | |
set folder=imaps://imap.gmail.com/ | |
set spoolfile=+INBOX | |
set record="+[Gmail]/Sent Mail" | |
set postponed="+[Gmail]/Drafts" | |
# https://www.neomutt.org/guide/reference search sleep_time for additional info | |
set sleep_time=0 # be faster |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.postgres.search import SearchQuery, SearchVector | |
combined_search_queries = SearchQuery('test') | |
for _ in range(200): | |
combined_search_queries |= SearchQuery('test') | |
print(combined_search_queries) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
for service in $(docker service ls|awk -v N=2 '{print $N}') | |
do | |
echo "Rebalance $service" | |
docker service update --force $service | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{Visual}["x]x or *v_x* *v_d* *v_<Del>* | |
{Visual}["x]d or | |
{Visual}["x]<Del> Delete the highlighted text [into register x] (for | |
{Visual} see |Visual-mode|). |
We will test logical replication between db with different version and locale
- db1 : 9.6 and en_US.UTF-8
- db2 : 10.3 and C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
COALESCE(blockingl.relation::regclass::text,blockingl.locktype) as locked_item, | |
now() - blockeda.query_start AS waiting_duration, | |
blockeda.pid AS blocked_pid, | |
blockeda.query as blocked_query, blockedl.mode as blocked_mode, | |
blockinga.pid AS blocking_pid, blockinga.query as blocking_query, | |
blockingl.mode as blocking_mode | |
FROM pg_catalog.pg_locks blockedl | |
JOIN pg_stat_activity blockeda ON blockedl.pid = blockeda.pid | |
JOIN pg_catalog.pg_locks blockingl ON( |
NewerOlder