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
#----------------------------------------------------------------------------------------------------# | |
# basic IoT-Chat app on Pubnub with latest Python SDK # | |
# import function from standard librairy section: PubNub # | |
#----------------------------------------------------------------------------------------------------# | |
from pubnub.callbacks import SubscribeCallback | |
from pubnub.enums import PNStatusCategory | |
from pubnub.pnconfiguration import PNConfiguration | |
from pubnub.pubnub import PubNub | |
from threading import Thread | |
#----------------------------------------------------------------------------------------------------# |
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
# ------------------------------------------------------------------------------------------ # | |
# This script is used to monitor the status of a door with a Raspberry Pi 3 Mobel B # | |
# and send an email when the door is opened or closed # | |
# ------------------------------------------------------------------------------------------ # | |
#!/bin/bash | |
echo "4" > /sys/class/gpio/export | |
echo "in" > /sys/class/gpio/gpio4/direction | |
# create an infinite loop inside wwhich operations will be done | |
# to continuously check for door status and send notifications |
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
# -------------------------------------------------------------------------------------------- # | |
# Config file for sSMTP sendmail # | |
# -------------------------------------------------------------------------------------------- # | |
# The person who gets all mail for userids < 1000 | |
# Make this empty to disable rewriting. | |
#root=postmaster | |
# The place where the mail goes. The actual machine name is required no | |
# MX records are consulted. Commonly mailhosts are named mail.domain.com |
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
using System; | |
namespace HelloWorld | |
{ | |
class helloWorld | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Hello World, This is my first C# program"); | |
Console.ReadKey(); |
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
using System; | |
namespace InheritanceExample | |
{ | |
public class humanBeing | |
{ | |
public humanBeing() | |
{ | |
Console.WriteLine("Calling the human being class constructor"); | |
} |
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
using System; | |
namespace polymorphismExample | |
{ | |
public class Numbers | |
{ | |
public void addition(int a, int b) | |
{ | |
Console.WriteLine(a + b); | |
} |
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
using System; | |
namespace polymorphismExample | |
{ | |
public class parentClass | |
{ | |
public virtual void Display() | |
{ | |
Console.WriteLine("Hello! My name is Yann!"); | |
} |
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 -e | |
# | |
# rc.local | |
# | |
# This script is executed at the end of each multiuser runlevel. | |
# Make sure that the script will "exit 0" on success or any other | |
# value on error. | |
# | |
# In order to enable or disable this script just change the execution |
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
# ------------------------------------------------------------------------------------- # | |
# This script is used to check the status of the doorStatus script # | |
# ------------------------------------------------------------------------------------- # | |
#!/bin/bash | |
while true; | |
do | |
# start doorStatus script and output error to a text file | |
# the '&'' puts the process into the background, so the script goes to the next line | |
bash /home/pi/Desktop/MyScripts/doorStatus.sh & |
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
# -------------------------------------------------------------------------------------------------------------------------- # | |
# This script below will email a time & date stamped photo # | |
# -------------------------------------------------------------------------------------------------------------------------- # | |
#!/bin/bash | |
# create an infinite loop inside wwhich operations will be done | |
# to continuously check for door status and send notifications | |
while true; | |
do |
OlderNewer