Skip to content

Instantly share code, notes, and snippets.

@gskielian
gskielian / watchdog.sh
Created April 8, 2018 19:16
Forever Start @reboot
#!/bin/bash
# usage, replace the <path to app.js file> with full path to your node app
# set crontab to @reboot <full path to this script>
# make sure to chmod +x this script to make it runnable
export PATH=/usr/local/bin:$PATH
if [ `/usr/local/bin/forever list | /usr/bin/wc -l` -le 1 ]; then
/usr/local/bin/forever start <path to app.js file>
fi
@tstellanova
tstellanova / jetson_tk1_dev_setup.md
Last active November 21, 2015 05:01
Jetson TK1 development environment

Before you begin, ensure that you've setup network access, either with ethernet or wlan.

Setup timezone

sudo dpkg-reconfigure tzdata

Typically we use "US/Pacific-New"

Mount sdcard

@treeherder
treeherder / a_g.c
Last active August 29, 2015 13:56
accelerometer structure for handling data in a way that might be sane
#include <stdio.h>
typedef struct ret ret;
struct ret {
char *id;
int accel_x;
int accel_y;
int accel_z;
int gyro_x;
@harith
harith / shellmarks.sh
Last active September 18, 2022 07:50
Utilities to let you easily reach frequently visited but deeply nested directories.
# Utilities for quickly accessing frequently used directories in bash.
# Usage:
# $ cd /path/to/project/src/
# $ mark code # Will create a new shortcut.
# # Becomes interactive if a shortcut already exists
# # m is an alias for mark. You can also `m code`
#
# $ code # From now on, running this anywhere in the shell
# # will put you in /path/to/project/src/code
@tlevine
tlevine / gist:6149026
Created August 4, 2013 03:43
Set up an SSH key so you can clone a Git repository from GitHub and not type your password every time you need to fetch or push.
# Create an SSH key.
ssh-keygen
# Copy this to the GitHub SSH key page.
cat ~/.ssh/id_rsa.pub
# Clone a git repository with SSH.
git clone git@github.com:tlevine/foobar.git
@electronut
electronut / analogplot.py
Created June 7, 2013 15:34
Plot real-time analog data (single value) read from serial port using Python Matplotlib.
################################################################################
# showdata.py
#
# Display analog data from Arduino using Python (matplotlib)
#
# electronut.in
#
################################################################################
import sys, serial
@electronut
electronut / analog-plot.ino
Created May 24, 2013 07:45
Read analog values from A0 and A1 and print them to serial port.
// analog-plot
//
// Read analog values from A0 and A1 and print them to serial port.
//
// electronut.in
#include "Arduino.h"
void setup()
{
@electronut
electronut / showdata.py
Created May 24, 2013 07:44
Display analog data from Arduino using Python (matplotlib)
################################################################################
# showdata.py
#
# Display analog data from Arduino using Python (matplotlib)
#
# electronut.in
#
################################################################################
import sys, serial
@naokirin
naokirin / SwingHelloWorld.java
Created January 18, 2012 18:59
Swing Hello,World
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
public class SwingHelloWorld extends JFrame{
public static void main(String[] args){
SwingHelloWorld frame = new SwingHelloWorld("Hello");
frame.setVisible(true);
}