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
@JonathanPorta
JonathanPorta / UseXboxOneControlleronFedora.md
Created December 21, 2019 18:47 — forked from ddrpa/UseXboxOneControlleronFedora.md
Use Xbox One Controller on Fedora
dnf search kernel-modules-extra
@JonathanPorta
JonathanPorta / UseXboxOneControlleronFedora.md
Created December 21, 2019 18:47 — forked from ddrpa/UseXboxOneControlleronFedora.md
Use Xbox One Controller on Fedora
dnf search kernel-modules-extra
@JonathanPorta
JonathanPorta / unbork_wifi.service
Created July 4, 2019 20:16
Fixes issue with Wifi on MacBook Pro becoming permanently disabled (until you reload the kernel module) after machine wakes up from suspend.
[Unit]
Description=Unload and reload the wifi module after computer resumes from suspend.
After=suspend.target
[Service]
User=root
Type=oneshot
ExecStart=/bin/bash -c "/usr/sbin/rmmod brcmfmac && /usr/sbin/modprobe brcmfmac"
TimeoutSec=0
StandardOutput=syslog
@JonathanPorta
JonathanPorta / gdrpCheck.js
Last active May 22, 2019 07:57
Naive check to determined if the visitor should be shown the GDPR notice.
function locale(){
if (navigator.languages != undefined)
return navigator.languages[0];
else
return navigator.language;
}
function showGdprNotice(){
const gdprCountries = [
@JonathanPorta
JonathanPorta / TableView.js
Created August 14, 2018 22:12
Plopping a copy down here before the big ol'
import React from 'react'
import { Link } from 'react-router-dom'
const TableView = props => (
<div class="row m-b-20">
<div class="col-xs-12 col-lg-9">
<h4> Watches </h4>
<p>All watches</p>
</div>
<div class="col-xs-12 col-lg-3">
@JonathanPorta
JonathanPorta / setup_collectd.sh
Created May 2, 2018 08:56
Throw some configs around for OpenWRT routers.
#!/bin/ash
opkg update
opkg install collectd
. /etc/init.d/collectd enable
. /etc/init.d/collectd start
opkg install luci-app-statistics collectd-mod-rrdtool collectd-mod-processes collectd-mod-interface collectd-mod-iptables collectd-mod-netlink collectd-mod-cpu collectd-mod-curl collectd-mod-df collectd-mod-disk collectd-mod-dns collectd-mod-interface collectd-mod-iptables collectd-mod-load collectd-mod-irq collectd-mod-memory collectd-mod-network collectd-mod-ntpd collectd-mod-openvpn collectd-mod-ping collectd-mod-processes collectd-mod-thermal collectd-mod-uptime collectd-mod-users collectd-mod-wireless collectd-mod-vmem libnetsnmp liboping libcurl
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' open.scdn.co www.google-analytics.com cdn.ravenjs.com vt.myvisualiq.net www.gstatic.com". Either the 'unsafe-inline' keyword, a hash ('sha256-exNIbRoBufGA8Xw81IIBBDk1C1yh5NkucdznLehlx2g='), or a nonce ('nonce-...') is required to enable inline execution.
rocket%20league:1 The SSL certificate used to load resources from https://audio-akp-spotify-com.akamaized.net will be distrusted in M70. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.
3rocket%20league:1 Failed to load https://audio-akp-spotify-com.akamaized.net/audio/8af5e6367293321b87a6c98464b9a5ccdb9cfffc?__token__=exp=1520453659~hmac=24db9db34f046bed5e4b579d1e0335a461626b71f308fcd5d9f168ae00e88fa5: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resourc
[Unit]
Description=Ensure that the grafana process is running
After=network-online.target
[Service]
User=grafana
Group=grafana
Restart=always
WorkingDirectory=/opt/grafana/
ExecStart=/opt/grafana/bin/grafana-server web