This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 1. ss | |
# 2. Remove header | |
# 3. Only print ip | |
# 4. RegEx away port number | |
IPS=$(ss --tcp | tail -n +2 | awk '{ print $5 }' | sed -e 's/\(.*\):.*/\1/g') | |
COUNTRIES="" | |
for IP in $IPS; do | |
# 1. Geoiplookup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Record from mic | |
arecord -d 3 -f cd -t wav -r 16000 -c 1 -D pulse test.wav | |
# Get record volume | |
sox test.wav -n stats -s 16 2>&1 | grep 'Max level' | awk '{print $3}' | |
# Convert to flac for smaller footprint | |
flac -f test.wav | |
# Google speech recognition | |
LANG=en-us |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import socket | |
import subprocess | |
import os | |
import netifaces | |
debug = True | |
def start(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EventReceiver : public IEventReceiver | |
{ | |
public: | |
virtual bool OnEvent(const SEvent& event) | |
{ | |
return false; | |
} | |
}; | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int directionPin = 0; | |
int activationPin = 1; | |
boolean activationState = LOW; | |
boolean directionState = LOW; | |
int currentPosition = 0; | |
int maxPosition = 1; | |
void setup(){ | |
pinMode(directionPin, OUTPUT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <TimerOne.h> | |
boolean firstRun = true; // Used for one-run-only stuffs; | |
//First pin being used for floppies, and the last pin. Used for looping over all pins. | |
const byte FIRST_PIN = 2; | |
const byte PIN_MAX = 17; | |
#define RESOLUTION 40 //Microsecond resolution for notes | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int directionPin = 0; | |
int activationPin = 1; | |
int btnPin = 2; | |
int directionState = 0; | |
int btnState = 0; | |
int currentState = LOW; | |
int currentPosition = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool check_function(const char function_name[], const char input[]){ | |
int len = 0; | |
while (function_name[len] != NULL){ | |
len++; | |
} | |
if (strncmp(input, function_name, len) == 0) { | |
return true; | |
} | |
else { | |
return false; |