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: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: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: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>
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 / 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
@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 / 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 / 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:4721760
Created February 6, 2013 10:31
video fabfile
from fabric.api import put, run , local , env
from fabric.contrib.files import exists
from settings import VOD_HOST, VOD_PATH, PHP_COMMAND,MAG_HOST, MAG_PATH
from glob import glob
import os
def vod():
env.hosts = [VOD_HOST]
@level09
level09 / gist:5019433
Created February 23, 2013 11:30
iphone test
2013-02-23 15:28:55.921 aamobile[2477:1703] Reachability: -R -------
2013-02-23 15:28:56.170 aamobile[2477:907] App Delegate: Core Data: Persistent Store Cooordinator: Error Occured
2013-02-23 15:28:56.196 aamobile[2477:907] Unresolved error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x1cdbce60 {metadata={
NSPersistenceFrameworkVersion = 419;
NSStoreModelVersionHashes = {
Article = <e67d71c4 ddc0413c df9937e9 2b014f29 534ea82e 09d3a64c 27027334 2bc03083>;
InfoView = <7c0835ba 31602ced 8f963e95 1be81967 9df533a1 70830baf 9ed8c76b bbc38a5b>;
Section = <82911e5d 90d03c46 df46d0b1 83c0f176 352f24fd e4db94d8 ed21e276 af06b326>;
SectionList = <ada1a794 3c26e5f5 49667729 b039f328 f84ad6b5 7fddb0e9 b1eaed00 9a47681a>;
SectionTime = <5582ff38 d5752191 adaf4f95 851ad77f 1b90e4c0 7db22931 441615e0 34b9f003>;