Skip to content

Instantly share code, notes, and snippets.

View mpentler's full-sized avatar

Mark Pentler mpentler

View GitHub Profile
@mpentler
mpentler / boincstatus.sh
Created May 11, 2018 18:17
Simple script for a shorter, more useful BOINC status output. Plus a temperature readout!
!/bin/sh
echo "Current BOINC status:\n"
output=$(boinccmd --get_state | sed -n -e '/======== Tasks ========/,$p' | head -n -17)
echo "$output"
echo "\n $(boinccmd --get_state | grep -c active_task_state) tasks running:\n"
boinccmd --get_state | grep active_task_state
echo "\nCPU Temp: $(vcgencmd measure_temp | cut -d "=" -f 2)"
c = 33313552017317510057480429807191513781560058913982045828821573360115041698572293368677814047055248844068758060891046601601923786757545000748868407887139102932189242384290168374262947094252294487798373472224578486694039636927104808579329053474121672431941292997540298195365595309282858493105333766871550453
n = 112844860286954432023527367807878149508433045460166798540067347297771292932276845482784411114349669858383468974822784047292525847593138653258906565706208925369627344743018629414710772644379028885399261868138745339538284054287450499199325709844121836918861140479086394315063831615503697572215910036672241273
e = 65537
primes = (2267190209, # obtain from factordb.com
2397761813,
2536127557,
2634219361,
2652518087,
2677343507,
2678478181,
#include <avr/sleep.h>
#include <avr/interrupt.h>
#include <avr/io.h>
uint8_t LEDpin = PB0; // start on green LED
void setup() {
// Configure our input and output pins
DDRB = 0b00000111; // PB0-2 as inputs, leave PB3 (4th bit) as output (0)
PORTB |= (1 << PB3); // enable the pull-up resistor on PB3
#include <avr/sleep.h>
#include <avr/interrupt.h>
#include <avr/io.h>
uint8_t LEDpin = PB0; // start on green LED
void setup() {
// Configure our input and output pins
DDRB = 0b00000111; // PB0-2 as inputs, leave PB3 (4th bit) as output (0)
PORTB |= (1 << PB3); // enable the pull-up resistor on PB3
#include <avr/sleep.h>
#include <avr/interrupt.h>
int LEDpin = PB0; // start on green LED
void setup() {
// Configure our input and output pins
DDRB = 0b00000111; // PB0-2 as inputs, leave PB3 (4th bit) as output (0)
PORTB |= (1<<PB3); // enable the pull-up resistor on PB3
#include <avr/sleep.h>
#include <avr/interrupt.h>
const int redLED = PB2; // Define the LED pins
const int yellowLED = PB1;
const int greenLED = PB0;
int LEDpin = greenLED; // start on green LED
void setup() {
#include <avr/sleep.h>
#include <avr/interrupt.h>
const int switchPin = 3; // Define our button pin
const int redLED = 2; // Now the LED pins
const int yellowLED = 1;
const int greenLED = 0;
int LEDpin = greenLED; // start on green LED
// Conference Mood Badge - Mark Pentler 2020
// Tested with: ATTiny85 and 13
//
#include <avr/sleep.h>
#include <avr/interrupt.h>
#include <avr/io.h>
uint8_t LEDpin = PB0; // start on green LED
void setup() {
#include <avr/io.h>
#include <util/delay.h>
int ledPWM1 = 0;
int ledPWM2 = 1;
void setup() {
DDRB = 0b00011111;
PORTB = 0b00011100;
int ledPWM1 = 0;
int ledPWM2 = 1;
void setup() {
pinMode(ledPWM1, OUTPUT);
pinMode(ledPWM2, OUTPUT);
}
void loop() {
analogWrite(ledPWM1, random(50, 120));