Skip to content

Instantly share code, notes, and snippets.

View shohey1226's full-sized avatar

Shohei Kameda shohey1226

View GitHub Profile
#!/bin/bash
export PLENV_ROOT=/opt/perl5
export PATH="$PLENV_ROOT/bin:$PATH"
eval "$(plenv init -)"
cd /tmp
if [[ -e 'cpanfile' ]]
then
cpanm --installdeps .
requires 'DigitalOcean', 0.08;
@shohey1226
shohey1226 / main.yml
Created March 6, 2014 22:57
Ansible playbook to install system wide Perl5.18 and its module using cpanm and cpanfile
---
- name: install perl with perlenv
script: perlenv.sh
- name: copy cpanfile to /tmp/
copy: src=cpanfile dest=/tmp/cpanfile
- name: install modules
script: install_with_cpanm.sh
@shohey1226
shohey1226 / doman.pl
Last active August 29, 2015 13:56
Perl script: doman.pl - DigitalOcean manipulator using Module, DigitalOcean
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Getopt::Long;
use Pod::Usage;
use DigitalOcean;
my $client_id = $ENV{DIGITALOCEAN_CLIENT_ID};
@shohey1226
shohey1226 / adduser_github_sshpub_key.yml
Created March 1, 2014 02:23
Ansible playbook add user using public ssh key on Github
---
- name: add user and create ssh key
user: name=shohei
- name: dowanload pubkey from Github and placed as authorized_keys
get_url: url=https://github.com/shohey1226.keys dest=/tmp/shohei.authorized_keys
delegate_to: 127.0.0.1
- name: Create authorized_keys from the file that just downloaded
authorized_key: user=shohei key="{{ lookup('file', '/tmp/shohei.authorized_keys') }}"
---
- hosts: servers
user: root
tasks:
- name: get jenkins repo
command: wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
- name: install jenkins
command: rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
- name: install Jenkins by yum
yum: name=jenkins state=latest
<div class="content wrap">
<div class="about">
<table>
<tr>
<td>
<div class="portrait" style="padding:20px;margin-top:17px">
<img src="{PortraitURL-96}">
</div>
</td>
<td>
#!/bin/bash
if [[ ! -e $HOME/.plenv ]];then
git clone git://github.com/tokuhirom/plenv.git $HOME/.plenv
echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> $HOME/.bash_profile
echo 'eval "$(plenv init -)"' >> $HOME/.bash_profile
git clone git://github.com/tokuhirom/Perl-Build.git $HOME/.plenv/plugins/perl-build/
$HOME/.plenv/bin/plenv install 5.18.0
$HOME/.plenv/bin/plenv rehash
$HOME/.plenv/bin/plenv global 5.18.0
---
- hosts: servers
user: thnkout
tasks:
- name: install perlenv
script: files/perlenv.sh
---
- hosts: servers
user: root
tasks:
- name: installl mysql packages
yum: name=mysql state=latest
yum: name=mysql-devel state=latest
yum: name=mysql-server state=latest
- name: configure mysql
command: /sbin/chkconfig mysqld on