Skip to content

Instantly share code, notes, and snippets.

View f4bio's full-sized avatar

Fabio Tea f4bio

View GitHub Profile
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@nickjohnson-dev
nickjohnson-dev / my-app.ts
Created March 30, 2016 23:25
Angular 2 Simple Wizard
import { Component } from 'angular2/core';
import { MyWizard } from './my-wizard';
import { MyWizardStep } from './my-wizard-step';
@Component({
selector: 'my-app',
directives: [
MyWizard,
MyWizardStep,
],
@yeokm1
yeokm1 / archlinux-rpi3-serial-and-bluetooth.md
Last active October 9, 2021 09:59
Arch Linux Raspberry Pi 3 configuration to use both Serial Debug Port and Bluetooth

The new Raspberry Pi 3 released on 29 Feb 2016 has issues with its UART port as the pinout GPIO 14/15 on the pin header is now based on a low throughput mini-UART.

To understand the issue better than reading the wall of text below, you can see the talk I gave on this issue.

The actual hardware UART on the BCM2837 SoC has now been assigned to handle Bluetooth with the BCM43438 Wifi/Bluetooth chip. More details can be found here and here.

This mini-UART does not produce a stable baud rate as it fluctuates based on the Core clock speed whenever it rises or falls. The result is that the serial debug output is practically unusable. On Raspbian you may see garbage or nothing at all. The solution is simple, add core_freq=250 to /boot/config.txt to cap the core frequency to a constant value. This optio

@macropin
macropin / docker-maintenance.sh
Last active January 4, 2021 22:56
Docker Maintenance Script
#!/usr/bin/env bash
#
# Docker Cleanup / Update Script
#
# Usage Example:
# curl --silent https://gist.githubusercontent.com/macropin/3d06cd315a07c9d8530f/raw | bash -s rm-dangling
#
set -e
@overtrue
overtrue / init.fish
Last active December 6, 2023 05:24 — forked from alyssaq/config.fish
config.fish set environment variables from bash_profile
# Fish shell
egrep "^export " ~/.bash_profile | while read e
set var (echo $e | sed -E "s/^export ([A-Za-z_]+)=(.*)\$/\1/")
set value (echo $e | sed -E "s/^export ([A-Za-z_]+)=(.*)\$/\2/")
# remove surrounding quotes if existing
set value (echo $value | sed -E "s/^\"(.*)\"\$/\1/")
if test $var = "PATH"
@Manu343726
Manu343726 / gist:ca0ceb224ea789415387
Created September 19, 2015 18:15
Running ARM docker image with QEMU on x86_64 Arch Linux host
# Install quemu, docker, etc
yaourt -S qemu qemu-user-static binfmt-support
# The quemu-user-static AUR package is outdated and broken. The .deb package they pull is no longer in the ubuntu repository.
# Edit the PKGBUILD and use qemu-user-static_2.4+dfsg-3_amd64.deb (With SHA1 sum "84d83a16c60c82b6c579f2f750b04a3ac26c249b")
# Enable ARM emulation
update-binfmts --enable qemu-arm
@mikroskeem
mikroskeem / Arch Linux btrfs install.md
Last active October 8, 2023 18:27 — forked from artizirk/Arch Linux btrfs install.md
Arch Linux installation on btrfs subvolumes

Arch Linux btrfs install

NOTE: Last update to this gist was on Jun 2, 2018. Most of the things here are out of date (e.g consider using zstd for transparent compression instead of lzo), so do your own research as well. Take care!

0. Prerequisites

  • Plenty of storage - snapshots will take (sort of) a lot of space
  • Latest Arch Linux install iso because those have newer kernels and more bugfixes in btrfs.
  • Have previous experience with installing Arch (like you can install arch with a blind fold).
  • Read everything through

Arch Linux btrfs install

0. Prerequisites

  1. Latest Arch Linux install iso because those have newer kernels and more bugfixes in btrfs.
  2. Have previous experience with installing Arch (like you can install arch with a blind fold).

1. Parititions

We will ne two of them, one for /boot and the other one will be a btrfs partition with subvolumes.

  1. /dev/sda1 - this will be /boot with vfat filesystem because UEFI or syslinux for legacy BIOS boot
@gutoandreollo
gutoandreollo / arch_setup.sh
Last active April 6, 2022 18:18
Installing Arch Linux with an encrypted btrfs root, with GPT and UEFI support
# Install arch linux in an encrypted btrfs partition with GPT and UEFI support, gummiboot and hibernate/resume support
# sources:
# http://hole.tuziwo.info/install-arch-linux-on-uefi-gpt-computer-with-btrfs-support.html
# http://www.brunoparmentier.be/blog/how-to-install-arch-linux-on-an-encrypted-btrfs-partition.html
# https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption
# Take note of this:
# - The first thing you need is to identify which disk you're going to use. For the purpose of this guide, it will be /dev/sda
# Be VERY CAREFUL if you have more than one disk on your computer, and DOUBLE CAREFUL if one of them is the one with your backups
# - Since btrfs does not support swapfiles (yet), we'll create a swap partition. In this guide, it will NOT be encrypted
@drewsberry
drewsberry / ublock-filter.md
Created March 30, 2015 15:18
ublock Analytics Filter

ublock Allow Google Analytics

  • Go to ublock settings and select the "Filters" tab

  • In the box, copy the following filter rule in:

    @@||google-analytics.com^

  • Click "Apply changes"

  • You're done