Rails new でのエラー

Using rails 5.0.1
Using sass-rails 5.0.6
Bundle complete! 15 Gemfile dependencies, 53 gems now installed.
Gems in the groups development and test were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
run bundle exec spring binstub –all
bundler: failed to load command: spring (/home/uchida/.gem/ruby/2.4.0/bin/spring)
Gem::Exception: can’t find executable spring
/home/uchida/.gem/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/rubygems_integration.rb:393:in `block in replace_bin_path’
/home/uchida/.gem/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/rubygems_integration.rb:410:in `block in replace_bin_path’
/home/uchida/.gem/ruby/2.4.0/bin/spring:22:in `

Google Apps Script

サンプルのスクリプト

function  aaa () {
Browser.msgBox(“aaa”);
}

function  bbb () {
Browser.msgBox(“bbb”);
}

function  ccc () {
Browser.msgBox(“ccc”);
}

メールのスプレッドシートへの取り込み

function searchContactMail_spread () {

const strTerms = ‘テストメールを送ります’

var myThreads = GmailApp.search(strTerms, 0, 500)
var myMsgs = GmailApp.getMessagesForThreads(myThreads)

var valMsgs = []

for(var it = 0;it < myMsgs.length;it++) { valMsgs[it] = [] valMsgs[it][0] = myMsgs[it][0].getDate() valMsgs[it][1] = myMsgs[it][0].getFrom() valMsgs[it][2] = myMsgs[it][0].getSubject() valMsgs[it][3] = myMsgs[it][0].getPlainBody() } if(0 < myMsgs.length) { const row_start = 18 SpreadsheetApp.getActiveSheet().getRange(row_start, 1, it, 4).setValues(valMsgs) } } アクティブなセルの情報の取得 function GetActiveCell() { const objSpreadsheet = SpreadsheetApp.getActiveSpreadsheet() const objSheet = objSpreadsheet.getActiveSheet() const objCell = objSheet.getActiveCell() Logger.log("列 : " + objCell.getColumn()) Logger.log("行 : " + objCell.getRow()) Logger.log("値 : " + objCell.getValue()) }

python で、ネットワークの到達を調べる

# -*- coding: utf-8 -*-
#
import subprocess
#
# ——————————————————————–
def ping_check_proc (ip_domain):
rvalue = subprocess.call ([“ping”,”-c 1″,ip_domain])
if (rvalue == 0):
print (“your IP is alive”)
else:
print (“Check your IP”)
# ——————————————————————–
#ip=”8.8.8.8″
ip=”172.8.8.8″
# ip=”ekzemplaro.org”
ip=”tekzemplaro.org”
#
ping_check_proc (ip)
#
# ——————————————————————–

zencart

zc-v1-series-151-ja.zip をダウンロード

http://localhost/zc/zc_install/

/etc/php/php.ini
[Date]
date.timezone = “Asia/Tokyo”

cd admin/includes
cp dist-configure.php configure.php
chmod 0666 configure.php

cd includes
cp dist-configure.php configure.php
chmod 0666 configure.php

chmod 0777 cache/
chmod 0777 images/
chmod 0777 includes/languages/english/html_includes/
chmod 0777 logs/
chmod 0777 media/
chmod 0777 pub/
chmod 0777 admin/backups/
chmod 0777 admin/images/graphs/

CasperJS

Arch Linux へのインストール
# pacman# pacman -S phantomjs
$ yaourt -Sb casperjs

確認
$ casperjs –version
1.1.2

サンプルのプログラム
//
//——-ex01.js——-
//
var casper = require(‘casper’).create()

casper.start(‘http://ekzemplaro.org’, function() {
this.capture(‘ekzemplaro.png’)
})

casper.run()

実行方法
casperjs ex01.js

Raspberry Pi & USB mic

# apt install alsa-utils sox libsox-fmt-all

$ lsusb
Bus 001 Device 004: ID 14ed:2904 Shure Inc.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

$ cat /proc/asound/modules
0 snd_bcm2835
1 snd_usb_audio

/usr/share/alsa/alsa.conf を編集する。

再起動

pyaudio

pyaudio のサンプルプログラム
Arch Linux で動作を確認しました。
確認は、cplay output.wav で行いました。

#! /usr/bin/python
#
import pyaudio
import wave

CHUNK = 1024
FORMAT = pyaudio.paInt16 # int16型
CHANNELS = 2 # ステレオ
RATE = 44100 # 441.kHz
RECORD_SECONDS = 5 # 5秒録音
WAVE_OUTPUT_FILENAME = “output.wav”

p = pyaudio.PyAudio()

stream = p.open(format=FORMAT,
channels=CHANNELS,
rate=RATE,
input=True,
frames_per_buffer=CHUNK)

print(“* recording”)

frames = []

for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):
data = stream.read(CHUNK)
frames.append(data)

print(“* done recording”)

stream.stop_stream()
stream.close()
p.terminate()

wf = wave.open(WAVE_OUTPUT_FILENAME, ‘wb’)
wf.setnchannels(CHANNELS)
wf.setsampwidth(p.get_sample_size(FORMAT))
wf.setframerate(RATE)
wf.writeframes(b”.join(frames))
wf.close()