Skip to content

Instantly share code, notes, and snippets.

View f4bio's full-sized avatar

Fabio Tea f4bio

View GitHub Profile
@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

@maikelwever
maikelwever / libvirt-vga-passtrough.rst
Last active January 27, 2017 11:47
libvirt-vga-passtrough

New guide for vga-passtrough VMs with STOCK kernel on Arch with libvirt.

Install libvirt, virt-manager, latest stock kernel, ovmf-bin. ovmf-bin may need to come from the AUR. Check if your graphics card is UEFI compilant. If not, search for a rom/gpu bios file that does support UEFI and store it somewhere.

** You may need to run your host on UEFI as well if using the i915 as primary graphics. **

If you get permission issues, try running the qemu instances as root. Edit /etc/libvirt/qemu.conf for this.

@kylemanna
kylemanna / i7-7700k-igd-passthrough.xml
Created April 6, 2017 19:04
KVM + QEMU IGD Passthrough with ASRock Z270 Taichi + i7-7700k
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>Win10-IGD</name>
<uuid>YOUR-UUID</uuid>
<memory unit='KiB'>5939200</memory>
<currentMemory unit='KiB'>5939200</currentMemory>
<memoryBacking>
<hugepages/>
</memoryBacking>
<vcpu placement='static'>4</vcpu>
<os>
@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,
],
@JoeMeeks
JoeMeeks / InputMask.html
Last active October 25, 2020 13:44
Custom Ionic 2 & 3 Input Mask Directive
<ion-input type="tel" pattern="\d*" placeholder="(xxx) xxx-xxxx" mask="(***) ***-****" [(ngModel)]="phone" name="phone"></ion-input>
<ion-input type="tel" pattern="\d*" placeholder="xxx-xx-xxxx" mask="***-**-****" [(ngModel)]="ssn" name="ssn"></ion-input>
@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
@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

@glaszig
glaszig / mkp2pblocklist
Last active January 30, 2022 00:30
creates a blocklist for your p2p endeavors
#!/usr/bin/env sh
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2020 glaszig <glaszig@gmail.com>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
@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
@jframos
jframos / mic_mute_script.workflow
Created December 22, 2017 09:25
AppleScript - Microphone mute
if input volume of (get volume settings) = 0 then
set level to 90
display notification "On" with title "Mic"
tell application "System Events"
tell appearance preferences
set dark mode to false
end tell
end tell
else
set level to 0