Skip to content

Instantly share code, notes, and snippets.

View danielwarnersmith's full-sized avatar
🌴
On vacation

Daniel Warner Smith danielwarnersmith

🌴
On vacation
View GitHub Profile
@MBing
MBing / install_wlan_dongle.sh
Last active October 15, 2024 22:51
install TP-Link-WN725N Nano USB Wifi on Raspberry Pi with Kernel 5.10+
# DO NOT PUT THE WIFI DONGLE IN THE DEVICE BEFORE MENTIONED EXPLICITLY BELOW
# Brief note, after this the UI will not show the usb dongle,
# the wifi does work and I get an IP address, so all works,
# but I don't go into detail of making it show on the Raspbian UI.
# (for this purpose I don't care about the UI)
# For the use of this I connected my device to an ethernet connection and through the Router could see the IP which I can SSH into.
## STEP 1: Prepare machine and install packages needed
@danieloneill
danieloneill / obs_studio-arm.diff
Created November 7, 2019 05:51
Patches for OBS Studio
diff --git a/deps/media-playback/CMakeLists.txt b/deps/media-playback/CMakeLists.txt
index d58d121..ae938fa 100644
--- a/deps/media-playback/CMakeLists.txt
+++ b/deps/media-playback/CMakeLists.txt
@@ -28,6 +28,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64le")
PUBLIC
-mvsx)
add_compile_definitions(NO_WARN_X86_INTRINSICS)
+elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|aarch).*")
elseif(NOT MSVC)
@darconeous
darconeous / tesla-key-card-protocol.md
Last active November 8, 2024 21:21
Tesla Key Card Protocol

Tesla Key Card Protocol

Researched by Robert Quattlebaum [email protected].

Last updated 2020-02-03.

Image of Tesla Key Card Image of Tesla Model 3 Key Fob

@anthonyray
anthonyray / README.md
Last active October 3, 2020 18:20
One liner to take a picture from a remote Raspberry Pi and see it in your terminal

Instructions

  1. On your Raspberry Pi, enable SSH.

  2. On your laptop, copy your SSH keys to your Raspberry with ssh-copy-id pi@<your-raspi-hostname>.local.

  3. Install fswebcam with sudo apt-get install fswebcam.

  4. From a terminal on your computer, you can issue a :

extension NSMutableAttributedString {
func add(attribute: Attribute, range: NSRange) throws {
guard (range.location + range.length) <= length else {
throw AttributedStringError.InvalidRange(range: range)
}
addAttribute(attribute.name, value: attribute.value, range: range)
}
}
@scruss
scruss / esc-pos-image-star.py
Created July 27, 2014 03:14
print image files to thermal printer ESC-POS on stdout, using ESC * instead of GS v
#!/usr/bin/python
# esc-pos-image-star.py - print image files given as command line arguments
# to simple ESC-POS image on stdout
# using ESC * \x21
# scruss - 2014-07-26 - WTFPL (srsly)
import sys
from PIL import Image
import PIL.ImageOps
import struct
@scruss
scruss / esc-pos-image.py
Last active November 2, 2024 05:15
print image files to thermal printer ESC-POS on stdout
#!/usr/bin/env python3
# esc-pos-image.py - print image files given as command line arguments
# to simple ESC-POS image on stdout
# scruss - 2014-07-26 - WTFPL (srsly)
# - 2021-01-09 (made python3 compatible - tvm Carko!)
# if you want a proper CUPS driver for a 58mm thermal printer
# that uses this command set, go here:
# https://github.com/klirichek/zj-58
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone [email protected]:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync [email protected]:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@lordastley
lordastley / gist:5127027
Last active March 1, 2024 09:45
1-bit dithering a video
ffmpeg -i input.mp4 -s hd480 -f image2 img-%4d.png # dump the video to .png images, 480p
for i in *.png; do convert $i -colorspace Rec709Luma pgm:- | pamditherbw -atkinson | pnmtopng > p$i; done; # convert .png images to 1-bit dithered .pngs
ffmpeg -r [orig. framerate] -i pimg-%4d.png -i input.mp4 -map 0:0 -map 1:1 -c:a copy -c:v libx264 -tune stillimage -crf 18 -r 24 lol.mkv
#take dithered png files, original video's audio, make a video with x264, tuned for still images and a copy of the audio. specify frame rate for proper a/v sync
# -map 1:1 maps audio from 2nd input (orig video) to audio of new video. assumes stream 1 is desired audio track. check this.
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 17, 2024 01:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname