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 os | |
import pytz | |
import sys | |
import datetime | |
import dateutil.parser | |
import boto | |
downloadFolder = "downloads" | |
if len(sys.argv) > 1: |
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 time | |
import socket | |
def collect_metric(name, value, timestamp): | |
sock = socket.socket() | |
sock.connect( ("localhost", 2003) ) | |
sock.send("%s %d %d\n" % (name, value, timestamp)) | |
sock.close() | |
def now(): | |
return int(time.time()) |
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
sshfs [email protected]:/home/username /mnt/mountname -p 1234 -o allow_other -o IdentityFile=/home/mendhak/Documents/keys/id_rsa | |
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
public static class DataRecordExtensions | |
{ | |
public static T GetValue<T>(this IDataRecord reader, string columnName) | |
{ | |
object columnValue = reader[columnName]; | |
T returnValue = default(T); | |
if (!(columnValue is DBNull)) | |
{ | |
returnValue = (T)Convert.ChangeType(columnValue, typeof(T)); | |
} |
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
public static T GetValue<T>(this DataRow row, string field) | |
{ | |
if (!row.Table.Columns.Contains(field)) | |
{ | |
return default(T); | |
} | |
else | |
{ | |
return (T)Convert.ChangeType(row[field].ToString(), typeof(T)); |
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
#!/usr/bin/env python | |
""" | |
StarHScale a Horizontal slider that uses stars | |
Copyright (C) 2006 Mark Mruss <[email protected]> | |
This library is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Lesser General Public | |
License as published by the Free Software Foundation; either |
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
public static String GetUrl(String url) throws Exception | |
{ | |
URL serverAddress = null; | |
HttpURLConnection connection = null; | |
// OutputStreamWriter wr = null; | |
BufferedReader rd = null; | |
StringBuilder sb = null; | |
String line = null; | |
try |
NewerOlder