Skip to content

Instantly share code, notes, and snippets.

View uzyexe's full-sized avatar
🏠
Working from home

Shuji Yamada uzyexe

🏠
Working from home
  • Periplous / SAKURA internet
  • Asia/Tokyo
  • X @uzyexe
View GitHub Profile
@uzyexe
uzyexe / Rakefile
Created November 25, 2016 12:32
ServerSpec Rakefile sample
require 'rake'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
desc 'Run all tests on CircleCI'
task circleci: [:style]
desc 'Run all style checks'
task style: 'style:ruby'
@uzyexe
uzyexe / panamax-coreos-installer.sh
Created August 13, 2014 17:05
Panamax Install Command for CoreOS
mkdir panamax
cd panamax
curl -O http://download.panamax.io/installer/pmx-installer-latest.zip
unzip pmx-installer-latest.zip
sudo su
./coreos install --stable
docker run -d \
--name="newrelic" \
--net="host" \
--pid="host" \
--env="NEW_RELIC_LICENSE_KEY=YOUR_NEW_RELIC_LICENSE_KEY" \
--volume="/var/run/docker.sock:/var/run/docker.sock:ro" \
--volume="/sys/fs/cgroup/:/sys/fs/cgroup:ro" \
--volume="/dev:/dev" \
--restart=always \
uzyexe/newrelic
git clone https://github.com/robn/towncrier.git
cd towncrier
curl -L http://cpanmin.us | perl - Carton
carton install --deployment
cpanm Task::Plack
PORT=5000
AUTH=admin:secret
curl -u $AUTH -i http://localhost:$PORT/admin/api/v1/services/first/events -F status=down -F message="oh my god."
@uzyexe
uzyexe / towncrier-fixtures.sh
Created July 14, 2014 14:55
towncrier-fixtures.sh
#!/bin/sh
PORT=5000
AUTH=admin:secret
# Create statuses
curl -u $AUTH -i http://localhost:$PORT/admin/api/v1/statuses -F name=Up -F description='The service is operating normally' -F icon=ok-sign
curl -u $AUTH -i http://localhost:$PORT/admin/api/v1/statuses -F name=Down -F description='The service is unavailable' -F icon=remove-sign
curl -u $AUTH -i http://localhost:$PORT/admin/api/v1/statuses -F name=Warning -F description='The service is operating in a degraded capacity' -F icon=warning-sign
@uzyexe
uzyexe / gist:38dbc63da8f493dde857
Created July 14, 2014 14:39
towncrier-auth-config.yml
plugins:
"Auth::Basic":
paths:
"/admin/api":
realm: api
user: admin <= YOUR_USERNAME
password: secret <= YOUR_PASSWORD
@uzyexe
uzyexe / towncrier-install-rhel.sh
Last active August 29, 2015 14:03
towncrier::install
yum install -y perl-devel libxml2-devel
git clone https://github.com/robn/towncrier.git
cd towncrier
curl -L http://cpanmin.us | perl - Carton
carton install
cpanm Task::Plack
@uzyexe
uzyexe / systemctl-start-logentires
Last active August 29, 2015 14:02
sudo systemctl start logentries
sudo systemctl start logentries
@uzyexe
uzyexe / logentires-systemd
Last active June 4, 2018 20:42
systemd: Sending your CoreOS data to Logentries
[Unit]
Description=logentires.service
[Service]
Environment=ACCESS_TOKEN=YOUR_LOGENTRIES_ACCESS_TOKEN
ExecStart=/bin/sh -c 'journalctl -o short -f | sed \"s/^/${ACCESS_TOKEN} \\0/g\" | ncat data.logentries.com 10000'