Skip to content

Instantly share code, notes, and snippets.

View milan1267's full-sized avatar

Milan Jain milan1267

  • IIIT Delhi
  • Delhi
View GitHub Profile
1371317400 2013-06-15 23:00:00 25.0 100
1371317400 2013-06-15 23:00:00 25.0 100
1371317400 2013-06-15 23:00:00 25.0 100
1371317400 2013-06-15 23:00:00 25.0 100
1371319200 2013-06-15 23:30:00 25.0 100
1371319200 2013-06-15 23:30:00 25.0 100
1371319200 2013-06-15 23:30:00 25.0 100
1371321000 2013-06-16 00:00:00 25.0 100
1371321000 2013-06-16 00:00:00 25.0 100
1371321000 2013-06-16 00:00:00 25.0 100
1371320340 2013-06-15 23:49:00 25 100
1371407460 2013-06-17 00:01:00 25 100
1371408060 2013-06-17 00:11:00 25 100
1371408660 2013-06-17 00:21:00 25 100
1371409260 2013-06-17 00:31:00 25 100
1371409860 2013-06-17 00:41:00 25 100
1371410460 2013-06-17 00:51:00 25 100
1371411060 2013-06-17 01:01:00 25 100
1371411720 2013-06-17 01:12:00 25 100
1371412320 2013-06-17 01:22:00 25 100
import matplotlib.pyplot as plt
import matplotlib.dates as md
import numpy as np
import datetime as dt
import time
data = np.genfromtxt('/home/milan/Projects/Summer_Project/AC/Data/data_1.csv',delimiter=',',names=['time1','date','temperature','humidity'])
#data2 = np.genfromtxt('/home/milan/Projects/Summer_Project/AC/Data/data_2.csv',delimiter=',',names=['time2','power'])
time = data['time1']
humidity = data['humidity']
APPKEY = "er38w9t3fqv4z56dch97d4un"
CITY = "New Delhi"
FORMAT = "json"
BASE_URL = "http://api.worldweatheronline.com/free/v1/weather.ashx"
REQUEST_URL = BASE_URL+"?q=%s&format=%s&key=%s" %(CITY,FORMAT,APPKEY)
import requests
import datetime
json_data=requests.get(REQUEST_URL).json()
@milan1267
milan1267 / ping_test
Created May 17, 2013 07:49
To Ping the Network
#!/bin/sh
NUMBER_OF_PING_REQUESTS=4
ROUTER_ADDRESS="192.168.0.1"
SLEEP_TIME=900
while true
do
PACKETS_RECEIVED=`ping -c $NUMBER_OF_PING_REQUESTS $ROUTER_ADDRESS | grep "received" | awk '{print $4}'`
if [ $PACKETS_RECEIVED -eq 0 ]