Skip to content

Instantly share code, notes, and snippets.

@bakercp
bakercp / sgx_build_modules.sh
Created May 22, 2013 04:04
Building / Installing / Running SGX modules on the Beagle Bone Black
#!/bin/bash -e
#
# Copyright (c) 2012-2013 Robert Nelson <robertcnelson@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@sevastos
sevastos / aws-multipartUpload.js
Last active October 8, 2023 10:43
Example AWS S3 Multipart Upload with aws-sdk for Node.js - Retries to upload failing parts
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload
var fs = require('fs');
var AWS = require('aws-sdk');
AWS.config.loadFromPath('./aws-config.json');
var s3 = new AWS.S3();
// File
var fileName = '5.pdf';
var filePath = './' + fileName;
var fileKey = fileName;
@justinledwards
justinledwards / dpkg log
Last active December 27, 2015 17:39
debian installed packages for beaglebone black
root@arm:~# dpkg --get-selections
adduser install
apache2 install
apache2-mpm-worker install
apache2-utils install
apache2.2-bin install
apache2.2-common install
apt install
apt-utils install
aptitude install
@juliangruber
juliangruber / README.md
Last active March 24, 2021 02:00
lightweight node-websocketd

node-websocketd

A lightweight node port of websocketd, originally written in go.

Usage

node-websocketd --port=8080 ./count.sh
@johnantoni
johnantoni / startup_mailer.py
Created December 31, 2013 16:21
raspberry pi - send email on startup (will need gmail account to send from)
import subprocess
import smtplib
import socket
from email.mime.text import MIMEText
import datetime
# Change to your own account information
to = 'me@example.com'
gmail_user = 'test@gmail.com'
gmail_password = 'yourpassword'
smtpserver = smtplib.SMTP('smtp.gmail.com', 587)
@davidkelley
davidkelley / gist:9002267
Last active January 27, 2020 08:43
Example showing how to connect with a USB device using Javascript. Note that this file uses the chrome.usb.* API's which are only available for "packaged app" Chrome extensions.
var port = 0;
var endpoint = 0x01;
var device = { vendorId: 0x04b8, productId: 0x0202};
var connect = function(callback) {
chrome.permissions.getAll(function(p) {
if (p.permissions.indexOf('usb') >= 0) {
//construct permission object for our device
var obj = { usbDevices: [device] };
wget https://raw.github.com/gkaindl/beaglebone-ubuntu-scripts/master/bb-get-rcn-kernel-source.sh
chmod +x bb-get-rcn-kernel-source.sh
./bb-get-rcn-kernel-source.sh
@DiegoTc
DiegoTc / CARD_CD_code.js
Last active October 15, 2019 04:19
Blinking a LED with BeagleBone Black
var b = require('bonescript');
var led = "P8_10";
var state = 0;
b.pinMode(led, 'out');
toggleLED = function() {
state = state ? 0 : 1;
b.digitalWrite(led, state);
};
@brenopolanski
brenopolanski / merge-pdf-ghostscript.md
Last active May 2, 2024 06:56
Merge multiple PDFs using Ghostscript

A simple Ghostscript command to merge two PDFs in a single file is shown below:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Install Ghostscript:

Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.

@deepakkarki
deepakkarki / pru_api.py
Created June 10, 2014 17:19
1st iteration of the PRU Speak API
import pru_speak
botspeak_code = \
''' SET DIO[0] , 1
WAIT 1
SET DIO[0], 0
WAIT 1
GOTO 0'''
pru_speak.load(botspeak_code)