Skip to content

Instantly share code, notes, and snippets.

@carlynorama
carlynorama / BeeMail Code, First Circuit Test
Created January 29, 2014 17:34
This gist is a snapshot of code in the BeeMail repository written January 28th to 29th 2014
//This code is testing code for the circut to make sure all of the
//physical Arduino I/O is working. It checks a potentiometer or other
//sensors on the AO PIN and equates it to the future number of mails
//in the inbox.
//------------------------------------------------- OUTPUTS AND THEIR VARIABLES
int beePins[beeTotalNumber] = {9, 10, 11 };
//INPUTS AND THEIR VARIABLES
int howManyNewEmails = 0;
@carlynorama
carlynorama / remove_new_files
Created February 15, 2014 22:45
Finding files that are too new (less than a year old) and removing them.
# (find) in this directory (.) items of (-type) file (f) whose last modification (-mtime) was less than 365 days ago (-365)
# pipe the result into a file called newfiles.txt
find . -type f -mtime -365 > newfiles.txt
#look at newfiles.txt
cat newfiles.txt
#if everything listed is a malicious file
#run the find again, but instead of outputing to file
#run as a subprocess (-exec) the remove command (rm) on each result ({})
@carlynorama
carlynorama / TestCodeFor3Motors
Created February 27, 2014 19:24
This code is testing code for the circuit to make sure all of the //physical Arduino I/O is working. It checks a potentiometer or other sensor on the AO PIN and equates it to the future number of mails in the inbox. On each pin 9, 10 and 11 are 220 Ohm resistors leading to the bases of PN2222A transistors. The collector is attached to the motor …
//------------------------------------------------------------ START LICENSE
/*The MIT License (MIT)
Copyright (c) 2014 Carlyn Maw
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
@carlynorama
carlynorama / createTestFiles.sh
Last active August 29, 2015 13:56
These are the commands for creating SD Library test files on the Intel Galileo main file structure.
#commands once logged in to the Intel Galileo Board
#I ran to create test files.
df -h
cd /media/realroot
ls -l
echo "go away" > deleteMe_01.txt
cat deleteMe_01.txt
echo "go away" > deleteMe_02.txt
echo "go away" > deleteMe_03.txt
echo "go away" > deleteMe_04.txt
@carlynorama
carlynorama / IntelGalileoConnectionSettings.stc
Created March 10, 2014 23:12
CoolTerm Settings for IntelGalileo
Port = YOURPORT
BaudRate = 115200
DataBits = 8
Parity = N
StopBits = 1
FlowControlCTS = false
FlowControlDTR = false
FlowControlXON = false
DTRDefaultState = true
RTSDefaultState = true
@carlynorama
carlynorama / test_return18.py
Created March 11, 2014 01:14
Always returns the number 18 for checking whether a Python script call is working.
# Returns 18
# Place this file in the top level of your Galileo's SD card.
print len("I should return 18")
//detivative of code posted here: https://www.sparkfun.com/news/1360
//discussion of project here: http://blog.carlynorama.com/tag/intelgalileo/
//RELEVANT CHANGES FROM OC COMMENTED IN ALL CAPS
int getEmailCount()
{
//SAME VARIABLES
int digits = 0;
char temp[10];
int emailCnt = 0;
@carlynorama
carlynorama / excel_formulas_for_grading.txt
Created May 8, 2014 15:07
Excel Formulas for Grading
#for translating letter grades when the students number grade is in cell
#A9 and there are named cells (coA, coB, coC, coD) with the cutoffs
=IF($A$9>=coA,"A",IF($A$9>=coB,"B",IF($A$9>=coC,"C",IF($A$9>=coD,"D","F"))))
@carlynorama
carlynorama / python_virtualenv_setup.sh
Last active August 29, 2015 14:03
How to set up a new django project on a mostly fresh install of Mac OSX
#!/bin/sh
#assumes Xcode/gcc and FireFox installed
#install hombrew
#ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
#brew doctor
brew install python3 #includes pip3
pip3 install virtualenv
mkdir -p ~/$PATH/$SITENAME
mkdir -p ~/$PATH/$SITENAME/database
@carlynorama
carlynorama / create_django_branch.sh
Last active August 29, 2015 14:03
How to connect to the repo July 14 2014
#assumes Mac OS X 10.9 with Xcode Command line tools and FireFox installed
#install hombrew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew doctor
#install python 3 in homebrew's path and get virtualenv for it
brew install python3 #includes pip3
pip3 install virtualenv
#------ MICHELLE START HERE ---------------#