Skip to content

Instantly share code, notes, and snippets.

@rkmylo
rkmylo / ppt-syntax-highlight.md
Created Oct 7, 2017
Add syntax-highlighted code to PowerPoint slides (Mac OSX)
View ppt-syntax-highlight.md
  1. Copy code to clipboard

  2. pbpaste | pygmentize -l python -f rtf | pbcopy

  3. In Powerpoint: Edit > Paste Special...

  4. Paste as: Formatted Text (RTF)

@rkmylo
rkmylo / rfile__init__.py
Created May 22, 2017
RCTF 2016 - rFile __init__.py
View rfile__init__.py
# uncompyle6 version 2.9.11
# Python bytecode 3.5 (3350)
# Decompiled from: Python 2.7.6 (default, Oct 26 2016, 20:30:19)
# [GCC 4.8.4]
# Embedded file name: /app/rFileStorage/__init__.py
# Compiled at: 2017-04-09 12:19:02
# Size of source mod 2**32: 1891 bytes
from flask import Flask, request, send_file, make_response
from hashlib import md5
from time import time
@rkmylo
rkmylo / rcdn_solution.py
Created May 22, 2017
RCTF 2017 - rCDN Solution
View rcdn_solution.py
# coding: utf-8
"""
Unfortunately solved 20 minutes after the end of the CTF :(
"""
import re
import sys
import string
import requests
@rkmylo
rkmylo / rfile_solution.py
Created May 22, 2017
RCTF 2017 - rFile Solution
View rfile_solution.py
from __future__ import division
import hashlib
import requests
from datetime import datetime, timedelta
api_url = 'http://rfile.2017.teamrois.cn/api/download/{}/{}'
def totimestamp(dt, epoch=datetime(1970,1,1)):
td = dt - epoch
return (td.microseconds + (td.seconds + td.days * 86400) * 10**6) / 10**6