Skip to content

Instantly share code, notes, and snippets.

View afreisinger's full-sized avatar
🏠
Working from home

Adrián Freisinger afreisinger

🏠
Working from home
View GitHub Profile
@afreisinger
afreisinger / esp-wifi.cpp
Last active April 26, 2022 02:28
Establishing a wifi connection
#include <ESP8266WiFi.h>
void connectWiFi(const char* WIFI_SSID,const char* WIFI_PASS, const char* WIFI_HOSTNAME)
{
bool isConnected = false;
if (WiFi.status() == WL_CONNECTED && !isConnected) return;
Serial.printf("Connecting to WiFi %s/%s", WIFI_SSID, WIFI_PASS);
WiFi.disconnect();
WiFi.mode(WIFI_STA);
@afreisinger
afreisinger / github-forking.md
Created April 26, 2022 01:14
GitHub Fork & Pull Request Workflow

GitHub Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favo

@afreisinger
afreisinger / README.md
Created March 15, 2022 01:54 — forked from marcoieni/README.md
Localize json resume in different languages

JSON Resume internationalization

A simple way to add internationalization feature to the JSON Resume project.

Create a different entry for each field that you want to localize, named with the language and the name of the field separated by an underscore. For example if you want to create an italian version and an english version of your summary do the following:

"basics": {
  "name": "Richard",
 "label": "Programmer",
#### General PFCTL Commands ####
$ pfctl -d disable # packet-filtering
$ pfctl -e enable # packet-filtering
$ pfctl -q # run quiet
$ pfctl -v -v # run even more verbose
#### Loading PF Rules ####
$ pfctl -f /etc/pf.conf # load /etc/pf.conf
$ pfctl -n -f /etc/pf.conf # parse /etc/pf.conf, but dont load it
$ pfctl -R -f /etc/pf.conf # load only the FILTER rules
$ pfctl -N -f /etc/pf.conf # load only the NAT rules
@afreisinger
afreisinger / .zshrc
Created September 27, 2021 04:10 — forked from ktrysmt/.zshrc
using zplug in zsh
if [[ ! -d ~/.zplug ]];then
git clone https://github.com/zplug/zplug ~/.zplug
fi
source ~/.zplug/init.zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/sudo", from:oh-my-zsh
zplug "plugins/command-not-found", from:oh-my-zsh
zplug "zsh-users/zsh-syntax-highlighting"
zplug "zsh-users/zsh-history-substring-search"
#!/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