Skip to content

Instantly share code, notes, and snippets.

View superjojo140's full-sized avatar

Johannes Schnirring superjojo140

View GitHub Profile
@superjojo140
superjojo140 / postgresql_arch_tutorial.md
Created December 4, 2019 09:56
Setup local PostgreSQL and pgAdmin on ArchLinux

Working with local PostgreSQL and pgAdmin on ArchLinux

Daily Usage

Start postgreSQL

$ sudo systemctl start postgresql
@superjojo140
superjojo140 / chroot_arch.md
Created December 13, 2019 20:13
Chroot into installed arch linux with arch installer usb stick

Start from Archlinux USB Stick

Load german keyboard layout

$ loadkeys de

Enable Wifi (optional but usefull)

$ wifi-menu
@superjojo140
superjojo140 / arch_install.md
Last active February 15, 2023 14:38
Arch Linux UEFI Installation mit KDE Desktop

Diese Anleitung beschreibt die wichtigsten Schritte einer Arch Linux Installation.

Sie ist stark angelehnt an die Anleitung für Einsteiger, verzichtet jedoch auf viele Erklärungen und Variationen.

Installiert wird hier auf UEFI, als Desktop wird KDE Plasma installiert.

Vorbereitungen

Iso herunterladen http://www.archlinux.org/download/

@superjojo140
superjojo140 / chmod_basics.md
Last active September 10, 2020 09:53
chmod for dummies

Using chmod...

Examples

chmod a+rwx path/to/file    # Everybody can read, write and execute the file
chmod u+rwx path/to/file    # The owner of the file can read, write and execute the file
chmod o-wx path/to/file     # All other users can no longer write or execute the file
chmod ug+x path/to/file     # The owner and the group can now execute the file
@superjojo140
superjojo140 / server.js
Last active February 10, 2020 14:57
Serve compiled angular files
const express = require('express');
const app = express();
// Serve the static files from the angular build
app.use(express.static(`${__dirname}/dist/PROJECT_NAME`));
app.get('/*',(req,res) => {
res.sendFile(`${__dirname}/dist/PROJECT_NAME/index.html`);
});
@superjojo140
superjojo140 / workflow.md
Last active April 24, 2020 12:35
Microservices workflow

Microservices - Deployment on heroku

Setup

Enviroment Variables

Use enviroment variables for ports and urls!

@superjojo140
superjojo140 / content_type_http.md
Last active March 5, 2020 16:37
Content Type in HTTP Requests

The Content-Type header is used to specify how the data in the body of a HTTP request or response is formatted.

Possible Values

There are really a lot of possible values. The most common values for HTTP Requests are listed here. For a more completely list see MDN - MIME types

application/json

@superjojo140
superjojo140 / promise.js
Last active March 22, 2020 16:48
JS returning a promise - Syntax
function myCoolPromise() {
return new Promise(function (resolve, reject) {
//do some async things
const data = "this_is_so_async";
//if successfull
resolve(data);
//if not
reject("error");
});
}
@superjojo140
superjojo140 / captcha.js
Created April 2, 2020 19:31
Captcha Solutions
let dummyInput = [
"Was ergibt 28 plus 9?",
"Bitte addieren Sie 6 und 38.",
"Bitte geben Sie den ersten, vierten und fünften Buchstaben von 'JEWELL' ein.",
"Wie viele Buchstaben hat MADRID?",
"Bitte subtrahieren Sie 22 von 3.",
"Zählen Sie die Buchstaben: THIN",
"Bitte ziehen Sie 2 von 9 ab.",
"Was ergibt 11 minus 36?"
]
@superjojo140
superjojo140 / cors-fetch-express.md
Last active June 14, 2020 14:59
CORS fetch-request with credentials

This sounds easy but... it isn't!

Client side

Use this fetch options:

fetch('superUnsecureCorsUrl',{
   credentials: 'include'
})