This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'httparty' | |
require 'json' | |
reddit_api_url = "http://www.reddit.com/r/funny/new.json?sort=new&limit=5" | |
resp = HTTParty.get(reddit_api_url) | |
data = JSON.parse(resp.body) | |
data['data']['children'].each do |sub| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group { 'puppet': | |
ensure => present, | |
} | |
class initial_setup { | |
exec { 'apt-get update': | |
command => '/usr/bin/apt-get update', | |
} | |
package { "essential-packages": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#create a public key base on the link bellow | |
https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2 | |
#the local public key has to be added on bitbucket.com and the remote server | |
https://help.github.com/articles/generating-ssh-keys/ | |
#if you added a pass phrase to the key you need to add your public key to the remote server | |
http://capistranorb.com/documentation/getting-started/authentication-and-authorisation/#toc_3 | |
#set up the public ssh to your account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ] | |
then | |
echo "Please provide a domain name as argument" | |
exit 1 | |
fi | |
if [ -z "$2" ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
www_dir = '/var/www' | |
domain = 'nomimono.domain.com' | |
sajts = ['sajt99','sajt98','sajt97'] | |
sajts.each do |sajt| | |
directory www_dir do | |
owner 'www-data' | |
group 'www-data' | |
mode '0755' | |
action :create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Azure CLI | |
brew update | |
brew install azure-cli | |
# Authenticate cli client | |
az login | |
# Register providers | |
az provider register -n Microsoft.ContainerService | |
az provider register -n Microsoft.Compute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'azure_mgmt_compute' | |
require 'azure_mgmt_resources' | |
require 'azure_mgmt_storage' | |
require 'azure' | |
include Azure | |
include Azure::ARM::Compute | |
include Azure::ARM::Compute::Models | |
include Azure::ARM::Resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
set :bind, '0.0.0.0' | |
set :port, 8080 | |
post '/event' do | |
status 204 #successful request with no body content | |
request.body.rewind |
OlderNewer