Skip to content

Instantly share code, notes, and snippets.

View dasgoll's full-sized avatar

dasgoll

  • Amman, Jordan
View GitHub Profile
@dasgoll
dasgoll / Vagrantfile
Last active August 29, 2015 14:19 — forked from tmatilai/Vagrantfile
# URI of the local (caching) HTTP proxy
LOCAL_HTTP_PROXY = 'http://192.168.33.200:8123'
# Configures vagrant-cachier and vagrant-proxyconf.
# Should be called only on "local machine" providers.
def configure_caching(config)
if Vagrant.has_plugin?('vagrant-cachier')
config.cache.enable_nfs = true
config.cache.enable :gem
config.cache.enable :npm
require 'rubygems'
require 'right_aws'
aws_access_key_id = 'your-access-key'
aws_secret_access_key = 'your-secret-key'
target_bucket = 'your-source-bucket'
destination_bucket = 'your-destination-bucket'
s3 = RightAws::S3Interface.new(aws_access_key_id, aws_secret_access_key)
# -*- coding: utf-8 -*-
require 'rubygems'
require 'aws-sdk'
## アクセスIDとシークレットアクセスキーを指定します
ACCESS_KEY = 'SET UP YOUR ACCESS KEY'
SECRET_KEY = 'SET UP YOUR SECRET KEY'
## 引数チェック
unless ARGV.size == 4
@dasgoll
dasgoll / gist:41bdfe0fd6eff2097f0f
Last active January 16, 2016 18:57 — forked from sebsto/gist:19b99f1fa1f32cae5d00
Install Maven with Yum on Amazon Linux
sudo wget https://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
@dasgoll
dasgoll / install-parallel-centos-5.sh
Last active September 19, 2015 09:05
Script to install GNU parallel on CentOS 5 (including default AWS EC2 Linux instances).
#!/bin/bash
# Install parallel on CentOS 5.
# Assumes you are root. Prefix w/ sudo if not.
cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/home:tange/CentOS_CentOS-5/home:tange.repo
yum install parallel
@dasgoll
dasgoll / control.sh
Last active October 25, 2015 06:38 — forked from randerzander/control.sh
Ambari Service Start/Stop script
USER='admin'
PASS='admin'
CLUSTER='dev'
HOST=$(hostname -f):8080
function start(){
curl -u $USER:$PASS -i -H 'X-Requested-By: ambari' -X PUT -d \
'{"RequestInfo": {"context" :"Start '"$1"' via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' \
http://$HOST/api/v1/clusters/$CLUSTER/services/$1
}
@dasgoll
dasgoll / strongswan ubu 14.04
Created January 20, 2016 12:02 — forked from jice/strongswan ubu 14.04
Build latest Strongswan (with libipsec, DNSSEC support, ...) on Ubuntu 14.04
0. After a fresh install
# aptitude update && aptitude full-upgrade && reboot
1. Install necessary packages for building Strongswan (may vary depending on your configure options, configure script will tell you)
# aptitude install build-essential libgmp-dev libunbound-dev libldns-dev
2. Get, check, and unpack the sources
@dasgoll
dasgoll / .bash_profile
Last active August 14, 2016 07:25 — forked from fieg/.bash_profile
.bash_profile for OSX including autocomplete for ssh hosts, default variables and some aliases
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
@dasgoll
dasgoll / slack_webhook_post.py
Last active February 3, 2017 17:20 — forked from devStepsize/slack_webhook_post.py
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests