Skip to content

Instantly share code, notes, and snippets.

@perewall
perewall / manage.py
Last active August 29, 2019 15:53
Python snippet for make Git releases
#!/usr/bin/env python
import re
import git # gitpython
import semver
import click
@click.group()
@perewall
perewall / release.sh
Last active August 23, 2019 18:31 — forked from bclinkinbeard/release.sh
Bash script to automate the Git tag/release process for the projects written on Python
#!/bin/bash
# https://gist.github.com/perewall/9234b7fd3cb270bba1f926ed8bef0b34
set -eux
# establish variables
projectName=$(git config --local remote.origin.url | sed -n 's#.*/\([^.]*\)\.git#\1#p')
currentBranch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
devBranch="dev"
@perewall
perewall / ad_test.py
Created August 17, 2017 19:42 — forked from caseydunham/ad_test.py
Retrieve user information from AD via Python LDAP
import sys, ldap
# DN = username@example.com, secret = password, un = username
DN, secret, un = sys.argv[1:4]
server = "ldap://server.com"
port = 389
base = "dc=example,dc=com"
scope = ldap.SCOPE_SUBTREE
@perewall
perewall / hh.pl
Last active August 23, 2016 13:08
HeadHunter resume auto-updater
#!/usr/bin/perl
use LWP::UserAgent;
use JSON;
use DateTime::Duration;
use DateTime::Format::Strptime;
my $token = "xNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxNxN"; # Request token in https://dev.hh.ru/admin
my $userAgent = "Perl Resume Updater <art@pwmedia.ru>";