This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ftplib | |
import os | |
import fileinput | |
import csv | |
# col1 = url (google.com), col2 = ftp host, col3 = ftp user, col4 = ftp password | |
with open('ftp.csv', 'rb') as csvfile: | |
ftp_records = csv.reader(csvfile, delimiter=',') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copy securelly file between folders | |
sudo rsync -vaE --progress /Volumes/source /Volumes/destination |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The library for the SIM900/908 Shield by Futura Elettronica from gsmlib.org have the char "time" output in this format: "20150226193522.001" | |
This is a sketch for split the char "time" values like this: 2015 (year) 02 (month) 26 (day) 19 (hours) 35 (minutes) 22 (seconds). | |
The part ".001" not needed. | |
This is the version that use "sscanf" method. | |
Thanks to: jurs from arduino.cc forum: http://forum.arduino.cc/index.php?topic=303515 | |
Arduino GSM GPRS and GPS Shield from Futura Elettronica: http://www.open-electronics.org/gsm-gps-shield-for-arduino/ | |
Library for the Shield: http://www.gsmlib.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The library for the SIM900/908 Shield by Futura Elettronica from gsmlib.org have the char "time" output in this format: "20150226193522.001" | |
This is a sketch for split the char "time" values like this: 2015 (year) 02 (month) 26 (day) 19 (hours) 35 (minutes) 22 (seconds). | |
The part ".001" not needed. | |
This is the version that use a generic splitting method. | |
Thanks to: KenF from arduino.cc forum: http://forum.arduino.cc/index.php?topic=303515 | |
Arduino GSM GPRS and GPS Shield from Futura Elettronica: http://www.open-electronics.org/gsm-gps-shield-for-arduino/ | |
Library for the Shield: http://www.gsmlib.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ip = explode(".", $_SERVER['REMOTE_ADDR']); // Save in the array "ip" the octects of the ip | |
if ($ip[0] == 192) { // read the first octect, and for example, if you are from the internal lan, where the pc's ip start with "192" redirect to "index_lan.html" | |
header("location: index_lan.html"); | |
} | |
else { // if the ip doesn't start with 192, redirect to "index_wan.html" | |
header("location: index_wan.html"); | |
}; |