Skip to content

Instantly share code, notes, and snippets.

View JonathanPorta's full-sized avatar
🎯
Focusing

Jonathan Porta JonathanPorta

🎯
Focusing
View GitHub Profile
@JonathanPorta
JonathanPorta / usb-3d-printer-devices.MD
Last active August 27, 2022 22:15
How to fix permission denied for your 3d printer connected via usb (probably)

If using a USB serial converter, as many 3d printers seem to, we can find the device here:

ls -lah /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Aug 27 15:41 /dev/ttyUSB0

As you can see, the device is owned by root and in the group dialout.

In order to allow ourselves, or our Octoprint service account, access we need to add that user to the dialout group.

@JonathanPorta
JonathanPorta / webcam-devices.MD
Last active August 27, 2022 22:20
How to find which device (/dev/video...) is able to be used as a v4l2 webcam/stream?

How can we see v4l2 capable video devices?

# install via `dnf install v4l-utils`
sudo v4l2-ctl --list-devices

C922 Pro Stream Webcam
	/dev/video2
	/dev/video3
	/dev/media1
@hussfelt
hussfelt / README.md
Last active April 2, 2024 21:25
AWS and Terraform: Simplest redirect possible for redirecting traffic from one domain to another

AWS and Terraform site redirect

Using example.com as the input domain, this module will:

  • Create a Route53 zone for example.com
  • Create a bucket named example.com
  • Create a bucket named www.example.com
  • Create a Route53 A record example.com for the static website bucket of example.com
  • Create a Route53 A record www.example.com for the static website bucket of www.example.com
@jcward
jcward / Readme.txt
Created April 14, 2017 15:08
Generating iOS P12 / certs without Mac OSX Keychain (on linux, windows, etc)
1) Generate a private key and certificate signing request:
openssl genrsa -out ios_distribution.key 2048
openssl req -new -key ios_distribution.key -out ios_distribution.csr -subj '/emailAddress=me@example.com, CN=Example, C=US'
2) Upload CSR to apple at: https://developer.apple.com/account/ios/certificate/create
- choose Production -> App Store and Ad Hoc
3) Download the resulting ios_distribution.cer, and convert it to .pem format:
@JonathanPorta
JonathanPorta / gist:4655470a99306aab407a7009f244ff97
Last active March 20, 2017 13:31
Add a checkbox to a Twitter user and then see who was checked
// This File: https://gist.github.com/JonathanPorta/4655470a99306aab407a7009f244ff97
// Handles List: https://gist.github.com/JonathanPorta/5278413566e561e1c4bf059aecf99d1d
// Add the checkboxes
var allHandles = [];
$('a.ProfileCard-screennameLink').each(function(i,e){
var $e = $(e);
var handle = $e.text().trim();
$e.before($("<input type='checkbox' style='height: 2.5em; width: 2.5em;' value='"+handle+"'/>"));
allHandles.push(handle);
});
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active June 21, 2024 14:47
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@ddrpa
ddrpa / UseXboxOneControlleronFedora.md
Created November 14, 2016 15:02
Use Xbox One Controller on Fedora
dnf search kernel-modules-extra
@dddnuts
dddnuts / Fastfile
Created June 4, 2016 10:39
Build ipa from Unity project with fastlane
fastlane_version "1.94.0"
default_platform :ios
platform :ios do
desc "Run Unity Editor tests"
lane :test_unit do
unity(
run_editor_tests: true
)
@JonathanPorta
JonathanPorta / golang-json-marshall
Created October 5, 2015 17:25 — forked from kendellfab/golang-json-marshall
Handling custom Json marshalling in golang.
type Whatever struct {
someField int
}
func (w Whatever) MarshalJSON() ([]byte, error) {
return json.Marshal(struct{
SomeField int `json:"some_field"`
}{
SomeField: w.someField,
})
@JonathanPorta
JonathanPorta / setpin.sh
Last active January 4, 2021 13:32
Change Yubikey PIN/PUK
#!/bin/bash
set -e # bail on errors
# Make sure your shell history isn't saved
hsback=$HISTFILE
unset HISTFILE
echo "Enter you current PIN - leave blank if default:"
read oldpin