Skip to content

Instantly share code, notes, and snippets.

#include <user_config.h>
#include <SmingCore/SmingCore.h>
#include <Libraries/BMP180/BMP180.h>
#define WIFI_SSID "ekreative" // Put you SSID and Password here
#define WIFI_PWD "*******"
#define DOR_PIN 5
#define NARODM_HOST "narodmon.ru"
#define NARODM_PORT 8283
@avtehnik
avtehnik / gps.py
Last active November 21, 2015 18:12
u-blox neo-6
#!/usr/local/bin/python
import serial
import sys
from math import pow, degrees, radians, acos
from scipy import cos, sin, arctan, sqrt, arctan2
@avtehnik
avtehnik / message.json
Last active February 15, 2017 09:29
check free space and send email if not enough
{
"Data": "From: example@example.com\nTo: example@example.com\nSubject:Disk space filled up \nMIME-Version: 1.0\nContent-type: Multipart/Mixed; boundary=\"NextPart\"\n\n--NextPart\nContent-Type: text/plain\n\nThis is the email to notify that the space in the disc for the server has reached the its maximum. Please, take an action concerning the old logs..\n\n--NextPart"
}
<?php
$project = "mpm-serv";
$con=mysqli_connect("localhost","root","password");
function createUserAndDb($con, $proj, $type, $host = "localhost"){
$password = bin2hex(openssl_random_pseudo_bytes(10));
$user = "{$proj}-{$type}";
$userHost = "`{$user}`@`{$host}`";
$sql="CREATE USER {$userHost} identified by '{$password}'";
echo "env: $type".PHP_EOL;
@avtehnik
avtehnik / stream_to_youtube.sh
Created June 16, 2016 19:19 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
#!/usr/local/php5/bin/php
<?php
$domain = null;
if (array_key_exists('1', $argv)) {
$domain = $argv['1'];
$path = str_replace("\n","",`pwd` );
$temlate = <<<TEMPLATE
<VirtualHost *:80>
<?php
require_once 'vendor/autoload.php';
$files = scandir(__DIR__ . '/src/AppBundle/Entity/');
foreach ($files as $file) {
if (is_file(__DIR__ . '/src/AppBundle/Entity/' . $file)) {
require_once __DIR__ . '/src/AppBundle/Entity/' . $file;
}
}
#!/usr/local/php5/bin/php
<?php
// for mac put file to /usr/local/bin/normalizenames
// and chmod +x /usr/local/bin/normalizenames
// for use `normalizenames dirname` to normalize
$dir = str_replace("\n", "", `pwd`);
if (array_key_exists('1', $argv)) {
$path = $dir . '/' . $argv['1'];
if (is_dir($path)) {
<?php
mkdir(__DIR__.'/var/cache/dev',0777,true);
mkdir(__DIR__.'/var/cache/prod',0777,true);
mkdir(__DIR__.'/var/logs', 0777, true);
mkdir(__DIR__.'/var/sessions/prod', 0777, true);
file_put_contents(__DIR__.'/var/logs/prod.log','start');
file_put_contents(__DIR__.'/var/logs/dev.log','start');
chmod(__DIR__.'/var/logs/prod.log',0777);