Skip to content

Instantly share code, notes, and snippets.

View david-batranu's full-sized avatar

David Bătrânu david-batranu

View GitHub Profile
# cache of http://download.zope.org/Zope2/index/2.13.19/versions.cfg
[buildout]
extends = http://download.zope.org/zopetoolkit/index/1.0.7/ztk-versions.cfg
versions = versions
[versions]
# Zope2-specific
Zope2 = 2.13.19
AccessControl = 2.13.11
@david-batranu
david-batranu / markov.py
Last active October 26, 2015 13:48 — forked from agiliq/gist:131679
import random
class Markov(object):
def __init__(self, open_file):
self.cache = {}
self.open_file = open_file
self.words = self.file_to_words()
self.word_size = len(self.words)
self.database()
@david-batranu
david-batranu / python-paged-ldap-snippet-2.4.py
Created April 20, 2018 18:42 — forked from mattfahrner/python-paged-ldap-snippet-2.4.py
This snippet allows you to do a Python LDAP search with paged controls. The latest version now supports Python "ldap" 2.4. Many thanks to Ilya Rumyantsev for doing the 2.4 legwork.
#! /usr/bin/python
import sys
import ldap
from ldap.controls import SimplePagedResultsControl
from distutils.version import LooseVersion
# Check if we're using the Python "ldap" 2.4 or greater API
LDAP24API = LooseVersion(ldap.__version__) >= LooseVersion('2.4')
@david-batranu
david-batranu / arch-macbook2018.md
Created August 24, 2020 12:24 — forked from TRPB/arch-macbook2018.md
Guide: Running Arch on a 2018 MacBook Pro

Hardware Prerequisites

You'll need at least the following hardware:

  • At least 3 USB-A to USB-C converters or hub with enough ports for at least 3 USB devices if all your devices are USB-A then:
  • A USB drive
  • A USB keyboard
  • USB to Ethernet adapter, compatible USB dongle or USB tethering on a phone
@david-batranu
david-batranu / gnupg_scdaemon.md
Created February 26, 2023 16:25 — forked from artizirk/gnupg_scdaemon.md
OpenPGP SSH access with Yubikey and GnuPG

OpenPGP SSH access with Yubikey and GnuPG

Yubikey, Smart Cards, OpenSC and GnuPG are pain in the ass to get working. Those snippets here sould help alleviate pain.

Notes written here should work on

  • Ubuntu 20.04 with Gnome
  • Debian 11 with Gnome
  • Linux Mint with Cinnamon (needs different environment setup, check comments)
  • Arch Linux with Gnome (pacman instead of apt)

This is not a step by step guide