Skip to content

Instantly share code, notes, and snippets.

View yoimbert's full-sized avatar

yoimbert yoimbert

View GitHub Profile
@yoimbert
yoimbert / ledsametime.lua
Last active February 20, 2017 21:30
LedDuo HC2 Fibaro
-- Click Add scene from the menu on the left.
-- Give you scene a name and select the room it applies to.
-- Since this scene will only be run automatically, change the Show the scene in interfaces? box to No.
-- Click the Advanced tab.
-- Select the second Save button – in the Lua section.
-- Type in the code above. (Hint: You can double click the code and cut and paste it in).
-- Change the device ID on lines 3, 4 and 8 from 81 to the ID of the master RGBW controller.
-- Change the device ID on line 9 to the ID of the slave RGBW controller.
-- Click the blue save button on the right side popup menu.
-- http://www.fibarouk.co.uk/synchronising-rgbw-modules/
@yoimbert
yoimbert / setTimeout.lua
Created February 18, 2017 22:05
setTimeout
HC2 version 4 has a new primitive for timing: setTimeout() with arguments "function" and "time in ms". I's available in scenes, but it's not in Virtual Devices. Here's an example, starting from a script based on sleep:
ID=207
fibaro:sleep(1000)
fibaro:call(ID, "turnOn")
fibaro:sleep(2000)
fibaro:call(ID, "turnOff")The semantics of "setTimeout" are different. It means "Schedule this function to run after this time interval has elapsed".
@yoimbert
yoimbert / apilist.txt
Created January 13, 2017 09:33
list api Fibaro HC2
Signification des variables :
<LOGIN> = L'utilisateur autorisé à effectuer l'action (ex: admin)
<PASS> = Votre mot de passe
<IP> = L'adresse IP de votre Home Center, il est donc nécessaire de lui attribuer une IP fixe (via la rédervation de bail de votre box / routeur Internet)
<ID> = identifiant du module Z-Wave (comment trouver l'ID d'un module ?)
name = action (ex: turnOff, turnOn, setValue)
<Value> = valeur (ex: niveau de variation à 39 % --> arg1=39 )
Exemples :
@yoimbert
yoimbert / keybase.md
Created January 10, 2017 16:44
keybase.md

Keybase proof

I hereby claim:

  • I am yoimbert on github.
  • I am yoim (https://keybase.io/yoim) on keybase.
  • I have a public key whose fingerprint is 3206 CC72 F0AD 1F13 67BD F7E0 85FC 2BA3 3764 B1B8

To claim this, I am signing this object:

@yoimbert
yoimbert / crontabdate
Last active November 3, 2020 18:02
crontab_date
01 * * * * root echo "cette commande est exécutée toutes les heures passées d'une minute"
17 8 * * * root echo "Cette commande est exécutée tous les jours à 08h17"
17 20 * * * root echo "Cette commande est exécutée tous les jours à 20h17"
00 4 * * 0 root echo "Cette commande est exécutée tous les dimanches à 4h00"
42 4 1 * * root echo "Cette commande est exécutée tous les 1er du mois à 4h42"
00 23 * * 1,3,5 root echo "Cette commande est exécutée tous les lundi, mercredi, vendredi de chaque semaines à 23h00"
01 * 19 07 * root echo "Cette commande est exécutée toutes les heures passées d'une minute tous les 19 Juillet"
http://hardware-libre.fr/2014/03/8-exemples-pour-maitriser-linux-cron/
@yoimbert
yoimbert / pwdphp
Created June 30, 2016 08:14
dir php
<?php
// dossier courant
echo getcwd() . "\n";
chdir('cvs');
// dossier courant
echo getcwd() . "\n";
@yoimbert
yoimbert / letsencrypt
Last active April 26, 2016 22:18
letsencrypt_install
SSH to your instance
ssh -i <path_to_key_file.pem> ubuntu@<public_ip_address>
Note: You may replace with domain name if your DNS has resolved.
Clone the letsencrypt repository from github. (If it is available via a package manager, you may use that).
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
This will copy the letsencypt repository to /opt/letsencrypt
Confirm no applications are listening to port 80:
netstat -na | grep ':80.*LISTEN'
If any processes are returned, kill them.
Get Certificate from Let's Encrypt
@yoimbert
yoimbert / Shrinking Header: Nightly.markdown
Created February 15, 2016 22:01
Shrinking Header: Nightly
@yoimbert
yoimbert / applescriptreboot
Created November 23, 2015 16:46
applescriptreboot
do shell script "shutdown -r now" user name "user" password "password" with administrator privileges
@yoimbert
yoimbert / mysqlpassword
Created November 9, 2015 14:51
password mysql
mysqladmin -u root -p password 'monnouveaumotdepasse'
Enter password:OLDPASSWORD