Skip to content

Instantly share code, notes, and snippets.

@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 / 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);
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Logging you via Ubuntu SSO</title>
<style type="text/css">
body { font-family: sans-serif; font-size: 10pt; color: black; background-color: white; }
h1 { height: 32px; }
#errorMessage { border-left: 3px solid red; padding: 5px; margin: 10px 0; }
.hidden { display: none; }
@roman-yepishev
roman-yepishev / libccid_Info.plist
Created December 14, 2011 20:35
CCID with Avtor SC Reader 371
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>ifd-ccid.bundle</string>
<key>CFBundleIdentifier</key>
<string>org.debian.alioth.pcsclite.smartcardccid</string>
@roman-yepishev
roman-yepishev / nsmep-balance.pl
Created December 15, 2011 10:05
NSMEP expiration and balance check
#!/usr/bin/perl
# Copyright 2011 Roman Yepishev <roman.yepishev@yandex.ua>
#
# Fetch various NSMEP information from card
#
# WARNING: This application is provided AS IS. It can render your NSMEP card unusable
# or cause malfunction. The author assumes no liability for any of the damage
# resulted from using this script.
# This code is based on ASSUMPTIONS about the location of the data in the
# APDUs, there is no public information about the format of the fields.
@roman-yepishev
roman-yepishev / libpcsclite-winscard.patch
Created December 17, 2011 09:28
Patch for wine1.3-1.3.28 (Ubuntu Oneiric) winscard
## Description: Partial but functional implementation of winscard
## Author: Vincent Hardy vincent.hardy.be@gmail.com
## Origin: http://www.winehq.org/pipermail/wine-devel/2011-September/092627.html
Index: wine1.3-1.3.28/configure
===================================================================
--- wine1.3-1.3.28.orig/configure 2011-09-09 20:43:48.000000000 +0300
+++ wine1.3-1.3.28/configure 2011-12-18 16:31:46.000000000 +0200
@@ -11767,6 +11767,60 @@
fi
@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())