Skip to content

Instantly share code, notes, and snippets.

View UedaTakeyuki's full-sized avatar
💭
🐟 🐠 🐡 🐢  🌸 🌺 🌹 🌷 🌻 🌼 🐝 🐸

Dr. Takeyuki Ueda UedaTakeyuki

💭
🐟 🐠 🐡 🐢  🌸 🌺 🌹 🌷 🌻 🌼 🐝 🐸
View GitHub Profile
@UedaTakeyuki
UedaTakeyuki / install.sh
Created January 3, 2016 09:25
Download and install ElasticSearch 1.7 on RaspberryPi.
wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.4.deb
sudo dpkg -i elasticsearch-1.7.4.deb
@UedaTakeyuki
UedaTakeyuki / install_xfs.sh
Last active January 27, 2016 01:28
install xsf on Raspberry Pi.
# reference: http://www.limemo.net/blog/2013/12/ラズベリーパイを使ってみる-標準より高速なフ.html
sudo apt-get install xfsprogs
# format
#mkfs.xfs /dev/(デバイス名)
# mount
# sudo mount -t xfs /dev/(デバイス名) /mnt/hoge
@UedaTakeyuki
UedaTakeyuki / install_exfat.sh
Last active July 9, 2018 11:49
Install exfat on Raspberry Pi
# reference: http://www.limemo.net/blog/2013/12/ラズベリーパイを使ってみる-windows-vista以降で使えるフ.html
sudo apt-get install exfat-fuse exfat-utils
# format
#mkfs.exfat /dev/(デバイス名)
# mount
# sudo mount -t exfat /dev/(デバイス名) /mnt/hoge
@UedaTakeyuki
UedaTakeyuki / alsa-base.conf
Last active January 27, 2016 02:07
/etc/modprove.d/alsa-base.conf for reorder alsa device on raspbian jessie.
# reference: http://raspberrypi.stackexchange.com/questions/40831/how-do-i-configure-my-sound-for-jasper-on-raspbian-jessie
# This sets the index value of the cards but doesn't reorder.
options snd_usb_audio index=0
options snd_bcm2835 index=1
# Does the reordering.
options snd slots=snd-usb-audio,snd-bcm2835
@UedaTakeyuki
UedaTakeyuki / install_julius.sh
Created January 27, 2016 02:06
Install "Julius" on Raspberry pi
# reference: http://qiita.com/t_oginogin/items/f0ba9d2eb622c05558f4
wget --trust-server-names 'http://osdn.jp/frs/redir.php?m=iij&f=%2Fjulius%2F60273%2Fjulius-4.3.1.tar.gz'
tar xvzf julius-4.3.1.tar.gz
cd julius-4.3.1/
./configure
make
cd ..
mkdir ~/julius-kits
cd ~/julius-kits
@UedaTakeyuki
UedaTakeyuki / install_laravel.sh
Created January 27, 2016 02:15
Install laravel 5.1 on Raspberry Pi.
# reference: http://stackoverflow.com/questions/31230133/how-to-make-a-raspberry-pi-2-laravel-5-1-server
apt-get install mysql-server mysql-client apache2 php5 php5-cli libapache2-mod-php5 php5-mysql php5-curl php5-gd php-pear php5-imagick php5-mcrypt php5-memcache php5-mhash php5-sqlite php5-xmlrpc php5-xsl php5-json php5-dev libpcre3-dev
sudo curl -sS https://getcomposer.org/installer | sudo php5
# create project
#composer.phar create-project laravel/laravel --prefer-dist projectName
#sudo chown -R www-data:www-data /var/www/
#sudo chmod -R 775 projectName
@UedaTakeyuki
UedaTakeyuki / 8192cu.conf.sh
Created February 9, 2016 02:09
Set 8192cu wifi controller power management feature "OFF".
# http://denshikousaku.net/fix-sluggish-response-of-raspberry-pi-wifi-adaptor
sudo sh -c 'echo "options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1" >>/etc/modprobe.d/8192cu.conf'
@UedaTakeyuki
UedaTakeyuki / mh_z19.py
Last active March 19, 2021 13:31
MH-Z19 CO2 Sensor reading.
# http://eleparts.co.kr/data/design/product_file/SENSOR/gas/MH-Z19_CO2%20Manual%20V2.pdf
# http://qiita.com/UedaTakeyuki/items/c5226960a7328155635f
import serial
import time
def mh_z19():
ser = serial.Serial('/dev/ttyAMA0',
baudrate=9600,
bytesize=serial.EIGHTBITS,
parity=serial.PARITY_NONE,
# lol_dht22: Setup to use dht22 on Raspbian
git clone https://github.com/technion/lol_dht22
cd lol_dht22
./configure
make
cd ..
@UedaTakeyuki
UedaTakeyuki / say.php
Created June 29, 2016 09:37
have Raspberry Pi talk something from Browser.
<?php
//$command = 'sudo sh -c "/home/pi/install/aquestalkpi/AquesTalkPi '. $_POST["phrase"] . ' | aplay"';
$command = 'sudo sh -c "/home/pi/install/aquestalkpi/AquesTalkPi '. $_POST["phrase"] . ' | aplay > /dev/null &"';
//shell_exec($command);
exec($command);
?>