Skip to content

Instantly share code, notes, and snippets.

View maditnerd's full-sized avatar

Rémi Sarrailh maditnerd

View GitHub Profile
@maditnerd
maditnerd / gist:4116427
Created November 20, 2012 06:41
exempleerreurmagpi1
#Code officiel du MagPi
#!/usr/bin/python
import time
import RPi.GPIO as GPIO
#Il manque une ligne pour que ça marche GPIO.setmode(GPIO.BCM)
GPIO.setup(11, GPIO.IN)
while True:
#/bin/bash
interfaces=$(ifconfig |grep "Link"|awk '{print $1}')
interface=$(whiptail --inputbox "Listes des cartes reseaux\n-----------\n$interfaces" 0 0 "eth0" 3>&1 1>&2 2>&3)
ipaddress=$(ifconfig $interface|head -n2|tail -n1|awk '{print $2}'|sed -e 's/'addr:'//'|sed -e 's/'adr:'//');
netmask=$(ifconfig $interface |head -n2|tail -n1|awk '{print $4}'|sed -e 's/'Mask:'//'|sed -e 's/'Masque:'//')
broadcast=$(ifconfig $interface |head -n2|tail -n1|awk '{print $3}'|sed -e 's/'Bcast:'//')
gateway=$(route |grep "default" |awk '{ print $2 }')
@maditnerd
maditnerd / vnc
Created December 20, 2012 22:03
Installe un serveur VNC cd /tmp wget smarturl.it/vnc chmod +x /tmp/vnc ./vnc
#/bin/bash
if [ $(id -u) -ne 0 ]; then
printf "Script must be run as root. Try 'sudo bash'\n"
exit 1
fi
echo "Installation d'un serveur VNC sur la machine"
apt-get install tightvncserver
@maditnerd
maditnerd / default.css
Created January 30, 2013 16:39
an exemple of default.css in parsimony
form{}
form div {}
label
{
display:block;
font-size : 20px ;
margin : 0 ;
padding : 5px 0 ;
color : #474242 ;
}
function wysiwyg() {
this.currentElmt;
this.toolbar;
this.toolbarWidgets;
this.widgets = [];
this.selector;
this.toolbarDocument;
this.currentDocument;
this.enable;
@maditnerd
maditnerd / install.php
Created February 3, 2013 12:48
Database Error Notifications (parsimony)
<?php
/**
* Parsimony
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
// scs3060f.cpp
//
// To compile this: gcc -o scs3060f scs3060f.cpp
// This program can be use to control SCS 3060f Remote Controlled Outlet
// By default you'll need a 433.92Mhz transmitter at GPIO 7 on your Raspberry PI
// Ce programme permet de controler des prises radio commandees SCS3060f
// Vous pouvez les acheter ici:
// http://scs-laboutique.com/Electricite/Commande+a+distance/prise+int+ext/3063+f+3600w+kit+3+prises+telecommandees+3600w+1+telecommande-566
//
@maditnerd
maditnerd / wiringpi_install.sh
Last active December 15, 2015 08:08
Script to install WiringPi on the raspberry Pi
#!/bin/sh
echo "Installing git-core to download wiringpi"
apt-get install git-core
echo "Downloading wiringpi"
cd /home/pi/Desktop
git clone git://git.drogon.net/wiringPi
echo "Building wiringpi"
/*
emetteur.c
Ce programme permet de controler des prises SCS
Copyright (c) 2013 Sarrailh Remi
Ce programme est sous licence GPLv3 pour plus de detail:
http://www.gnu.org/licenses/gpl.html
Vous devez installer WiringPi avant pour cela tapez ces commandes:
-------------------------------------------------------------------
0100 est le code de vérification
1 = 0 SUR 10
2 = 0 SUR 12
3 = 0 SUR 14
4 = 0 SUR 16
I = 10
1 1