Skip to content

Instantly share code, notes, and snippets.

@chadvoegele
chadvoegele / ddns.sh
Last active October 22, 2019 08:02
ddns.sh
#!/bin/sh
# DynDNS Updater Script, with HTTPS/SSL Support
# This example uses Google's HTTPS/SSL URL update method to update the IP for hostname.example.com.
# This script runs in an endless loop set to the UPDATE_INTERVAL which is currently 1 minutes.
# Edit the settings section to match your DynDNS provider,
# including the DDNS URL which will be unique for each provider.
# See also: https://www.dd-wrt.com/wiki/index.php/DDNS_-_How_to_setup_Custom_DDNS_settings_using_embedded_inadyn_-_HOWTO#Custom_.28URL_Updates.29
# And: http://www.dd-wrt.com/wiki/index.php/Useful_Scripts#DynDNS_Updates_Using_Curl_.28with_HTTPS.2FSSL_Support.29
# alfer@fusebin.com
# cavoegele@gmail.com
@chadvoegele
chadvoegele / rc_startup
Created July 16, 2017 16:48
rc_startup
mount -o bind /jffs/opt /opt
sleep 5
. /opt/secrets.sh
/opt/ddns/ddns.sh &
@chadvoegele
chadvoegele / xournal.patch
Created January 12, 2017 23:15
Xournal Patch that Prevents Pen Streaks on a Surface 3
diff -x .git -Naur xournal/src/xo-paint.c xournal_b/src/xo-paint.c
--- xournal/src/xo-paint.c 2017-01-12 16:59:15.343353729 -0600
+++ xournal_b/src/xo-paint.c 2017-01-12 16:57:55.733350742 -0600
@@ -277,6 +277,8 @@
else {
if (hypot(pt[0]-pt[2], pt[1]-pt[3]) < PIXEL_MOTION_THRESHOLD/ui.zoom)
return; // not a meaningful motion
+ if (hypot(pt[0]-pt[2], pt[1]-pt[3]) > 100)
+ return; // not a meaningful motion
ui.cur_path.num_points++;
@chadvoegele
chadvoegele / python-spams.patch
Created August 19, 2016 05:07
python-spams.patch
diff -Naur trunka/linalg/linalg.h trunk/linalg/linalg.h
--- trunka/linalg/linalg.h 2016-04-24 08:33:27.339077788 -0500
+++ trunk/linalg/linalg.h 2016-04-24 08:34:03.125869367 -0500
@@ -1679,7 +1679,7 @@
up.copy(u);
}
lambda+=theta*norm;
- if isnan(lambda) {
+ if (isnan(lambda)) {
std::cerr << "eigLargestSymApprox failed" << std::endl;
diff --git a/python-spams.patch b/python-spams.patch
index dd7c7fa..4784767 100644
--- a/python-spams.patch
+++ b/python-spams.patch
@@ -19,8 +19,8 @@ diff -Naur trunka/swig/python/mkpy trunk/swig/python/mkpy
-INC="-I. -Ispams/linalg -Ispams/prox -Ispams/decomp -Ispams/dictLearn -I/usr/include/python2.7/"
-INC_PYTHON=-I/usr/include/python2.6
-+INC="-I. -Ispams/linalg -Ispams/prox -Ispams/decomp -Ispams/dictLearn -I/usr/include/python3.5m/"
-+INC_PYTHON=-I/usr/include/python3.5m
@chadvoegele
chadvoegele / PKGBUILD
Created May 26, 2014 23:41
Python 3 SPAMS AUR Package
# Maintainer: Pablo Lluch <pablo dot lluch at gmail dot com>
# Contributor: Chad Voegele
pkgname=python-spams
pkgver=2.5
pkgrel=1
arch=('i686' 'x86_64')
license=('GPL3')
pkgdesc="Optimization toolbox for solving various sparse estimation problems
with Python interface"