Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / gist:d0c88731176e0728a8e6
Created November 2, 2014 15:10
Python MediaFire SDK example: system/get_status
from mediafire.api import MediaFireApi
api = MediaFireApi()
result = api.request("system/get_status")
print(result)
@roman-yepishev
roman-yepishev / mediafirebackend.py
Last active August 29, 2015 14:18
MediaFire/Duplicity duct tape. Now a proper project: https://github.com/roman-yepishev/duplicity-mediafire/
https://github.com/roman-yepishev/duplicity-mediafire/
@roman-yepishev
roman-yepishev / zohovault2keepass.py
Last active April 6, 2018 06:07
Converts ZohoVault export to KeePassX .kdb (python 3 only)
#!/usr/bin/python3
"""Convert Zoho Vault Export CSV to KeePass KDB
Usage: zohovault2keepass.py ZohoVault.csv keepass.kdb
You will be prompted for the encryption password.
"""
import csv
@roman-yepishev
roman-yepishev / libical-1.0-tzid.patch
Created May 12, 2015 03:26
Dropping ical_tzid_prefix makes Open-Xchange like our timezone
--- libical-1.0/src/libical/icaltz-util.c.orig 2013-04-14 13:24:42.000000000 -0400
+++ libical-1.0/src/libical/icaltz-util.c 2015-05-11 23:21:20.632759999 -0400
@@ -349,11 +349,8 @@
tz_comp = icalcomponent_new (ICAL_VTIMEZONE_COMPONENT);
/* Add tzid property */
- tzid = (char *) malloc (strlen (ical_tzid_prefix) + strlen (location) + 8);
- sprintf (tzid, "%sTzfile/%s", ical_tzid_prefix, location);
- icalprop = icalproperty_new_tzid (tzid);
+ icalprop = icalproperty_new_tzid (location);
@roman-yepishev
roman-yepishev / keybase.md
Created February 5, 2016 00:43
Verifying myself on Keybase

Keybase proof

I hereby claim:

  • I am roman-yepishev on github.
  • I am rye (https://keybase.io/rye) on keybase.
  • I have a public key ASDVjzC3b2R-iMYCcgjhyVdcUZgJS3O8OJ8uTqrkn81Wiwo

To claim this, I am signing this object:

@roman-yepishev
roman-yepishev / quickaddrinfo.c
Created February 27, 2016 17:52
AF_UNSPEC resolver for localhost
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>
#include <netdb.h>
int main()
{
struct addrinfo hints;
struct addrinfo *result;