Skip to content

Instantly share code, notes, and snippets.

Alexis AlexKovax

View GitHub Profile
@AlexKovax
AlexKovax / fakewebcam.sh
Created Jan 19, 2014
This basic shell script uses the raspistill command to take a shot with different settings depending on the time. It's made to be called using a crontab
View fakewebcam.sh
#!/bin/bash
#fakewebcam script
TIME=$(date +"%H")
DAY='10'
NIGHT='20'
if [ ${TIME} -ge ${DAY} -a ${TIME} -le ${NIGHT} ]; then
#echo "It's day!"
raspistill -q 90 -w 640 -h 480 -t 60 -o /var/www/webcam.jpg
else
@AlexKovax
AlexKovax / crontab
Created Dec 25, 2013
This is a crontab that uses a builtin Z-Way server and wget to do some basic home automation
View crontab
# Edit this file to introduce tasks to be run by cron.
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
@AlexKovax
AlexKovax / interfaces
Last active Jan 1, 2016
This is a simple conf file to set up the wireless adapter of a Raspberry Pi using Raspbian
View interfaces
#Basic /etc/network/interfaces file to access an encrypted AP
#Replace SSID by the name of the network the RPi must connect too
#Replace PASSWORD by the WPA password of the network
#loopback and ethernet
auto lo
iface lo inet loopback
iface eth0 inet dhcp
#wlan
@AlexKovax
AlexKovax / kkbb-extractor.php
Last active Dec 18, 2015
A quick function to extract the name of the contributors from a Kiss Kiss Bank Bank "contributors" page
View kkbb-extractor.php
<?php
//returns an array with the names extracted
function name_extractor($url){
$res=array();
$html = file($url);
foreach($html as $ligne)
if(preg_match("/class\=\"username\"\>(.+)\<\/a\>/",$ligne,$matches))
array_push($res,$matches[1]);
@AlexKovax
AlexKovax / flickr.html
Created Apr 20, 2013
This simple example shows you how to get the latest photos of any Flickr ID using an API call...
View flickr.html
<!DOCTYPE html>
<html>
<head>
<title>Flickr</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
//jsonFlickrFeed is the default callback function returned by flickr, let's use it...
You can’t perform that action at this time.