Sunday, July 14, 2024

(メモ)ruby, cocoapodsのインストール

Macにruby と cocoapodsをインストールした時のメモです。


Darwin Hirokis-Mac-mini.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:19:05 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8112 arm64

Using CocoaPods
https://guides.cocoapods.org/using/using-cocoapods

Mac にプリインストールされている ruby はシステムが使用するらしく、削除しない、できない。
( ユーザは使わない方がいい雰囲気。)別途インストールする必要がある。

Upgrading default Ruby install on Mac
https://stackoverflow.com/questions/77590792/upgrading-default-ruby-install-on-mac


Mac に Ruby をインストール
https://zenn.dev/blendthink/articles/f0964e3642d33b


Seamlessly manage your app’s Ruby environment with rbenv.
https://github.com/rbenv/rbenv#readme


【Xcode】rbenvのRubyでCocoaPods
https://note.com/rect_angle/n/n2c24b3d96640


macOSに最新のRuby環境をインストールしてみた
https://www.next.inc/articles/2024/macos%E3%81%AB%E6%9C%80%E6%96%B0%E3%81%AEruby%E7%92%B0%E5%A2%83%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F.html


rbenvの使い方と仕組みについて
https://qiita.com/Kodak_tmo/items/73147ed4f0eec54d6e94

rbenv local バージョン でカレントディレクトリに.ruby-versionファイルを作成する。
rbenv global バージョン で ~/.rbenv/versionファイルを作成する。

Friday, August 06, 2021

Windows 10 のフォトで動画編集できない場合

 Windows 10 のフォトで動画編集できない、という現象に遭遇しました。

使用しているビデオカードが動画編集できないためのようです。

フォトの設定で、内蔵のビデオカードを使用するようにして、解決しました。


参考

Monday, March 22, 2021

音声ファイルの再生

Googleドライブに配置した音声ファイルをブログから再生できるか ? のテストです。

参考


Saturday, July 23, 2016

プリンタの設定がないPC上のExcelでは改ページプレビューで青い点線が動かせない

[概要]
Windows Vista + Excel 2007で、プリンタの設定がない場合に、Excelの改ページプレビューで青い点線が動かせない現象に遭遇しました。

[検証結果]
Windows 10 + Excel 2016で 同様の現象が発生するか確認しました。
改ページプレビューの青い点線は動かせませんでした。(青い実線は動かせました。)

[検証詳細]
まずプリンタを削除します。


次にExcelの改ページプレビューを確認します。
青い点線は動かせません。
青い実線は動かせます。



[プリンタが無い場合の回避策]
(Windows 10、Excel2016の場合)、「Microsoft Print To PDF」の設定をすると、青い点線が動かせるようになりました。以下設定手順です。
(追記2016/7/24 点線を動かすと点線が実線に変わります。)


設定を開き、「プリンターが一覧にない場合」選択します。


「ローカルプリンターまたはネットワークプリンターを手動設定で追加する」を選択


「FILE:(ファイルへ出力)」を選択


後は、次へ、次へと進めます。
プリンターとスキャナーに「Microsoft Print To PDF」が表示されれば設定完了です。


Monday, July 18, 2016

読書メモ:たった一日で即戦力になるExcelの教科書

知らなかった機能・テクニック

・Ctrl + 1・・・セルの書式設定を開く
・(複数セルを選んで)Ctrl + Enter ・・・複数セルに入力
・Ctrl + D ・・・一つ上のセルを複写
・Ctrl + R ・・・一つ左のセルを複写
・Ctrl + F2 ・・・Excel 2007以降で印刷プレビューを表示する
・Shift + F11 ・・・シートを追加する
・Alt + Shift + = ・・・オートSUMを実行する
・Ctrl + Space・・・アクティブセルのある列全体を選択する
・(IMEを半角英数モードにして)Shift + Space・・・アクティブセルのある行全体を選択する
・自動保存の設定 オプション→保存→ブックの保存
・オートコレクト(自動修正)の抑制 オプション→文章校正→オートコレクトのオプション
・予測変換の抑制 オプション→詳細設定→オートコンプリートを使用するチェックを外す
・F2 セル参照を矢印で表示する
・作業列、計算セル・・・複数のセルを&で結合させた列、セルを用意して、関数(SUMIFなど)やフィルタで利用可能にする
・形式を選択した貼り付けで、演算(四則演算)の結果を張り付けることができる。乗算(A×B)の場合(1)Bとなる値をコピー(2)Aとなる範囲を選択(2)形式を選択した貼り付けで、貼り付けに値、演算に乗算を選択する
・重くなったファイルを軽くする。最後のセルの位置を確認する。
・VLOOKUPで検索範囲の左側の列を参照したい場合は、OFFSETとMATCHの組み合わせで代用可
・右側列に値がある場合に、アクティブセルの右下隅をダブルクリックすると右側列の値の
あるセルと同じ行の位置までコピーする


データ分析について

・分析の基本は「分けて」、「比べる」こと
・ビジネスで数字を分析する際に3つの基本指標(前年比、予実比、構成比)
・平均値はあてにならない。



Thursday, August 13, 2015

Resizeing a virtual disk on VirtualBox

Resizing a vitual disk on VirtualBox is possible if the virutal disk is vdi or vhd and it is dynamic

If resizing size of the disk to 16G byte:


> "c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd CentOS7.vdi --resize 16384

> "c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --version
5.0.0r101573


Reference:
http://virtual-soft1.nnn2.com/?p=384 (Japanese)

Thursday, July 23, 2015

Dockerfile for freeswitch on CentOS6

Reference:
https://freeswitch.org/confluence/display/FREESWITCH/Installation

■ environment:

# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)

# docker version
Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64


 ■ create docker file:

# mkdir centos6.freeswitch/
# vi centos6.freeswitch/Dockerfile

----From here
FROM centos:6
RUN yum -y update
RUN yum -y install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
RUN rpm -Uvh http://files.freeswitch.org/freeswitch-release-1-0.noarch.rpm
RUN yum -y install --nogpgcheck freeswitch-config-vanilla
RUN yum -y install sox freeswitch-sounds*
----To here

■ build an image:

# docker build -t freeswitch/centos6 centos6.freeswitch/
# docker images

# docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
freeswitch/centos6   latest              cac2c68ad321        13 hours ago        1.449 GB
centos               6                   a005304e4e74        4 weeks ago         203.1 MB
hello-world          latest              91c95931e552        3 months ago        910 B
rtp-start-port" value="16384"
rtp-end-port" value="32768"

■ run the created image:

# docker run -it -p 5060:5060/udp -p 5080:5080/udp -p 16384-16484:16384-16484/udp cac2c68ad321

In the above case, the size of port range for RTP is just assigned 101.
To assign RTP port range from 16384 to 32768, it would be ok if you started the container without -p option for RTP and added a iptables' rule like;

# docker run -it -p 5060:5060/udp -p 5080:5080/udp cac2c68ad321

detach the container with Cntl-p, then Cntl-q. "172.17.0.8" is an IP address for the container;

# iptables -A DOCKER -p udp -d 172.17.0.8 --dport 16384:32768 -j ACCEPT


■ run freeswitch:

In the container
# /etc/rc.d/init.d/freeswitch start

You can try samples on the following page.

http://wiki.freeswitch.org/wiki/Getting_Started_Guide#Some_stuff_to_try_out.21

■ etc

* "--expose" option doesn't make rules in iptables:

# docker run -it --expose=5060/udp --expose=5080/udp --expose=16384-32768/udp CONTAINER-ID

* "-p" option takes time to create rules in iptables. it doesn't finish if the range is relatively big:

#docker run -it -p 5060:5060/udp -p 5080:5080/udp -p 16384-32768:16384-32768/udp CONTAINER-ID


* I got an error like following. It seemed to cause that iptables doesn't have a chain named "DOCKER." It looks fine that stopping firewalld and docker and starting firewalld first then docker.

 [root@localhost ~]# docker run -it -p 5060:5060/udp -p 5080:5080/udp -p 16384-32768:16384-32768/udp cac2c68ad321 /bin/bash
Error response from daemon: Cannot start container a0d6b9064fb0508f4681b27eb799595853ac05270a923e21cbd4bb1639824115: iptables failed: iptables --wait -t nat -A DOCKER -p udp -d 0/0 --dport 32768 -j DNAT --to-destination 172.17.0.38:32768 ! -i docker0: iptables: No chain/target/match by that name.
 (exit status 1)

Saturday, July 18, 2015

Compiling FreeSwitch on Lubuntu


I referenced the following page:

Debian/Ubunut and apt Based Systems
http://edoceo.com/howto/freeswitch#apt

~ # apt-get install gawk
~ # update-alternatives --set awk /usr/bin/gawk
~ # apt-get install autoconf build-essential git libtool make
~ # apt-get install libssl-dev libasound2-dev libogg-dev libvorbis-dev
~ # cd /usr/src
. # git clone -b v1.4 https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch
. # cd freeswitch
. # ./bootstrap.sh
. # ./configure ...
. # make
. # make install


The following commands are what I did actually. You may have to change them to fit your environment:

# apt-get install gawk
# update-alternatives --set awk /usr/bin/gawk
# apt-get install autoconf build-essential git libtool make
# apt-get install libssl-dev libasound2-dev libogg-dev libvorbis-dev
# apt-get install libjpeg-dev pkg-config sqlite3 libsqlite3-dev libcurl3 libcurl4-openssl-dev libpcre3-dev libspeex-dev  speex libspeex1 libspeexdsp-dev libldns-dev libedit-dev
# cd /usr/src/
# git clone -b v1.4 https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch
# cd /usr/src/freeswitch/
# ./bootstrap.sh
# ./configure
# make
# make install


Reference:

・No speex packages for freeswitch building on Ubuntu
http://askubuntu.com/questions/491479/no-speex-packages-for-freeswitch-building-on-ubuntu





Saturday, July 04, 2015

メモ Lubuntu サービスの管理

・登録されているサービスの一覧とその状態を表示する

sudo /usr/sbin/service --status-all

・指定したサービスを(開始|停止)する

sudo /usr/sbin/service サービス名 (start|stop)

・サービスを(有効|無効)にする

sudo /usr/sbin/update-rc.d サービス名 (enable|disable)

※ランレベルを指定することも可能


Sunday, November 30, 2014

autohotkeyでコントロールのClassNNを調べる

Windowsで自動操作を行うためにautohotkeyを調べています。

クリックするコントロールを指定する場合に、ClassNNを調べる必要があり、それはautohotkey付属のWindow spyを使うということなのですが、Windows 8.1では、shift+alt+tabでWindow spyにフォーカスがうまく移せません。

で、調べているとautohotkeyでコントロールの情報を取得することができるようです。これを少し変更してみました。

使い方は次の通りです。


  1. 調べたいコントロールの上にマウスをのせて、Ctrlキーとマウスの左ボタンを押す。
  2. ポップアップで情報が表示され、その情報がクリップボードにコピーされます。

; Reference:
; http://www.autohotkey.com/board/topic/116344-window-spy-shiftalttab-doesnt-freeze-text/

^LButton::
;get the position of mouse pointer and a handle id of the control under the mouse pointer
MouseGetPos, M_X, M_Y, M_Win, M_Ctrl, 2

;get text in the control
ControlGetText, OutputText,,ahk_id %M_Ctrl%

;set focus to the control to get ClassNN of the %M_Ctrl%
ControlFocus,,ahk_id %M_Ctrl%
ControlGetFocus, OutputClassNN, ahk_id %M_Win%

info = Win:%M_Win%`nCtrl:%M_Ctrl%`nText:%OutputText%`nClassNN:%OutputClassNN%`n

Msgbox, %info% 
Clipboard = %info%
Return

Sunday, November 09, 2014

CentOS6にインストールしたAsterisk11の設定

CentOS 6にAsterisk 11をインストールするの続きです。今回はAsterisk 11の設定を行います。Asteriskで使用するプロトコルが利用できるようにOS側の設定も合わせて行います。

* OS側設定(iptables)

参考ページ:

各プロトコルで使用するポート番号の範囲を以下のようにします。
  •   SIPプロトコル 15060
  •   RTPプロトコル 20000-30000
iptablesの設定を行います。
 
iptables -A INPUT -p udp -m udp --dport 15060 -j ACCEPT
iptables -A OUTPUT -p udp -m udp --sport 15060 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 20000:30000 -j ACCEPT
iptables -A OUTPUT -p udp -m udp --sport 20000:30000 -j ACCEPT

設定後はiptables-saveコマンドで設定を次回起動時に有効になるように保存します。

* Asterisk側設定

インストールでmake config すると/etc/asteriskに設定ファイルがコピーされるがそのままでは使えないので、/etc/asterisk.sampleにサンプルとして移動しておく

Asteriskの起動に必要なのは以下の8ファイル(●はサンプルからコピー。★は編集したものを使用します。)

●asterisk.conf
●cli.conf
●cli_aliases.conf
●logger.conf
●modules.conf
★rtp.conf
★sip.conf
★extensions.conf

★rtp.conf

[general]
rtpstart=20000
rtpend=30000
★extensions.conf
内線番号1XXへの発信を行うだけの設定です。

[general]

[globals]

[default]


[service]
exten => _1XX,1,Dial(SIP/${EXTEN})
★sip.conf
SIPクライアントの設定を2つ用意します。内線番号それぞれ100と101です。
secretの部分がパスワードになります。「ひみつ」を変更してください。

[general]
udpbindaddr=0.0.0.0:15123 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
transport=udp ; Set the default transports. The order determines the primary default transport.
srvlookup=yes ; Enable DNS SRV lookups on outbound calls

[authentication]

[basic-options](!) ; a template
dtmfmode=rfc2833
type=friend

[natted-phone](!,basic-options) ; another template inheriting basic-options
directmedia=no
host=dynamic
nat=yes

[my-codecs](!) ; a template for my preferred codecs
disallow=all
allow=ilbc
allow=g729
allow=gsm
allow=g723
allow=ulaw

[100](natted-phone,my-codecs)
context=service
secret=ひみつ

[101](natted-phone,my-codecs)
context=service
secret=ひみつ

CentOS 6にAsterisk 11をインストールする

CentOS6にAsterisk 11(正確には11.12.0)をインストールしたときのメモです。

参考ページ:

1. CentOS Updates (If Any)
2. Disabling SELinux
3. Reboot
4. Installation of Dependencies for Asterisk 11
5. Downloading your Asterisk Source Code
6. Extraction of Downloaded Files
7. DAHDI Installation
8. LibPRI Installation
9. Change Asterisk Directory
10. Run Configure Script for Asterisk
11. Install Sample Files
12. Start DAHDI
13. Start Asterisk

DAHDI(Digium/Asterisk Hardware Device Interface)は使わないので、7,8,12はスキップする。

1 CentOS Updates (If Any)
sudo yum update -y

2 Disabling SELinux
selinuxenabled ; echo $?
で0ならSELinux無効になっている。

3 Reboot
/usr/bin/reboot
/sbin/shutdown -r よりは確実

4 Installation of Dependencies for Asterisk 11
yum install -y make wget openssl-devel ncurses-devel newt-devel libxml2-devel kernel-devel gcc gcc-c++ sqlite-devel

5 Downloading your Asterisk Source Code

6 Extraction of Downloaded Files
sudo tar zxf asterisk-11-current.tar.gz 

9 Change Asterisk Directory
cd asterisk-11.12.0/

10 Run Configure Script for Asterisk
64bitなので

sudo ./configure --libdir=/usr/lib64 && sudo make menuselect && sudo make && sudo make install

11 Install Sample Files
デフォルトのconfigではAsteriskは使用できませんが、とりあえず、所定の/etc/asteriskに各種設定ファイルを置きました。(Asterisk設定時には別ディレクトリに移動します。)

sudo make samples


Tuesday, June 10, 2014

Lubuntu 14.04

Let's note R8にインストールしたLubuntuの設定。

・ハイバネート
インストールした時点ではハイバネートできない。所定の場所に設定を書く必要がある。
https://help.ubuntu.com/14.04/ubuntu-help/power-hibernate.html

・ラップトップの蓋を閉じたときにハイバネートさせる。
(メニューから設定→電源管理を選択。設定画面が表示される。)

・タッチパッド

~/.config/CustomTouchpadSetting.sh
というファイルを以下の内容で作成する。

#!/bin/sh
DEVICE="SynPS/2 Synaptics TouchPad"
xinput set-prop "$DEVICE" --type=int "Synaptics Circular Scrolling" 1
xinput set-prop "$DEVICE" --type=int "Synaptics Circular Scrolling Trigger" 0

参考:
http://ubuntuforums.org/showthread.php?t=1490737&p=9727751#post9727751

このファイルにユーザの実行権限を与えておいて、さらに起動時に実行するように設定する。
(メニューから設定→LXSessionのデフォルトのアプリケーション)

Sunday, May 11, 2014

CentOSでEPELリポジトリを使用する

64ビット版CentOS6でEPELリポジトリを使用する設定をしたときのメモ

参考
http://qiita.com/muniere/items/6c4923a070cbbd824f39

repoファイルの編集はリポジトリbaseのpriorityを1、それ以外のリポジトリのpriorityを2にするため。

193 sudo yum install yum-priorities
194 vi /etc/yum.repos.d/CentOS-Base.repo

[base]
…
priority=1
[updates]
…
priority=2
[extra]
…
priority=2
[centosplus]
…
priority=2
[contrib]
…
priotiry=2

196 uname -a
197 wget http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
199 curl -o epel-release-6-8.noarch.rpm http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
201 rpm -ivh epel-release-6-8.noarch.rpm
205 vi /etc/yum.repos.d/epel.repo

[epel]
...
enabled=1
#yum-priority
priority=2

Monday, September 10, 2012

AndroidスマフォでDropboxからフォルダごとコピーする

DropboxからAndroidスマフォにファイルをフォルダごとコピーする場合、パソコンを使っていたのですが、スマフォ単体でもできることに気づきました。(遅いか)

確認したのは以下のアプリです。

ES~は専用のミュージックプレイヤがついています。

  • プレイリストの作成
    • mp3ファイルを格納しているフォルダ内で、menu->オペレーション->すべて選択、続けて、menu->オペレーション->ミュージック
  • プレイヤの起動
    • menu->その他->ミュージック

Saturday, August 04, 2012

moshを使ってみる

moshを使ってみようと思い、インストールしてみました。
クライアント(Ubuntu 12.04)はパッケージがあります。

$ sudo apt-get install mosh
$ mosh -v
mosh 1.1.3

サーバ側(CentOS 5.8)はコードをコンパイルしました。以下手順です。

$ sudo yum install libutempter-devel zlib-devel ncurses-devel gcc-c++
                 
$ wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz               
$ tar zxf protobuf-2.4.1.tar.gz                                                 
$ cd protobuf-2.4.1                                                             
$ ./configure --prefix=/usr                                                     
$ make                                                                          
$ sudo make install                                                             
                                                                                
$ wget https://github.com/downloads/keithw/mosh/mosh-1.2.2.tar.gz               
$ tar zxf mosh-1.2.2.tar.gz                                                     
$ cd mosh-1.2.2                                                                 
$ ./configure                                                                   
$ make                                                                          
$ sudo make install 

サーバ側で、iptablesでUDPボートを開ける必要がありますが、OUTPUTチェーンをDROPポリシにしている場合は、OUTPUT側の設定も必要でした。

$ sudo /sbin/iptables -A INPUT -p udp -m udp --dport 60000:61000 -j ACCEPT                 
$ sudo /sbin/iptables -A OUTPUT -p udp -m udp --sport 60000:61000 -j ACCEPT  
$ sudo /sbin/service iptables save

上記の環境で接続を確認しました。

$ mosh サーバ名

ログイン後、クライアントをハイバネート、再起動しました。端末はサーバに接続されたままコネクションが切れた旨のメッセージもなく、コマンドも実行できました。

参考:

Mosh; the mobile shell
http://mosh.mit.edu/

Carpe Diem mosh バージョン 1.2
http://www.sssg.org/blogs/naoya/archives/2267

mutsune’s blog mosh のインストール
http://d.hatena.ne.jp/mutsune/20120416/1334590736

Saturday, July 21, 2012

にがおえ(似顔絵ジェネレータ)

にがおえ

似顔絵ジェネレータです。スマートフォンでも使えます。SNSのプロフィール等にどうぞ。



HTML形式メールでブログ投稿

たまにメールでブログ(Blogger)を投稿していました。ずっとテキスト+写真添付でメール送信していましたが、試しに写真付きのHTMLメールで投稿してみました。

http://hrkzzz.blogspot.jp/2012/07/blog-post_20.html

普通に表示できるんですね。

Saturday, July 07, 2012

タイトル変えました。

タイトルを業務連絡から変えました。取り上げる内容は変わらないと思います。よろしくお願いします。

SVGで画像へのリンクを相対パスにする

Windowsで管理していたsvgファイルをUbuntuに持ってきたところ,
inkscapeが画像が見つからないと言う。
<image
       style="display:inline"
       y="0"
       x="0"
       id="image2994"
       xlink:href="file:///C:/foo/bar/image.png"
       height="300"
       width="300" />
を、以下のようにした。
<image
       style="display:inline"
       y="0"
       x="0"
       id="image2994"
       xlink:href="image.png"
       height="300"
       width="300" />


参考:
http://www.kabipan.com/computer/inkscape/index.old.html