Webcam is connected to Raspberry Pi. This flow is written on Raspberry Pi. It captures an image every 3 hours and tweets it to your Twitter account.
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
#generate server and client keystore | |
keytool -genkeypair -alias server -keyalg RSA -dname "CN=Server,OU=Development,O=Test,L=Shanghai,S=SH,C=CN" -keystore server.keystore | |
keytool -genkeypair -alias client -keyalg RSA -dname "CN=Client,OU=Development,O=Test,L=Shanghai,S=SH,C=CN" -keystore client.keystore | |
keytool -list -keystore server.keystore | |
#copy server certificate into client.keystore | |
keytool -exportcert -alias server -file server-pub.cer -keystore server.keystore | |
keytool -importcert -alias server -file server-pub.cer -keystore client.keystore | |
keytool -list -keystore client.keystore |
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 | |
# Generates a SSL certificate, java-ready with the hardcoded ips and name. | |
# Change varibale names to suit your need, you can do JAVA_HOME=$JAVA_HOME too. | |
JAVA_HOME=/usr/lib/jvm/java-8-oracle | |
CERT_NAME="yurimdias" | |
STOREPASS="changeit" | |
KEYSTORE=$JAVA_HOME/jre/lib/security/cacerts | |
CERTIFICATE_PATH=./$(echo $CERT_NAME) |
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 <NewPing.h> | |
#define TRIGGER_PIN 12 // Arduino pin tied to trigger pin on the ultrasonic sensor. | |
#define ECHO_PIN 11 // Arduino pin tied to echo pin on the ultrasonic sensor. | |
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm. | |
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance. | |
void setup() { | |
Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results. |
#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
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/sh | |
# listppa Script to get all the PPA installed on a system ready to share for reininstall | |
# From: http://askubuntu.com/questions/148932/how-can-i-get-a-list-of-all-repositories-and-ppas-from-the-command-line | |
for APT in `find /etc/apt/ -name \*.list`; do | |
grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do | |
USER=`echo $ENTRY | cut -d/ -f4` | |
PPA=`echo $ENTRY | cut -d/ -f5` | |
echo sudo apt-add-repository ppa:$USER/$PPA | |
done |
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
firefox australis | |
sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa | |
sudo apt-get install firefox-trunk | |
sublimetext | |
sudo add-apt-repository ppa:webupd8team/sublime-text-2 | |
sudo apt-get install sublime-text | |
Java Installer | |
sudo add-apt-repository ppa:webupd8team/java |
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
@echo off | |
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f |