Skip to content

Instantly share code, notes, and snippets.

View DmZ's full-sized avatar

Dmitry Zamaruev DmZ

  • Ukraine, Kharkiv
View GitHub Profile
@jmyrland
jmyrland / nodejs.spec
Created July 19, 2012 12:23 — forked from splaice/nodejs.spec
RPM spec file for node
%define ver 0.8.2
%define rel 1
%define jobs 2
Name: nodejs
Version: %{ver}
Release: %{rel}
Summary: Node's goal is to provide an easy way to build scalable network programs.
Group: Applications/Internet
License: Copyright Joyent, Inc. and other Node contributors.
@ahamid
ahamid / restorecon.rb
Created June 27, 2012 22:30
chef restorecon helper
libraries/restorecon.rb
def restorecon_cmd(path)
%Q(restorecon "#{path}")
end
# restores selinux label for path
def restorecon(path)
execute restorecon_cmd(path) do
action :nothing
@sekimura
sekimura / text_strip_margin.py
Created May 13, 2012 04:08
Text (heredoc) strip margin in Python
import re
def strip_margin(text):
return re.sub('\n[ \t]*\|', '\n', text)
def strip_heredoc(text):
indent = len(min(re.findall('\n[ \t]*(?=\S)', text) or ['']))
pattern = r'\n[ \t]{%d}' % (indent - 1)
return re.sub(pattern, '\n', text)
@dakatsuka
dakatsuka / rabbitmq-server.patch
Created April 18, 2012 07:22
Support FQDN NODENAME for RabbitMQ
--- rabbitmq-server 2012-04-18 16:17:39.168100001 +0900
+++ rabbitmq-server 2012-04-18 16:17:13.304100001 +0900
@@ -102,7 +102,7 @@
exec erl \
${RABBITMQ_EBIN_PATH} \
${RABBITMQ_START_RABBIT} \
- -sname ${RABBITMQ_NODENAME} \
+ -name ${RABBITMQ_NODENAME} \
-boot ${RABBITMQ_BOOT_FILE} \
${RABBITMQ_CONFIG_ARG} \
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@poobury
poobury / recipe.rb
Created November 9, 2011 10:20 — forked from casualjim/recipe.rb
S3 File Resource for Chef
# Source accepts http/https or the protocol region:// with the host as the bucket
# access_key_id and secret_access_key are just that
# Note resource name has changed from s3_file to s3_aware_remote_file
# for the eu-west-1 region:
s3_aware_remote_file "/var/bulk/the_file.tar.gz" do
source "s3-eu-west-1://your.bucket/the_file.tar.gz"
access_key_id your_key
secret_access_key your_secret
owner "root"
@casualjim
casualjim / recipe.rb
Created October 5, 2011 09:37 — forked from rberger/recipe.rb
S3 File Resource for Chef
# Source accepts the protocol region:// with the host as the bucket
# access_key_id and secret_access_key are just that
# for the eu-west-1 region:
s3_file "/var/bulk/the_file.tar.gz" do
source "s3-eu-west-1://your.bucket/the_file.tar.gz"
access_key_id your_key
secret_access_key your_secret
owner "root"
group "root"
@cwchien
cwchien / register_jdk7_for_update_alternatives.sh
Last active January 6, 2023 19:42
script for registering JDK7 to update-alternatives in Debian's way
#!/bin/bash
# "Register JDK7 for update-alternatives Script in Debian Way"
# Based on 1. codeslinger's "install_java7_alternatives" from https://gist.github.com/445930
# 2. sun-java6-plugin.deb postint script (for plugin)
# Modified by Cheng-Wei Chien<e.cwchien@gmail.com>, 2012-08-16
# ------------------------------------------------------------------------------
# Note: This script works on x86/amd64 Debian GNU/Linux|Ubuntu.
# If you use other arch or distro, you may have to modify some parameters.
#
# Usage: 1. Extract jdk7 tar.gz to, for example, /usr/lib/jvm/java-7-sun-1.7.0.13,