View monitoring.sh
#!/bin/bash | |
# | |
# Script Name: Launch terminals for monitoring | |
# Author: Sergey Lukin | |
# | |
# | |
# Wait for Network to be available. | |
while true | |
do | |
ping -c 1 10.0.0.248 |
View feed.xml
<?xml version="1.0" encoding="UTF-8"?> | |
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="en"> | |
<title type="text">Git push feed</title> | |
</feed> |
View commit-msg
#!/bin/sh | |
# | |
# 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 |
View pre-receive
#!/bin/sh | |
# | |
# 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 |
View post-receive
#!/bin/sh | |
# | |
# This hook is placed in Bare repository and it updates Working tree whenever a PUSH | |
# is executed | |
# | |
# Assuming following file structure: | |
# . | |
# |-- myproject | |
# |-- myproject.git | |
# set WORKTREE=../myproject |
View post-update
#!/bin/sh | |
# <oldrev> <newrev> <refname> | |
# sanitize pushed branch | |
while read oldrev newrev ref | |
do | |
branch=$(echo $ref | awk -F'/' '{print $3}') | |
if [ "$branch" != "master" -a "$branch" != "docs" ] | |
then | |
echo It is not allowed to push any branch except for master and docs |
View newdraft
#!/usr/bin/env ruby | |
unless ARGV[0] | |
puts 'Usage: newdraft "the draft title"' | |
exit(-1) | |
end | |
date_prefix = Time.now.strftime("%Y-%m-%d") | |
post_name = ARGV.join ' ' | |
post_file_name = post_name.strip.downcase.gsub(/ /, '-') |
View WORKSTATION
include GENERIC | |
# Exclude CPU types | |
nocpu I486_CPU | |
nocpu I586_CPU | |
ident WORKSTATION | |
# Disable mount partitions from UNIX server over TCP/IP | |
# Enable when needed |
View xorg.conf
Section "ServerLayout" | |
Identifier "X.org Configured" | |
Screen 0 "Screen0" 0 0 | |
InputDevice "Mouse0" "CorePointer" | |
InputDevice "Keyboard0" "CoreKeyboard" | |
EndSection | |
Section "Files" | |
ModulePath "/usr/local/lib/xorg/modules" | |
FontPath "/usr/local/lib/X11/fonts/misc/" |
View services_controller.rb
class ServicesController < ApplicationController before_filter :authenticate_user!, :except => [:create] def index # get all authentication services assigned to the current user @services = current_user.services.all end def destroy # remove an authentication service linked to the current user @service = current_user.services.find(params[:id]) @service.destroy redirect_to services_path end def create # get the service parameter from the Rails router params[:service] ? service_route = params[:service] : service_route = 'no service (invalid callback)' # get the full hash from omniauth omniauth = request.env['omniauth.auth'] # continue only if hash and parameter exist if omniauth and params[:service] # map the returned hashes to our variables first - the hashes differ for every service if service_route == 'facebook' omniauth['extra']['user_hash']['email'] ? email = omniauth['extra']['user_hash']['email'] : email = '' omniauth['extra']['user_hash']['name'] ? name = omniaut |
OlderNewer