Skip to content

Instantly share code, notes, and snippets.

View level09's full-sized avatar
🌴
Always on vacation

Nidal Alhariri level09

🌴
Always on vacation
View GitHub Profile
@level09
level09 / gist:4721698
Created February 6, 2013 10:23
validate that file has finished transferring based on size
import os
from datetime import datetime
class FileValidator:
@staticmethod
def is_ready(file):
time_diff = (datetime.now() - datetime.fromtimestamp(os.path.getmtime(file))).seconds
if time_diff > 2:
print 'File %s is ready !' % os.path.basename(file)
return True
@level09
level09 / gist:4550839
Created January 16, 2013 20:51
static ip Configuration on linode
# The loopback interface
auto lo
iface lo inet loopback
# Configuration for eth0 and aliases
# This line ensures that the interface will be brought up during boot.
auto eth0 eth0:0
# eth0 - This is the main IP address that will be used for most outbound connections.
@level09
level09 / apche_vhost
Created January 16, 2013 19:21
Apache Vhost for Drupal
<VirtualHost *:80>
ServerName domain.com
DocumentRoot /path/to/root
ErrorLog path/to/error.log
CustomLog path/to/custom.log
<Directory "path/to/root">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
@level09
level09 / apache_vhost
Created January 16, 2013 19:21
Apache Virtual Host for Drupal
<VirtualHost *:80>
ServerName domain.com
DocumentRoot /path/to/root
ErrorLog path/to/error.log
CustomLog path/to/custom.log
<Directory "path/to/root">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Information is power. But like all power, there are those who want to keep it for themselves. The world’s entire scientific and cultural heritage, published over centuries in books and journals, is increasingly being digitized and locked up by a handful of private corporations. Want to read the papers featuring the most famous results of the sciences? You’ll need to send enormous amounts to publishers like Reed Elsevier.
There are those struggling to change this. The Open Access Movement has fought valiantly to ensure that scientists do not sign their copyrights away but instead ensure their work is published on the Internet, under terms that allow anyone to access it. But even under the best scenarios, their work will only apply to things published in the future. Everything up until now will have been lost.
That is too high a price to pay. Forcing academics to pay money to read the work of their colleagues? Scanning entire libraries but only allowing the folks at Google to read them? Providing scientific a
@level09
level09 / gist:4492677
Created January 9, 2013 12:13
GetFullAssetList filter
*** Outgoing SOAP ******************************************************
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>
<SOAP-ENV:Body>
@level09
level09 / gist:4475550
Created January 7, 2013 14:57
Incoming soap
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetAssetIdListResponse xmlns="/MSAssetControl">
<GetAssetIdListResult>
<string>MBCcapture_50e22e0f-1301071448</string>
<string>MBCcapture_50e22e0f-1301071445</string>
<string>MBCcapture_50e22e0f-1301071442</string>
<string>MBCcapture_50e22e0f-1301071439</string>
<string>MBCcapture_50e22e0f-1301071436</string>
@level09
level09 / gist:4475533
Created January 7, 2013 14:54
Outgoing soap
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>
<SOAP-ENV:Body>
<GetAssetIdList SOAP-ENC:root="1">
@level09
level09 / gist:4258541
Created December 11, 2012 13:26
incoming
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetFullAssetListResponse xmlns="/MSAssetControl">
<GetFullAssetListResult>
<FullMSAsset>
<Asset>
<id>MBCcapture_50c1ff87-1212111318</id>
<uploadDate>12/11/2012 13:23</uploadDate>
<mediaFileUrl>http://77.246.47.132/MediaSphere/mediaFiles/MBCcapture_50c1ff87-1212111318.mp4
@level09
level09 / gist:4258538
Created December 11, 2012 13:26
outgoing
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>
<SOAP-ENV:Body>
<GetFullAssetList SOAP-ENC:root="1">