Skip to content

Instantly share code, notes, and snippets.


Sergey Lukin sergeylukin

View GitHub Profile
sergeylukin / post-receive
Last active Aug 29, 2015
git hook that sets flags according to modified files
View post-receive
while read oldrev newrev refname
for file in `git diff $oldrev $newrev --name-only`; do
if [ `echo $file | cut -c 1-22` == "app/assets/javascripts" \
-o \
`echo $file | cut -c 1-25` == "shared/assets/javascripts" \
sergeylukin / .vimrc
Created Jul 3, 2014
Minimal vim configuration for root user
View .vimrc
" This is my minimal Vim configuration file I usually save as `/root/.vimrc`
" for the occasions when I'm logged in as root user and I need to edit files
" (this doesn't usually happen, but when it happens, I have vim configuration
" that makes sense).
" It doesn't require any plugins and aims to work with minimal Vim installation
" Forget compatibility with VI
set nocompatible
sergeylukin /
Last active Aug 29, 2015
Programs browser for DOS 6.22


browser.exe displays programs found in current directory's subdirectories in an easy to look through interface. Programs meta information (name, description, screenshots references) is stored in browser.yaml file found in programs' directory.

Here is UI prototype:

sergeylukin / HttpLink.mq4
Last active Aug 29, 2015
Opening a Webpage in the default browser from within MetaTrader
View HttpLink.mq4
sergeylukin /
Created Mar 7, 2012
Bash: launch monitoring terminals
# Script Name: Launch terminals for monitoring
# Author: Sergey Lukin
# Wait for Network to be available.
while true
ping -c 1
sergeylukin / commit-msg
Last active Oct 7, 2015
Git hook: prefix BRANCH name in every COMMIT
View commit-msg
# Adds current branch name as a prefix for every Commit
# To enable this hook, rename this file to "commit-msg" and make sure it is executable
ticket=$(git symbolic-ref HEAD | awk -F'/' '{print $3}')
if [ -n "$ticket" ]; then
sed -i "1 s/^/$ticket: /" $1
sergeylukin / pre-receive
Last active Oct 7, 2015
Git hook (pre-receive): commit any local changes before PUSH accepted
View pre-receive
# This hooks is placed in a Bare repository
# It makes sure that working tree doesn't contain any local changes
# And if it contains - submits a commit and returns false
# So if false returned - client should PULL and then PUSH again
# Assuming following file structure:
# .
# |-- myproject
sergeylukin / newdraft
Created Aug 25, 2012
Ruby script for creating New Draft Post in Jekyll
View newdraft
#!/usr/bin/env ruby
unless ARGV[0]
puts 'Usage: newdraft "the draft title"'
date_prefix ="%Y-%m-%d")
post_name = ARGV.join ' '
post_file_name = post_name.strip.downcase.gsub(/ /, '-')
sergeylukin / WORKSTATION
Created Nov 7, 2012
FreeBSD 9 KERNEL for ThinkPad T60
include GENERIC
# Exclude CPU types
nocpu I486_CPU
nocpu I586_CPU
# Disable mount partitions from UNIX server over TCP/IP
# Enable when needed
sergeylukin / xorg.conf
Created Nov 8, 2012
FreeBSD X11 configuration file for ThinkPad T60
View xorg.conf
Section "ServerLayout"
Identifier " Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
Section "Files"
ModulePath "/usr/local/lib/xorg/modules"
FontPath "/usr/local/lib/X11/fonts/misc/"
You can’t perform that action at this time.