Skip to content

Instantly share code, notes, and snippets.

View malkab's full-sized avatar

Juan Pedro Pérez Alcántara malkab

  • Sunntics Ltd.
  • Seville, Andalusia (Spain)
View GitHub Profile
@malkab
malkab / gpg_pgp_gnupg2.md
Last active February 7, 2023 08:58
GPG, PGP, and GNUPG2 (already in Logseq)

GPG, PGP, and GNUPG2

Encryption and how to read and write it with GPG.

Installation of Keys

In most cases is just a matter of copying the ~/.gnupg folder. Check available keys with commands explained below.

Owner of folder .gnupg and its contents must be the user. Folder permissions must be 700, and permissions for file gpg.conf must be 600.

@malkab
malkab / postgresql-copy_from_copy_to.md
Last active October 12, 2022 19:06
PostgreSQL - copy from / copy to

Copy To and Copy From

Copy is a command and a psql metacommand to import data into a PostgreSQL:

-- Tables
\copy test_data.test from sigwx.csv with delimiter '|' csv delimiter E'\t' header quote '"' encoding 'utf-8' null '-'

\copy test_data.test to sigwx.csv with delimiter '|' csv header quote '"' encoding 'utf-8' null '-'
@malkab
malkab / git-branches.sh
Last active September 29, 2022 11:17
Git - Branches
# Fetch remote branches info
git fetch -av
# Check a branch from a remote and track it
git checkout -t origin/remote-branch-name
# To change the name of the local branch on checkout (not recommended)
git checkout -b local-branch-name origin/remote-branch-name
# Delete remote branches (and their local counterpart)
@malkab
malkab / docker_compose_for_postgresql.yaml
Last active September 15, 2022 10:44
Docker Compose for PostgreSQL
version: '3.5'
networks:
sunnsaas:
external: false
name: network_name
attachable: true
volumes:
phd-data-postgis:
@malkab
malkab / compose-basic.yaml
Last active September 15, 2022 10:44
Docker Recipes
version: '3.5'
networks:
carto_bcn:
external: false
name: carto_bcn
attachable: true
services:
postgis:
@malkab
malkab / testing_observables_with_mocha.ts
Last active July 23, 2022 22:20
Testing Observables with Mocha
import "mocha";
import * as rx from "rxjs";
import * as rxo from "rxjs/operators";
import { expect } from "chai";
/**
@malkab
malkab / docker-basic_node_run.sh
Last active July 23, 2022 14:35
Docker - Basic Node Run
#!/bin/bash
# -----------------------------------------------------------------
#
# Runs an interactive Node container.
#
# -----------------------------------------------------------------
docker run -ti --rm \
--name libwk32_node_dev \
--hostname libwk32_node_dev \
@malkab
malkab / visual_studio_code_linux_configuration_key_bindings.md
Last active July 21, 2022 15:13
Visual Studio Code: Configuration & Key Bindings

Visual Studio Code - Linux Key Bindings

Key:

  • C: Control
  • S: Shift

Environment Navigation Shortcuts

| Action | Key |

@malkab
malkab / ubuntu_network_manager_manual_network_config.md
Last active July 7, 2022 22:32
Ubuntu Network Manager & Manual Network Configuration

Ubuntu Network Manager & Manual Network Configuration

In case the Network Manager needs to be disabled and the network manually configured, follow this procedures.

Drop the Network Manager:

service network-manager stop
@malkab
malkab / grass_docker_examples.sh
Last active June 23, 2022 11:41
GRASS Docker Examples
#!/bin/bash
# -----------------
#
# The GRASS Docker image is the main geo processing hub. It contains
# GDAL, GRASS, PostgreSQL for interfacing with PostGIS containers,
# Python, Node, etc.
#
# -----------------