Skip to content

Instantly share code, notes, and snippets.

View o3bvv's full-sized avatar

Oleksandr o3bvv

View GitHub Profile
@o3bvv
o3bvv / git-recursive-status.sh
Last active December 16, 2015 20:39
Repository recursive status
git status; git submodule foreach --recursive git status
@o3bvv
o3bvv / il2ds-install.sh
Last active December 18, 2015 08:59
IL-2 Dedicated Server installation script
#!/bin/bash
# IL-2 FB Dedicated Server installer.
#
# Run this script with '-h' option to see the usage help:
# il2ds-install.sh -h
# ------------------------------------------------------------------------------
# Definitions
# ------------------------------------------------------------------------------
import socket
import select
import sys
from threading import Thread
sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
sock.connect( ('192.168.1.36', 20001) )
def client_runner():
@o3bvv
o3bvv / Default.sublime-theme
Last active December 17, 2016 18:12
Sublime settings
[
{
"class": "icon_file_type",
"content_margin": [0, 0]
},
{
"class": "icon_folder",
"content_margin": [0, 0]
},
{
@o3bvv
o3bvv / celery-defaults
Last active August 29, 2015 13:56
Example settings for il2ec
# Python interpreter from environment.
ENV_PYTHON="/var/virtualenvs/il2ec/bin/python"
# Name of nodes to start
# here we have a single node
CELERYD_NODES="w1"
# or we could have three nodes:
# CELERYD_NODES="w1 w2 w3"
# Full path to the Django project directory.
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
AddressFamily any
ListenAddress ::
ListenAddress 0.0.0.0
Protocol 2
@o3bvv
o3bvv / autodiscover.py
Last active December 9, 2016 20:17
Django module autodiscover
from imp import find_module
from importlib import import_module
import sys
def autodiscover_module(module_name, installed_apps=None):
if installed_apps is None:
from django.conf import settings
installed_apps = settings.INSTALLED_APPS
@o3bvv
o3bvv / google_drive_api.py
Last active August 29, 2015 14:06
Example Python code for article http://bit.ly/ZekysY
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import httplib2
import os
from apiclient.discovery import build
from apiclient.http import MediaFileUpload
from oauth2client.client import SignedJwtAssertionCredentials
from oauth2client.file import Storage
@o3bvv
o3bvv / nginx.conf
Last active August 29, 2015 14:07
Nginx example
server {
listen 80;
server_name localhost;
location /api {
return 497; # Forbid execution of API calls via plain HTTP
}
location / {
rewrite ^ https://$host:443$request_uri? permanent;
@o3bvv
o3bvv / dir-timer.js
Last active August 29, 2015 14:12
jQuery-backward-timer examples
$.backward_timer
methods: Object
_check_leading_zero: function (number) { ...
_is_exhausted: function() { ...
_on_tick: function (previous_delay) { ...
_render_seconds: function () { ...
_seconds_to_dhms: function (seconds) { ...
cancel: function () { ...
init: function (options) { ...
reset: function () { ...