Skip to content

Instantly share code, notes, and snippets.

View kevinelgan's full-sized avatar

Kevin Elgan kevinelgan

View GitHub Profile
@kevinelgan
kevinelgan / docker-compose.yml
Created November 21, 2022 19:03 — forked from ju2wheels/docker-compose.yml
docker-compose reference YAML file with comments
# https://docs.docker.com/compose/yml/
# Each service defined in docker-compose.yml must specify exactly one of
# image or build. Other keys are optional, and are analogous to their
# docker run command-line counterparts.
#
# As with docker run, options specified in the Dockerfile (e.g., CMD,
# EXPOSE, VOLUME, ENV) are respected by default - you don't need to
# specify them again in docker-compose.yml.
#
service_name:
@kevinelgan
kevinelgan / network-manager-raspbian-2020-02-05.md
Created June 16, 2021 16:29 — forked from jjsanderson/network-manager-raspbian-2020-02-05.md
Installing Network Manager on Raspbian 2020-02-05

Installing Network Manager on Raspbian 2020-02-05

Default Raspbian is not able to connect to wifi networks using corporate security setups, including eduroam. However, the issue is that the packaged networking control widget does not expose the relevant security features, rather than any underlying hardware limitation. The solution has long been to install Network Manager and configure it to handle the wifi interface.

Unfortunately, previous installation approaches didn't work for me on the Raspbian 2020-02-06 image. Following a fresh install, the below is what I did to make it work. Note that this is actually simpler than previous recipes.

Install packages

sudo apt update
sudo apt install network-manager network-manager-gnome
@kevinelgan
kevinelgan / autonomous.txt
Created May 20, 2021 17:27 — forked from kkemple/autonomous.txt
Instructions on how to reset the autonomous desk. This fixes a problem where the desk will not lower (also reportedly fixes incorrectly reported heights).
> Thank you for reaching out to Autonomous! I am sorry to hear that you are having some trouble with your SmartDesk
> but I will be glad to assist. It sounds like your system needs a "hard reset" can I please have you follow these
> steps thoroughly.
Reset Steps:
1. Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds.
2. Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass.
3. Release both buttons.
4. Press the down buttons until the desk beeps one more time or 20 seconds pass.
@kevinelgan
kevinelgan / auto_mount_usb.py
Created May 27, 2020 01:22 — forked from slobdell/auto_mount_usb.py
Automatically mount USB drive in python script
import commands
# ASSUMED THAT THIS COMMAND HAS ALREADY BEEN RUN
# sudo mkdir /mnt/usb_stick
MOUNT_DIR = "/mnt/usb_stick"
def run_command(command):
# start = time.time()
ret_code, output = commands.getstatusoutput(command)
@kevinelgan
kevinelgan / ngrokService.sh
Created December 22, 2018 19:40 — forked from mendesbarreto/ngrokService.sh
Script to start Ngrok at raspberry every boot
#! /bin/sh
# /etc/init.d/ngrok
case "$1" in
start)
echo "Ngrok service is starting"
screen ./ngrok start -all -config /home/pi/.ngrok2/ngrok.yml
echo "Ngrok service was started"
;;
stop)
@kevinelgan
kevinelgan / ngrok_port.go
Created December 22, 2018 03:08 — forked from milanaleksic/ngrok_port.go
Ngrok free mode always has only one single tunnel allowed. If you use TCP tunnel, this script extracts the value (since ngrok doesn't have server API). This way you can connect to that port from a script (ssh tunnel is my favorite usage of ngrok) instead of having to visit the site manually to get this value.
package main
import (
"bufio"
"errors"
"fmt"
"io"
"log"
"net/http"
"net/http/cookiejar"
@kevinelgan
kevinelgan / button.py
Created March 16, 2018 06:40 — forked from tjoen/button.py
button.py
# Mycroft quick and dirty led and button tester
#
# Put mbus.py, button.py and light.py in /home/pi
# Run python lights.py in another terminal
# or better: add it to your autorun.sh like this:
# python /home/pi/lights.py </dev/null &>/dev/null &
# just before:
# else
# # running from a SSH session
# echo "Remote session"