Skip to content

Instantly share code, notes, and snippets.

@wyattearp
wyattearp / VaryTempWithHeigh.py
Created November 2, 2020 19:11
Quick hack of CURA settings to allows varying temp and height test - forked from somewhere
# -*- coding: utf-8 -*-
import json
import re
from ..Script import Script
class VaryTempWithHeight(Script):
def __init__(self):
@wyattearp
wyattearp / wifi-serial.ino
Created August 3, 2019 01:30
ESP32 WiFi <-> 3x UART Bridge
/**** This version is ported by Atadiat to work on ESP8266 (tested on NodeMCU 1.0) ****/
/**** Porting was done by Yahya Tawil****/
// ESP32 WiFi <-> 3x UART Bridge
// by AlphaLima
// www.LK8000.com
// Disclaimer: Don't use for life support systems
// or any other situations where system failure may affect
@wyattearp
wyattearp / settings.json
Created February 22, 2019 04:03
vscode default settings.json
// Place your settings in this file to overwrite the default settings
{
// used to improve formatting
"C_Cpp.clang_format_path": "/usr/bin/clang-format",
"C_Cpp.intelliSenseEngine": "Default",
"C_Cpp.default.includePath": [
"${workspaceFolder}/**",
"/usr/include",
"/usr/include/x86_64-linux-gnu",
"/usr/include/linux"
@wyattearp
wyattearp / mkgif.sh
Last active January 10, 2019 03:17 — forked from synth/gist:d1045e129a5f35d87b69
High quality gifs on Linux from OctoPrint
#!/bin/bash
# used for turning octoprint items into timelapse gifs.
# usage ./mkgif.sh <input_movie> <output_gif>
# - error checking is for people who type things poorly :)
FPS=10
# Option 1
# http://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality
PALETTE="pallet-$1.png"
ffmpeg -y -i $1 -vf fps=$FPS,scale=800:-1:flags=lanczos,palettegen "$PALETTE"
ffmpeg -i $1 -i "$PALETTE" -filter_complex "fps=$FPS,scale=800:-1:flags=lanczos[x];[x][1:v]paletteuse" $2
@wyattearp
wyattearp / top_cmds.sh
Created September 27, 2018 02:17
print the 10 most common commands executed from bash/zsh history
# print the 10 most common commands executed from bash/zsh history
history | awk '{print $2}' | tr ' ' '\n' | sort | uniq -c |sort -n | tail
@wyattearp
wyattearp / prepare_template.sh
Created October 20, 2017 19:11
modified prepare vm template
#!/bin/bash
# Add usernames to add to /etc/sudoers for passwordless sudo
users=("user")
for user in "${users[@]}"
do
cat /etc/sudoers | grep ^$user
RC=$?
if [ $RC != 0 ]; then
@wyattearp
wyattearp / .bash_profile.sh
Created September 20, 2016 02:12
Python Startup & History
export PYTHONSTARTUP=$HOME/.pythonstartup.py
@wyattearp
wyattearp / .vimrc
Last active February 18, 2019 03:21
.vimrc to work with vundler
set nocompatible
filetype off " required!
set rtp+=~/.vim/vundle.git/
call vundle#begin()
" My Plugins here:
"
" original repos on github
Plugin 'scrooloose/nerdtree'
@wyattearp
wyattearp / gitlab.rb
Last active October 19, 2015 12:24
Test GitLab Configuration for 8.0, the .rb gets fed into a .erb file that produces a .yml output
gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_host'] = '192.168.230.7'
gitlab_rails['ldap_port'] = 389
gitlab_rails['ldap_uid'] = 'sAMAccountName'
# requires that your AD setups support certificates it appears
gitlab_rails['ldap_method'] = 'plain' # "tls" or "ssl" or "plain"
gitlab_rails['ldap_bind_dn'] = 'cn=adauth,cn=Users,dc=foo,dc=local'
gitlab_rails['ldap_password'] = 'Password123'
gitlab_rails['ldap_active_directory'] = true
# documentation indicates the below should be false for AD; however, experimentation shows this should be true
@wyattearp
wyattearp / youtube.live-qr-url.js
Created August 14, 2015 19:13
Ugly Hack to generate a QR Code from the YouTube live RTMP server & key page
// get the server URL
var server_url = $("[value^=rtmp]").value;
// get the current key
var stream_key = $(".stream-name-text").value;
// assemble the QR code, thanks http://stackoverflow.com/a/9447876
var div = $("#yt-masthead-content");
var qrIMG = 'https://chart.googleapis.com/chart?chl=' + server_url + '/' + stream_key + '&chld=M%7C0&cht=qr&chs=125x125';
var img = document.createElement('img');