Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
if [ ! -d "$HOME/bin/ssh" ]
then
[[ -d "$HOME/bin" ]] || mkdir "$HOME/bin"
cp ./ssh $HOME/bin/ssh
grep -q -e "alias ssh='~/bin/ssh'" $HOME/.bash_aliases || echo "alias ssh='~/bin/ssh'" >> $HOME/.bash_aliases
fi
have_header: checking for ruby/thread.h... -------------------- yes
"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin13 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L. -L/usr/local/lib -arch x86_64 -arch i386 -lruby.2.0.0 -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
def load_from_berkshelf(name)
return unless defined?(::Berkshelf)
return unless ::File.exist?(self.config[:berksfile])
berksfile = ::Berkshelf::Berksfile.from_file(self.config[:berksfile])
lockfile = ::Berkshelf::Lockfile.from_berksfile(berksfile)
resolver = ::Berkshelf::Resolver.new(
berksfile,
lockfile.find(name)
#/var/opt/opscode/nginx/etc/addon.d/20-reporting_upstreams.conf
#
# Reporting upstream definition
#
upstream opscode_reporting {
server 127.0.0.1:10010;
}
source 'https://rubygems.org'
gem 'pony'
gem 'seven_zip_ruby'
#!/bin/bash
# Build and install ICU (by default 57.1) and build and install intl extension for php (5,7)
# https://bugs.php.net/bug.php?id=72074
# Tested on Ubuntu 16.04 + PHP 7.0.8 (cli, fpm)
# Tested on Ubuntu 14.04 + PHP 5.5.31 (cli, fpm)
set -e
SCRIPT_PATH=$(realpath `dirname $0`)
PHP_VERSION=${PHP_VERSION:-`php -v | head -1 | grep --only-matching --perl-regexp "[5|7]\.\\d+\.\\d+"`}
@NikolayMurha
NikolayMurha / veracrypt-mount.sh
Last active June 15, 2017 10:47
VeraCrypt mount
#!/bin/bash
if [[ `uname` == 'Darwin' ]];
then
MAC_OS=true
VERACRYPT='/Applications/VeraCrypt.app/Contents/MacOS/VeraCrypt'
else
MAC_OS=false
VERACRYPT='veracrypt'
fi
@NikolayMurha
NikolayMurha / bitbucket2pivotal.php
Created March 24, 2017 13:15
Web hook for integrate
<?php
/**
* Bitbucket to pivotal webhook
* Deploy this hook to your server and add webhook http://yourdomain.com/bitbucket2pivotal.php?token=<PivotalToken>
*/
$token = !empty($_GET['token']) ? $_GET['token'] : getenv('PIVOTAL_TOKEN');
if (!$token) {
print 'Token should be defined!';
die;
@NikolayMurha
NikolayMurha / docker_swarm_service.py
Last active May 29, 2018 13:16
Ansible module https://github.com/ansible/ansible/pull/19229 with my changes. Secrets and configs are supported
#!/usr/bin/python
#
# (c) 2017, Dario Zanzico (git@dariozanzico.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
@NikolayMurha
NikolayMurha / docker_config.py
Created May 22, 2018 09:00
Manage docker configs in ansible
#!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',