Skip to content

Instantly share code, notes, and snippets.

View Bouhnosaure's full-sized avatar
🎺
Doot Doot

Alex Bouhnosaure

🎺
Doot Doot
View GitHub Profile
#!/bin/bash
lftp ftp://user:[email protected] -e "set ftp:ssl-allow no; mirror -R /var/backup /backup ; quit"
# pour voir le dossier
# lftp ftp://user:[email protected] -e "set ftp:ssl-allow no;"
#!/bin/bash
#date du jour
DATE=`date +%y_%m_%d`
#liste des dossier
LISTEBDD=$( echo 'show databases' | mysql -uroot -pPWD )
for SQL in $LISTEBDD
PS1='\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]'
function scrollToAnchor(id){
var aTag = $("#"+id);
$('html,body').animate({scrollTop: aTag.offset().top - 50},'slow');
}
@Bouhnosaure
Bouhnosaure / brightmapreduce.js
Created May 25, 2015 20:44
couchdb map reduce brightness
//brightness : http://couchdb.ovh:5984/database/_design/mesures/_view/brightness?group=true
//map :
function(doc, req) {
var date = dateFromISO8601(doc.datetime);
emit(date.getDate(), doc.brightness);
int photocellPin = A1;
int photocellReading;
const int sensorPin = 0;
const int hydroAnalog = A2;
void setup(void) {
Serial.begin(9600);
}
@Bouhnosaure
Bouhnosaure / index.js
Last active November 6, 2015 12:43
require node-restler et node-serialport
var serialport = require("serialport");
var SerialPort = serialport.SerialPort;
var sp = new SerialPort("/dev/ttyACM0", { baudrate: 9600, parser: serialport.parsers.readline("\n\r") }, false);
var rest = require('restler');
var callback = function (error) {
if ( error ) {
console.log('failed to open: '+error);
int photocellPin = 0; // the cell and 10K pulldown are connected to a0
int photocellReading; // the analog reading from the analog resistor divider
void setup(void) {
// We'll send debugging information via the Serial monitor
Serial.begin(9600);
}
void loop(void) {
photocellReading = analogRead(photocellPin);
@Bouhnosaure
Bouhnosaure / gist:8173f85ddd4b056282bf
Created May 15, 2015 00:22
Addind Mailcatcher to debian
first install
apt-get install ruby rubygems ruby-dev libsqlite3-dev
gem install mailcatcher
puis ajouter un script pour le lancer
https://gist.github.com/Bouhnosaure/49d733254d11d4240364
nano /etc/init.d/mailcatcher
ne pas oublier de changer les ip pour les faire correspondre a l'ip du server
#!/bin/bash
PID_FILE=/var/run/mailcatcher.pid
NAME=mailcatcher
PROG="/usr/bin/env mailcatcher"
USER=mailcatcher
GROUP=mailcatcher
start() {
echo -n "Starting MailCatcher"