Skip to content

Instantly share code, notes, and snippets.

View jeffersfp's full-sized avatar

Jefferson Pires jeffersfp

  • São Paulo, Brazil
  • 19:26 (UTC -03:00)
View GitHub Profile
@jeffersfp
jeffersfp / fix.sh
Created September 14, 2016 19:14 — forked from icsaas/fix.sh
dpkg: warning: files list file for package `*****' missing, assuming package has no files currently installed
#!/bin/bash
set -e
# Clean out /var/cache/apt/archives
apt-get clean
# Fill it with all the .debs we need
apt-get --reinstall -dy install $(dpkg --get-selections | grep '[[:space:]]install' | cut -f1)
DIR=$(mktemp -d -t info-XXXXXX)
for deb in /var/cache/apt/archives/*.deb
@jeffersfp
jeffersfp / gist:f0d7bac747621b892ccf331a7769ad5d
Created March 31, 2017 17:49 — forked from jgonera/gist:3084341
Google Chart: Scatter Chart with a line
<!doctype html>
<html>
<head>
<title>Google Chart: Scatter Chart with a line</title>
<meta charset="UTF-8" />
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", { packages: ["corechart"] });
google.setOnLoadCallback(drawChart);
function drawChart() {
@jeffersfp
jeffersfp / 0.md
Created April 4, 2017 20:09 — forked from max-mapper/0.md
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@jeffersfp
jeffersfp / transmission-ssl
Created June 15, 2017 12:44 — forked from Belphemur/transmission-ssl
Configuration to use nginx as reverse proxy for Transmission BT with SSL/HTTP2 protected with auth
upstream transmission {
server 127.0.0.1:9091; #Transmission
}
server {
listen 443 ssl http2;
server_name example.com;
auth_basic "Server Restricted";
auth_basic_user_file /var/www/myWebSite/web/.htpasswd;
# Path to the root of your installation
@jeffersfp
jeffersfp / install-kong
Last active January 24, 2018 16:26 — forked from anhldbk/install.sh
Install Kong API Gateway on Ubuntu
sudo apt-get install netcat openssl libpcre3 dnsmasq procps perl
# for ubuntu 16.04 (xenial)
sudo apt-get -y install postgresql postgresql-contrib phppgadmin
sudo -i -u postgres
psql
CREATE USER kong; CREATE DATABASE kong OWNER kong;
ALTER USER kong WITH password 'kong';
@jeffersfp
jeffersfp / README.md
Last active July 3, 2018 12:08 — forked from mayorova/README.md
Mutual SSL in NGINX

Securing traffic to upstream servers with client certificates

Info: https://www.nginx.com/resources/admin-guide/nginx-https-upstreams/

Creating and Signing Your Certs

Source: http://nategood.com/client-side-certificate-authentication-in-ngi

This is SSL, so you'll need an cert-key pair for you/the server, the api users/the client and a CA pair. You will be the CA in this case (usually a role played by VeriSign, thawte, GoDaddy, etc.), signing your client's certs. There are plenty of tutorials out there on creating and signing certificates, so I'll leave the details on this to someone else and just quickly show a sample here to give a complete tutorial. NOTE: This is just a quick sample of creating certs and not intended for production.

@jeffersfp
jeffersfp / sign-virtualbox-kernel-module-files-ubuntu.md
Last active March 26, 2024 06:20
Sign VirtualBox Kernel Module Files - Ubuntu

Sign VirtualBox Kernel Modules - Ubuntu

Follow the steps below if you have EFI Secure Boot enabled and need to sign VirtuaBox Kernel Modules.

  1. Install the virtualbox package
sudo apt install virtualbox
  1. Create a personal public/private RSA key pair which will be used to sign kernel modules
@jeffersfp
jeffersfp / README.md
Last active August 5, 2020 16:18 — forked from erichrobinson/README.md
SwitchResX Configuration

SwitchResX Settings for LG 21:9 UltraWide

SwitchResX is a utility that allows users to override the default resolution settings in OSX. For more information, including download links, vist http://www.madrau.com/ .

Disabling System Integrity Protection (SIP)

If you are running OSX 10.11 or higher, SIP must be disabled. To disable SIP do the following:

  • Boot into the recovery partition by pressing CMD + R when starting up your Mac.
  • Once in recovery mode, open a terminal window.
  • Type the command csrutil disable
@jeffersfp
jeffersfp / config.ini
Created February 10, 2020 14:57 — forked from tsuriga/config.ini
Simple config file validation in python
[DEFAULT]
; Operation mode
; This is a global value for all sections
mode = master
[server]
; Connection lifetime
timeout = 3600