Skip to content

Instantly share code, notes, and snippets.

View oxyno-zeta's full-sized avatar

Havrileck Alexandre oxyno-zeta

View GitHub Profile
@oxyno-zeta
oxyno-zeta / README.md
Created May 5, 2022 10:39 — forked from aolwas/README.md
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@oxyno-zeta
oxyno-zeta / index-advanced.html
Last active February 22, 2022 09:18
Simple upload page for s3-proxy
<!DOCTYPE html>
<html>
<head>
<title>File Upload Example</title>
<link
href="https://releases.transloadit.com/uppy/v2.4.1/uppy.min.css"
rel="stylesheet"
/>
<style>
body {
@oxyno-zeta
oxyno-zeta / remove_accents.go
Last active July 8, 2021 09:05 — forked from tkrajina/remove_accents.go
Golang remove accents
package main
import (
"fmt"
"unicode"
"golang.org/x/text/transform"
"golang.org/x/text/unicode/norm"
)
@oxyno-zeta
oxyno-zeta / monzo-alertmanager-config.yaml
Created February 21, 2021 17:47 — forked from milesbxf/monzo-alertmanager-config.yaml
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@oxyno-zeta
oxyno-zeta / bt_speaker-raspberry_pi-zero_w.md
Created December 9, 2020 21:11 — forked from actuino/bt_speaker-raspberry_pi-zero_w.md
Setting up a Bluetooth Speaker from the command line on a raspberry Pi Zero W

The setup of a bluetooth speaker on a Pi Zero W is pretty touchy.

Please get in touch via Twitter @actuino or http://www.actuino.fr/ if you've got comments or improvements to this quick draft.

First checks

  • Use a solid power source
  • check the speaker works on another hardware (android phone f.i.)
  • make sure you've updated your Raspbian, install and run rpi-update just in case.
@oxyno-zeta
oxyno-zeta / wait_for_http_200.sh
Created May 12, 2020 16:08 — forked from rgl/wait_for_http_200.sh
Wait for an HTTP endpoint to return 200 OK with Bash and curl
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done'
# also check https://gist.github.com/rgl/c2ba64b7e2a5a04d1eb65983995dce76
@oxyno-zeta
oxyno-zeta / self-signed-certificate-with-custom-ca.md
Created February 4, 2020 17:01 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@oxyno-zeta
oxyno-zeta / README.md
Created December 5, 2018 18:36 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@oxyno-zeta
oxyno-zeta / ubuntu_agnoster_install.md
Created February 11, 2017 20:02 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 14.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@oxyno-zeta
oxyno-zeta / APICodes.js
Created July 17, 2016 16:09
NodeJS Get all codes in objects
const http = require('http');
const _ = require('lodash');
const INFORMATIONAL = {};
const SUCCESS = {};
const REDIRECTION = {};
const CLIENT_ERROR = {};
const SERVER_ERROR = {};
_.forEach(http.STATUS_CODES, function (value, code) {
let key = value.replace(new RegExp(' ', 'g'), '_').replace(new RegExp('-', 'g'), '_').toUpperCase();
let obj = {