Skip to content

Instantly share code, notes, and snippets.

View CarlosRA97's full-sized avatar

Carlos Rivero Aro CarlosRA97

View GitHub Profile
@CarlosRA97
CarlosRA97 / README.md
Created February 23, 2023 16:05 — forked from matusnovak/README.md
GPG + Git SSH Authentication and Signing on Windows 10

GPG + Git SSH Authentication and Signing on Windows 10

Introduction

This simple Gist will explain how to settup your GPG key to work for SSH authentication (with Git) and Git commit signing on Windows 10. This may seem straightforward on Linux, but there are certain tweaks needed on Windows.

No Cygwin, no MinGW, no Git Bash or any other Linux emulated environment. This works in pure Windows 10.

Software needed

@CarlosRA97
CarlosRA97 / make-keys.sh
Created May 5, 2020 17:35 — forked from suru-dissanaike/make-keys.sh
Create self-signed certificates for Eclipse Mosquitto MQTT broker
#!/bin/bash
IP="192.168.1.22"
SUBJECT_CA="/C=SE/ST=Stockholm/L=Stockholm/O=himinds/OU=CA/CN=$IP"
SUBJECT_SERVER="/C=SE/ST=Stockholm/L=Stockholm/O=himinds/OU=Server/CN=$IP"
SUBJECT_CLIENT="/C=SE/ST=Stockholm/L=Stockholm/O=himinds/OU=Client/CN=$IP"
function generate_CA () {
echo "$SUBJECT_CA"
openssl req -x509 -nodes -sha256 -newkey rsa:2048 -subj "$SUBJECT_CA" -days 365 -keyout ca.key -out ca.crt
@CarlosRA97
CarlosRA97 / 01.dominator.cpp
Created February 7, 2018 13:37 — forked from juanfal/01.dominator.cpp
dominator of an array
// 01.dominator.cpp
// juanfc 2018-02-06
#include <iostream>
#include <array>
using namespace std;
const int N = 9;
typedef array<int,N> TVec;
int dominator(TVec a);
@CarlosRA97
CarlosRA97 / 01.peaks.cpp
Created February 7, 2018 13:37 — forked from juanfal/01.peaks.cpp
Print peaks of a matrix
// 01.peaks.cpp
// juanfc 2018-02-06
#include <iostream>
#include <array>
using namespace std;
const int N = 3;
typedef array<int,N> TRow;
typedef array<TRow,N> TSqMat;
@CarlosRA97
CarlosRA97 / 01.peaks.cpp
Created February 7, 2018 13:37 — forked from juanfal/01.peaks.cpp
Print peaks of a matrix
// 01.peaks.cpp
// juanfc 2018-02-06
#include <iostream>
#include <array>
using namespace std;
const int N = 3;
typedef array<int,N> TRow;
typedef array<TRow,N> TSqMat;
@CarlosRA97
CarlosRA97 / 03.sudoku.cpp
Created February 7, 2018 13:37 — forked from juanfal/03.sudoku.cpp
Check validity of sudoku board
// 03.sudoku.cpp
// juanfc 2018-02-06
//
#include <iostream>
#include <array>
using namespace std;
const int N = 9;
typedef array<int, N> TRow;
@CarlosRA97
CarlosRA97 / 04.pattern.cpp
Created February 7, 2018 13:37 — forked from juanfal/04.pattern.cpp
words letters coinciding with a pattern
// 04.pattern.cpp
// juanfc 2018-02-06
//
#include <iostream>
#include <array>
using namespace std;
const int PATLENGTH = 5;
const int NNONREPWORDS = 100;
@CarlosRA97
CarlosRA97 / buildMagic.cpp
Created January 18, 2018 00:00 — forked from juanfal/buildMagic.cpp
Using Siamese method fill a Magic Square Matrix
// buildMagic.cpp
// juanfc 2018-01-17
// Using Siamese method fill a Magic Square Matrix,
// odd fixed size.
// We have used a big square matrix, but used
// an extra parameter to restrict to that size
//
// Testing it building magic matrices up to a size
// checking they really are magic and printing them
// https://gist.github.com/6db44e77b75d3aacdfa70bdfb7972ef1

The current kernel/drivers of Fedora 24 do not support the Wifi chip used on my Mac Book Pro. Proprietary Broadcom drivers are packaged and available in the rpmfusion repo.

Verify that your card is a Broadcom using: lspci -vnn -d 14e4:

Sample output:

02:00.0 Network controller [0280]: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)

Install

Install the rpmfusion repo, note only "nonfree" is required, as the Broadcom Driver is proprietry: http://rpmfusion.org/

package gziphandler
import (
"compress/gzip"
"io"
"net/http"
"strings"
)
type gzipResponseWriter struct {