Skip to content

Instantly share code, notes, and snippets.

View eccyan's full-sized avatar

eccyan eccyan

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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