Skip to content

Instantly share code, notes, and snippets.

Avatar

Stephen Chisholm sbchisholm

View GitHub Profile
View ds214-ipkg-install
# How to install `ipkg` on a Synology DS214
After a couple of days of trying to get `ipkg` woking on my DS214 I found [this article](https://github.com/trepmag/ds213j-optware-bootstrap) by [trepmag](https://github.com/trepmag). It is written for the DS213j, but it’s been working for me and [others](https://github.com/alberthild) for the DS214 too.
I have done some minor changed to clarify some things, but if you are a Linux guy (unlike me) my changes might be of no use to you.
## Guide
@sbchisholm
sbchisholm / api_gateway.tf
Created Jan 28, 2019
API Gateway/Lambda Example
View api_gateway.tf
resource "aws_api_gateway_rest_api" "example" {
name = "ServerlessExample"
description = "Terraform Serverless Application Example"
}
resource "aws_api_gateway_resource" "proxy" {
rest_api_id = "${aws_api_gateway_rest_api.example.id}"
parent_id = "${aws_api_gateway_rest_api.example.root_resource_id}"
path_part = "{proxy+}"
}
View clang-format
$ cat test.cpp
size_t tempYLTFileCount =
Helpers::getFiles(m_pvSimulatedUnsortedYLTFilePattern,
regex(".*~", regex::basic)).size() +
Helpers::getFiles(m_lvSimulatedUnsortedYLTFilePattern,
regex(".*~", regex::basic)).size();
$ clang-format-3.7 -style=google test.cpp
size_t tempYLTFileCount = Helpers::getFiles(m_pvSimulatedUnsortedYLTFilePattern,
View msnow.jl
function msnow()
t = time()
tm = Libc.TmStruct(t)
DateTime(tm.year+1900,tm.month+1,tm.mday,tm.hour,tm.min,tm.sec,round(Int64,t*1000)%1000)
end
@sbchisholm
sbchisholm / config.json
Created Apr 8, 2013
backup configuration
View config.json
{
"backup_sources": [
"/home/username/Documents",
"/home/username/Mail"
],
"rsync_excludes": "",
"backup_server_location": "/mnt/backup",
"log_file": "log/backup.log",
"log_file_path_relative": true,
@sbchisholm
sbchisholm / backup.py
Last active Dec 15, 2015
Backs up the files/folders according to the configuration in config.json. Will send an reporting the success or failure of the rsyncs.
View backup.py
#!/usr/bin/python
#
# Backs up the files/folders according to the configuration in config.json. Will
# send an reporting the success or failure of the rsyncs.
import json, os, smtplib, ast, datetime
from email.mime.text import MIMEText
def email_backup_failures(config, failed_backups, failed = True):
# build message body
View gist:5326939
hardstatus alwayslastline "%{b}[%{B}%H%{b}][%{k}%?%-Lw%?%{b}(%{R}%n %t%?(%u)%?%{b})%{k}%?%+Lw%?%?%= %{b}][%{B}%d/%m %{k}%C%{b}]"
msgwait 1
vbell off
scrollback 3000
View circ_05.cpp
/* ---------------------------------------------------------
* | Arduino Experimentation Kit Example Code |
* | CIRC-05 .: 8 More LEDs :. (74HC595 Shift Register) |
* ---------------------------------------------------------
*
* We have already controlled 8 LEDs however this does it in a slightly
* different manner. Rather than using 8 pins we will use just three
* and an additional chip.
*
*
View .vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/Vundle.vim'
View Circut 2
int ledPins[] = {2,3,4,5,6,7,8,9};
int ledCount = 8;
void setup() {
for (int i = 0; i < ledCount; i++)
pinMode(ledPins[i], OUTPUT);
}
void loop() {
oneAfterAnotherNoLoop();
You can’t perform that action at this time.