Here's a record of my experiences when setting up Void Linux for the first time, maybe it contains useful information for somebody :-)
- Laptop: Lenovo IdeaPad S340
- Void Linux installer version: 20191109 (x86_64 musl)
Here's a record of my experiences when setting up Void Linux for the first time, maybe it contains useful information for somebody :-)
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
0. Check keyboard layout on /etc/rc.conf | |
set KEYMAP="es" and TIMEZONE="Europe/Madrid" | |
1. Update all package system | |
sudo xbps-install -Suv | |
2. add non-free repo | |
sudo xbps-install -Rs void-repo-nonfree | |
3. Software & utilities |
#!/bin/ksh | |
# Since OpenBSD does not have sockstat this script parses the output | |
# of fstat to print a summary indicating which process is listening on which port | |
fstat | awk ' | |
BEGIN { | |
OFS="\t"; | |
} | |
{ |
import time | |
import sys | |
import os | |
def fai_cousas(): | |
# Fai cousas durante 10 segundos e logo sae | |
time.sleep(10) | |
print("Feito") | |
sys.exit(0) |
Source: https://wiki.archlinux.org/index.php/PostgreSQL
Install postgresql package
sudo pacman -S postgresql
Switch to the postgres user account and initialize the database cluster:
sudo -iu postgres
package main | |
import ( | |
"fmt" | |
"os" | |
"os/signal" | |
"time" | |
"golang.org/x/net/context" | |
) |
package main | |
import ( | |
"crypto/tls" | |
"crypto/x509" | |
"flag" | |
"io" | |
"io/ioutil" | |
"log" | |
"os" |
import gnupg | |
gpg = gnupg.GPG() | |
# cifrado simétrico | |
vaca = gpg.encrypt("esto é unha proba", [], symmetric=True, passphrase='1234') | |
print(vaca.data) | |
# b'-----BEGIN PGP MESSAGE-----\n\njA0EBwMCPaDu/4KW8In40kYBvzWul1ccpl4+GP4YVZHv4ppEZ3JydNIKPQViMvhO\nIndNIr2/+3dKFqifBQdZQiAr4X3U3R0QKeWbi1XOcGecPoj5L90m\n=dHQ6\n-----END PGP MESSAGE-----\n' | |
# descifrado | |
boi = gpg.decrypt(vaca.data, passphrase='1234') |
# Generate a unique private key (KEY) | |
sudo openssl genrsa -out mydomain.key 2048 | |
# Generating a Certificate Signing Request (CSR) | |
sudo openssl req -new -key mydomain.key -out mydomain.csr | |
# Creating a Self-Signed Certificate (CRT) | |
openssl x509 -req -days 365 -in mydomain.csr -signkey mydomain.key -out mydomain.crt | |
# Append KEY and CRT to mydomain.pem |