Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CarloCattano/91f0e17d025f3346198ad5763a092f82 to your computer and use it in GitHub Desktop.
Save CarloCattano/91f0e17d025f3346198ad5763a092f82 to your computer and use it in GitHub Desktop.

INSTALL basics

sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt install -y nodejs npm  puredata  python3-pip python-pip python3 python  -y

INTERNET HOTSPOT FROM THE PI ;-) good for osc control , servers etc when you dont need internet

wget -q https://git.io/voEUQ -O /tmp/raspap && bash /tmp/raspap

GRAPHICAL INTERFACE FOR RASPBIAN OS ( installed lite before, only termnal)

    sudo apt-get install --no-install-recommends xinit

    sudo apt-get install -y raspberrypi-ui-mods rpi-chromium-mods

    sudo reboot
boot to the console for most things and only start the Pixel desktop as required using the command startx

move from pc to pi

    scp (-r recursive) C:\file\place\  pi:/home/pi/

resources (activity monitor with terminal style)

htop

disk usage

du  -h --max-depth=1

netscan //// find devices

ifconfig // shows your ip , then nmap with your local range

sudp apt-get install nmap 
nmap -sn 192.168.1.0/24

FIND

find -name FileName
whereis thispatch.pd 
        thispatch*

permissions

sudo ls -altrh /home/pi/foldertoCheck

Send folder to raspberry from laptop through ssh

scp -r folder_to_send pi:folder_to_receive/

SSH KEYGEN (create a ssh authentication key so no password login is required)

C:\Users\x\.ssh
config[file]--
Host pi
HostName 192.168.0.19
User pi
----
ssh-keygen -t rsa -b 4096 -C "your@mail.com"
scp .ssh/id_rsa.pub  pi:/home/pi/

remove old keys

rm /home/pi/.ssh/authorized_keys  

add the key to the authorized devices list

cat /home/pi/id_rsa.pub >> /home/pi/.ssh/authorized_keys

Pure Data

Example . Start puredate without GUI (from terminal) with a sample rate of 44100 , verbose to debug more messages

The name of the interface, in this case MobilePre , size of the audio buffer -audiobuf 32 samples , add a midi device in

named /dev/midi2 in my system .

  pd -nogui -r 44100 -verbose -audioadddev MobilePre -audiobuf 32 -midiaddindev /dev/midi2

  // see pf -h for a full list of commands available
  //or alternatively
  
  noaudioin: True
  audiobuf: 32
  rate: 44100
  nomidiin: False
  midiindev1: 0
  nomidiout: False
  midioutdev1: 0
  path1: /home/pi/pd/externals
  npath: 1
  standardpath: 1
  verbose: 1
  flags: -nogui -rt
  
  sudo ln -s  /home/pi/.pdsettings /root/.pdsettings

PISERVER PD

control of the patches via web interface from any device, see my github AutomataPdosc thingy
npm install socket.io express http

AUDIO TEST

speaker-test -t sine -f 440 -c 2 -s 1 
amixer cset numid=1 -- 98%

ALIASES

Create your own customized commands editing this file then tiping the alias triggers the command

nano .bash_aliases

    #### check pi reported temperature from terminal 
    alias temp='vcgencmd measure_temp'
    alias restart='sudo reboot'
    alias ciao='sudo shutdown -h now'
    alias delf='sudo rm -r'
    alias pgrep='ps aux | grep '
    alias bhist='cat ~/.bash_history | grep '
    ```
#### fancy temp meter GPU AND CPU ºC
https://www.cyberciti.biz/faq/linux-find-out-raspberry-pi-gpu-and-arm-cpu-temperature-command/
#### wifi setup
    You can create a file called wpa_supplicant.conf and drag it to the SD card on your laptop with the raspberry OS
#### at boot it will try to connect to that wifi with the specified data

#### wpa_supplicant.conf //////

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    country=DE

    network={
            ssid="WIFI NAME"
            psk="WIFI PASSWORD"
            proto=RSN
            key_mgmt=WPA-PSK
            pairwise=CCMP
            auth_alg=OPEN
    }

/////////////////////////////////////

### i2c display
```zsh
    OLED Pin	 Pi GPIO  Pin	   Notes
    Vcc	      1 	           3.3V
    Gnd	      14            Ground
    SCL	      5	            I2C SCL
    SDA	      3	            I2C SCA
git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git

i2cdetect -y 1
@CarloCattano
Copy link
Author

CarloCattano commented Apr 2, 2022

// ~/.tmux.conf

set -g default-terminal 'screen-256color'
set -g history-limit 10000
set -g status-fg green
set -g status-bg black
set -g mouse on
#bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment