Skip to content

Instantly share code, notes, and snippets.

View eccyan's full-sized avatar

eccyan eccyan

View GitHub Profile
@eccyan
eccyan / clean-up-boot-partition-ubuntu.md
Created July 23, 2019 11:46 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@eccyan
eccyan / file.php
Last active September 6, 2018 11:57
Fuel email driver: Save email to file
<?php
class Email_Driver_File extends \Email_Driver
{
/**
* File send: Save email to file
*
* @return bool Success boolean.
*/
protected function _send()
@eccyan
eccyan / recoru
Last active September 6, 2018 00:58
recoru puncher
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Usage: recoru punchType" 1>&2
echo " punchType: 1 出勤 2 退勤" 1>&2
echo "ENVIRONMENT_VARIABLES:" 1>&2
echo " RECORU_WORK_PLACE_ID: 企業ID"
echo " RECORU_AUTH_ID: 個人ID"
echo " RECORU_PASSWORD: パスワード"
exit 1
🀀🀁🀂🀃🀆🀅🀄🀇🀈🀉🀊🀋🀌🀍🀎🀏🀐🀑🀒🀓🀔🀕🀖🀗🀘🀙🀚🀛🀜🀝🀞🀟🀠🀡🀢🀣🀤🀥🀦🀧🀨🀩🀪🀫
キタ━(゚∀゚)━🀀🀀🀀🀆🀆🀆🀅🀅🀅🀄🀄🀄🀃━🀃━(゚∀゚)━!!!!
@eccyan
eccyan / mysql.sh
Last active May 9, 2017 05:24 — forked from mahemoff/mysql.sh
circleci mysql upgrade
#!/bin/bash
set -x
set -e
export DEBIAN_FRONTEND=noninteractive
curl -LO https://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb
echo mysql-apt-config mysql-apt-config/select-product select Apply | sudo debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-connector-python select none | sudo debconf-set-selections
@eccyan
eccyan / 001_sidekiq.config
Last active August 19, 2019 20:26
Sidekiq on AWS Elastic Beanstalk (upstart v0.6.5)
# See: https://medium.com/@hugooodias/deploying-a-rails-app-to-amazon-elasticbeanstalk-in-2016-c4e833c687c0
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq":
mode: "000755"
content: |
#!/bin/bash
EB_CONFIG_DEPLOY=$(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir)
EB_CONFIG_APP_LOG=$(/opt/elasticbeanstalk/bin/get-config container -k app_log_dir)
initctl stop sidekiq
@eccyan
eccyan / fann-test.rb
Created March 11, 2016 08:14
FANN テスト
require 'ruby-fann'
inputs = 0.step(Math::PI * 2, 0.01).map { |x| [x] }
desired_outputs = inputs.map { |i| [Math.sin(i.first)] }
train = RubyFann::TrainData.new(inputs: inputs, desired_outputs: desired_outputs)
fann = RubyFann::Standard.new(:num_inputs=>1, :hidden_neurons=>[10, 20], :num_outputs=>1)
fann.set_activation_function_hidden(:sigmoid_symmetric)
fann.set_activation_function_output(:sigmoid_symmetric)
fann.train_on_data(train, 2000, 20, 0.001)
@eccyan
eccyan / form_patterns.yml
Last active February 12, 2016 08:14
e-Gov 申請書XML 様式パターン
---
- '0001':
- G00005-A-250045-001_1
- '0002':
- G00005-A-360009-001_1
- '0003':
- G00006-A-250046-001_1
- '0004':
- G00004-A-360020-001_1
- '0005':
@eccyan
eccyan / procedures.yml
Last active February 12, 2016 07:55
e-Gov 手続き一覧
---
- "分類": "社会保険関係手続"
"手続ID": '4950000020415000'
e-Gov上での表示手続名(手続名称): "健康保険・厚生年金保険被保険者報酬月額算定基礎届(CSVファイル添付方式)/電子申請"
"申請データ形式": "個別ファイル署名形式"
"受付行政機関ID": '100495'
"申請書様式名称": "健康保険厚生年金保険CSV形式届書総括票"
"手続識別子(申請書)": 4950000020415F01
"申請書様式ID": '495000020415029955'
"申請書様式バージョン": '0001'
@eccyan
eccyan / rotate_application_versions,sh
Created January 7, 2016 05:30
Rotate application versions in Elastic Beanstalk
#!/bin/bash
APPNAME=
ROTATE_COUNT=200
application_versions() {
aws elasticbeanstalk describe-application-versions --application-name $APPNAME | \
jq -r '.ApplicationVersions | .[] | .VersionLabel' ;
}
delete_application_versions() {