Install some needed libraries
sudo aptitude install libmpc-dev
Make the temp directory to build in
mkdir toolchain
cd toolchain
Get the required sources
<?php | |
$max_file_size = 5*1024*1024; //5MB | |
$path = "admin/upload/"; // Upload directory | |
//$count = 0; // nr.successfully uploaded files | |
$valid_formats = array("rar","zip","7z","pdf","xlsx","xls","docx","doc","txt"); | |
$valid_formats_server = array( | |
"application/pdf", | |
"application/octet-stream", |
<?php | |
/* | |
* PHP Example for Google Storage Up- and Download | |
* with Google APIs Client Library for PHP: | |
* https://github.com/google/google-api-php-client | |
*/ | |
include( "Google/Client.php" ); | |
include( "Google/Service/Storage.php" ); |
Install some needed libraries
sudo aptitude install libmpc-dev
Make the temp directory to build in
mkdir toolchain
cd toolchain
Get the required sources
#!/bin/bash | |
mkdir toolchain | |
cd toolchain | |
wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz | |
wget http://ftp.gnu.org/gnu/gdb/gdb-7.2.tar.gz | |
wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2 | |
wget http://ftp.gnu.org/gnu/gcc/gcc-4.6.0/gcc-core-4.6.0.tar.bz2 |
// C++ includes used for precompiling -*- C++ -*- | |
// Copyright (C) 2003-2013 Free Software Foundation, Inc. | |
// | |
// This file is part of the GNU ISO C++ Library. This library is free | |
// software; you can redistribute it and/or modify it under the | |
// terms of the GNU General Public License as published by the | |
// Free Software Foundation; either version 3, or (at your option) | |
// any later version. |
#define _CRT_SECURE_NO_WARNINGS | |
#include <map> | |
#include <set> | |
#include <queue> | |
#include <stack> | |
#include <bitset> | |
#include <time.h> | |
#include <string> | |
#include <vector> | |
#include <math.h> |
<?php | |
// DEFINE our cipher | |
define('AES_256_CBC', 'aes-256-cbc'); | |
// Generate a 256-bit encryption key | |
// This should be stored somewhere instead of recreating it each time | |
$encryption_key = openssl_random_pseudo_bytes(32); | |
// Generate an initialization vector | |
// This *MUST* be available for decryption as well |
<?php | |
function get_ip_address() { | |
$ip_keys = array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'); | |
foreach ($ip_keys as $key) { | |
if (array_key_exists($key, $_SERVER) === true) { | |
foreach (explode(',', $_SERVER[$key]) as $ip) { | |
// trim for safety measures | |
$ip = trim($ip); | |
// attempt to validate IP | |
if (validate_ip($ip)) { |
#include <Wire.h> | |
byte i2cdata[4]; | |
void setup() { | |
Wire.begin(); | |
Serial.begin(9600); | |
} | |
void loop() { |