Skip to content

Instantly share code, notes, and snippets.

View koji's full-sized avatar
🔍
I may be slow to respond.

koji koji

🔍
I may be slow to respond.
View GitHub Profile

Change Timezone

$ sudo raspi-config 
Choose Internationalisation Options to change timezone

Activate ssh

$ sudo raspi-cofig

Select "Interfacing something", then activate ssh
# Make a new user and add the new user to sudo group
$ sudo adduser username
$ sudo adduser username sudo
$ sudo vim /etc/sudoers
#pi ALL=(ALL) NOPASSWD: ALL
$ sudo awk -F: '($2 == "") {print}' /etc/shadow

Settings for security add a new user

$ sudo adduser ngems-koji

type password

add a new user to sudo group

@koji
koji / magenta.md
Last active April 21, 2017 07:23
Magenta test with sample commands

Magenta

to generate midi files with melody data
$ cd /magenta/magenta/models/melody_rnn
$ wget http://download.magenta.tensorflow.org/models/basic_rnn.mag
$ wget http://download.magenta.tensorflow.org/models/lookback_rnn.mag
$ melody_rnn_generate --config=basic_rnn --bundle_file=basic_rnn.mag --output_dir=./ --num_outputs=10 --num_steps=128 --primer_melody="[60]"

to generate midi files with polyphony data
@koji
koji / setup_camera.md
Last active May 6, 2017 01:42
setup a webcam on a Raspberry Pi
# install software
$ sudo apt-get install subversion libjpeg-dev imagemagick
$ svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer mjpg-streamer


# make mjpg-streamer
$ cd mjpg-streamer
$ make
@koji
koji / p5js_generator.md
Created May 17, 2017 15:12
p5js generator

install npm packages

$ npm install -g yo
$ npm install -g generator-p5
$ yo p5js
option
$ npm install -g gulp bower
@koji
koji / anaconda_install.md
Created May 21, 2017 18:13
How to install anaconda on mac

Install pyenv

$ brew update
$ brew upgrade
$ brew install pyenv
$ pyenv --version

Install Anaconda

@koji
koji / python_calc.py
Last active May 25, 2017 01:59
python_calc created by sleepy-maker - https://repl.it/IQ0d/3
from decimal import *
print(Decimal('0.1') + Decimal('0.1') + Decimal('0.1'))
print(0.1 + 0.1 + 0.1)
myHope = input('what do you want to do during the summer?')
print('you want to ' + myHope + '. Nice!')
a = 3
b = 5
print('a+b=' + str(a+b))
In file included from /usr/include/stdio.h:27:0,
                 from ../../../libgcc/../gcc/tsystem.h:87,
                 from ../../../libgcc/libgcc2.c:27:
/usr/include/features.h:364:25: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
Makefile:466: recipe for target '_muldi3.o' failed
make[2]: *** [_muldi3.o] Error 1
make[2]: Leaving directory '/root/Downloads/gcc-5.4.0/build/armv7l-unknown-linux-gnueabihf/libgcc'
Makefile:13268: recipe for target 'all-target-libgcc' failed