Skip to content

Instantly share code, notes, and snippets.

View dskarataev's full-sized avatar

Denis Karataev dskarataev

  • Ho Chi Minh City, Vietnam
View GitHub Profile
@dskarataev
dskarataev / checkout.sh
Created May 17, 2014 04:59
Odoo reps checkout script
#/bin/sh
set -e
ODOO=https://github.com/odoo/odoo.git
DEV=https://github.com/odoo-dev/odoo.git
usage () {
cat <<EOF
Usage: $0 [-m] [COPYNAME]
@dskarataev
dskarataev / youtube.pl
Last active December 21, 2021 19:16
Скачивание видео с YouTube через wget. Использовать как ./youtube.pl "link_to_the_video_page", в результате получим .mp4 файл
#!/usr/bin/perl -T
use strict;
use warnings;
#
## Calomel.org ,:, Download Youtube videos and music using wget
## Script Name : youtube_wget_video.pl
## Version : 0.42
## Valid from : March 2014
@dskarataev
dskarataev / backup_github.sh
Created June 18, 2014 11:18
Backup GitHub repositories
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"tterp"} # the GitHub organization whose repos will be backed up
GHBU_UNAME=${GHBU_UNAME-"dskarataev"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"xc4cv0q0"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"github.com"} # the GitHub hostname (see comments)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted
GHBU_PRUNE_AFTER_N_DAYS=${GHBU_PRUNE_AFTER_N_DAYS-3} # the min age (in days) of backup files to delete

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

@dskarataev
dskarataev / requirements.txt
Last active August 29, 2015 14:04
requirements.txt for odoo v8 (from https://github.com/odoo/odoo/pull/799)
Babel==1.3
Jinja2==2.7.3
Mako==1.0.0
MarkupSafe==0.23
Pillow==2.4.0
http://download.gna.org/pychart/PyChart-1.39.tar.gz
PyWebDAV==0.9.8
PyYAML==3.11
Werkzeug==0.9.6
argparse==1.2.1
@dskarataev
dskarataev / logstat.py
Last active August 29, 2015 14:12
logstat.py
#!/usr/bin/env python
# coding: utf-8
# Implementation of screening test for position Backend Developer
# 2014, Denis Karataev
import re
import numpy
LOG_PATH = '/home/dsk/sample.log'
TEMPLATES = [
'GET /api/users/{user_id}/count_pending_messages',
@dskarataev
dskarataev / json_decorator.py
Created January 8, 2015 22:01
Good JSON decorator for Django
from django.db import models
from django.utils.functional import Promise
from django.utils.encoding import force_unicode
from django.utils import simplejson as json
from decimal import Decimal
from django.core import serializers
from django.conf import settings
from django.http import HttpResponse, HttpResponseForbidden, Http404
from django.core.mail import mail_admins
from django.db.models.query import QuerySet
@dskarataev
dskarataev / json_response.py
Created January 8, 2015 22:02
Good JSON response for Django
# Copyright 2012 Twitter
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@dskarataev
dskarataev / files_management.py
Created January 12, 2015 14:37
files management
#coding: utf-8
import os
from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
from openerp.tools.translate import _
import re
def utf8(value):
if isinstance(value, (str, unicode, basestring)):
<?php
/**
* Script to send an email using Experian UMS with attachments
*/
$url = 'http://sysmail.fagms.net/c/tm?ACTION=SYSTEM';
$file = 'test.png';
$aid = 000000; // Replace with your ID
$email = '...'; // Replace with your email
file_put_contents($file, base64_decode(test_png()));