Skip to content

Instantly share code, notes, and snippets.

@roman-yepishev
roman-yepishev / mediafire-gzip.py
Created October 12, 2014 15:52
MediaFire gzip test
import requests
import unittest
API_BASE = 'https://www.mediafire.com/api'
class MediaFireGzipTest(unittest.TestCase):
"""Test MediaFire gzipped content response"""
def test_api_1_0_gzip(self):
@roman-yepishev
roman-yepishev / split.c
Created October 12, 2014 02:42
String tokenizer
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int is_sep(const char s, const char *separators)
{
int i;
for (i = 0; i < strlen(separators); i++) {
if (s == separators[i]) {
@roman-yepishev
roman-yepishev / telepathy-couchdb-logger.py
Created November 27, 2013 13:27
Telepathy/desktopcouch logger POC
#!/usr/bin/env python
"""Telepathy CouchDB Logger"""
from dbus.mainloop.glib import DBusGMainLoop
import gobject
import dbus
#for observer thing
import telepathy
import telepathy.server
@roman-yepishev
roman-yepishev / gvfs-mtp-contenttype.patch
Created September 10, 2013 05:37
Set content type for files uploaded via gvfs-mtp
diff -ur ../gvfs-1.16.3.orig/daemon/gvfsbackendmtp.c ./daemon/gvfsbackendmtp.c
--- ../gvfs-1.16.3.orig/daemon/gvfsbackendmtp.c 2013-09-10 08:20:43.199638261 +0300
+++ ./daemon/gvfsbackendmtp.c 2013-09-10 08:27:06.859955187 +0300
@@ -33,6 +33,7 @@
#include <glib/gstdio.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
+#include <glib.h>
#include <libmtp.h>
@roman-yepishev
roman-yepishev / ramconsole.patch
Created June 9, 2013 15:53
RAM console patch
diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c
index 15e114c..3b2bfcf 100644
--- a/arch/arm/mach-msm/board-qsd8x50.c
+++ b/arch/arm/mach-msm/board-qsd8x50.c
@@ -132,9 +132,14 @@
#define MSM_SMI_BASE 0x00000000
#endif
+#define MODEM_SIZE 0x02B00000
+
@roman-yepishev
roman-yepishev / wp-import-disqus.py
Created December 4, 2012 19:15
Disqus importer to WordPress
#!/usr/bin/python
"""Quick and dirty hack to get disqus comments into WordPress DB"""
import sys
from datetime import datetime
from xml.etree import ElementTree as ET
import MySQLdb
ANONYMOUS_EMAIL = 'nobody@example.net'
@roman-yepishev
roman-yepishev / atompark-api-v3.0.py
Created August 4, 2012 13:27
Atompark SMS API v3.0 Example
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This code is in public domain
import json
import httplib2
import urllib
import hashlib
@roman-yepishev
roman-yepishev / atompark-api-v2.0.py
Created August 4, 2012 13:14
Atompark SMS API v2.0 Example
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This code is in public domain
import httplib2
import urllib
import random
from xml.etree.ElementTree import Element, SubElement, Comment, tostring
from xml.dom import minidom
@roman-yepishev
roman-yepishev / dump-passwords.py
Created February 19, 2012 12:09
twisted-ssh.py gdbm password export
#!/usr/bin/env python
import gdbm
import sys
from datetime import datetime
print """# Updated: %s
# SSH creds for attack attempts on my server.
# If your password is listed here, CHANGE IT RIGHT NOW
#""" % (datetime.now().isoformat())
@roman-yepishev
roman-yepishev / ssh-twisted.py
Created January 3, 2012 16:00
twisted ssh
#!/usr/bin/env python
import sys
import gdbm
from twisted.conch.unix import UnixSSHRealm
from twisted.cred import portal
from twisted.cred.credentials import IUsernamePassword
from twisted.cred.checkers import ICredentialsChecker
from twisted.cred.error import UnauthorizedLogin