Skip to content

Instantly share code, notes, and snippets.

@Norcoen
Forked from AnthonyDiGirolamo/pi_setup.sh
Created September 15, 2021 02:02
Show Gist options
  • Select an option

  • Save Norcoen/5cd92a8a9e5e65dba95c1baee39532da to your computer and use it in GitHub Desktop.

Select an option

Save Norcoen/5cd92a8a9e5e65dba95c1baee39532da to your computer and use it in GitHub Desktop.

Revisions

  1. @AnthonyDiGirolamo AnthonyDiGirolamo revised this gist Mar 11, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion pi_setup.sh
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@

    sudo apt-get -y update
    sudo apt-get -y upgrade
    sudo apt-get -y install vim mpich2 xboxdrv
    sudo apt-get -y install vim mpich2 xboxdrv libglew-dev

    sudo sed -i 's/CODESET=.*/CODESET="guess"/
    s/FONTFACE=.*/FONTFACE="Terminus"/
  2. @AnthonyDiGirolamo AnthonyDiGirolamo revised this gist Mar 6, 2014. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions pi_setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,15 @@
    #!/usr/bin/env bash

    # ~/apps/sshpass/bin/sshpass -p 'raspberry' scp -r archives [email protected]:~/ ; ~/apps/sshpass/bin/sshpass -p 'raspberry' ssh [email protected] 'sudo mv ~/archives/* /var/cache/apt/archives/'
    # ~/apps/sshpass/bin/sshpass -p 'raspberry' scp pi_setup [email protected]:~/ ; ~/apps/sshpass/bin/sshpass -p 'raspberry' ssh [email protected] 'bash ~/pi_setup pi9 109'
    # for pi in 110 111 112
    # do
    # ~/apps/sshpass/bin/sshpass -p 'raspberry' scp pi_keys [email protected].$pi:~/.ssh/authorized_keys
    # ~/apps/sshpass/bin/sshpass -p 'raspberry' scp pi_hosts pi_mpihostsfile [email protected].$pi:~/
    # ~/apps/sshpass/bin/sshpass -p 'raspberry' scp ~/.ssh/config [email protected].$pi:~/.ssh/
    # ~/apps/sshpass/bin/sshpass -p 'raspberry' ssh [email protected].$pi 'cat /etc/hosts pi_hosts | tee hosts ; sudo cp hosts /etc/hosts'
    # done

    sudo apt-get -y update
    sudo apt-get -y upgrade
    sudo apt-get -y install vim mpich2 xboxdrv
    @@ -67,3 +77,4 @@ EOF
    ssh-keygen -N '' -f /home/pi/.ssh/id_rsa

    sudo reboot

  3. @AnthonyDiGirolamo AnthonyDiGirolamo created this gist Mar 6, 2014.
    69 changes: 69 additions & 0 deletions pi_setup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,69 @@
    #!/usr/bin/env bash

    sudo apt-get -y update
    sudo apt-get -y upgrade
    sudo apt-get -y install vim mpich2 xboxdrv

    sudo sed -i 's/CODESET=.*/CODESET="guess"/
    s/FONTFACE=.*/FONTFACE="Terminus"/
    s/FONTSIZE=.*/FONTSIZE="12x24"/' /etc/default/console-setup

    sudo sed -i '
    s/XKBMODEL=.*/XKBMODEL="pc105"/
    s/XKBLAYOUT=.*/XKBLAYOUT="us"/
    s/XKBVARIANT=.*/XKBVARIANT=""/
    s/XKBOPTIONS=.*/XKBOPTIONS="terminate:ctrl_alt_bksp"/' /etc/default/keyboard

    sudo tee /etc/default/locale <<-EOF
    # File generated by update-locale
    LANG=en_US.UTF-8
    EOF

    sudo tee /etc/locale.gen <<-EOF
    # This file lists locales that you wish to have built. You can find a list
    # of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add
    # user defined locales to /usr/local/share/i18n/SUPPORTED. If you change
    # this file, you need to rerun locale-gen.
    #
    en_US.UTF-8 UTF-8
    EOF

    sudo locale-gen

    # sudo dpkg-reconfigure tzdata

    for file in \
    /etc/hostname \
    /etc/hosts \
    /etc/ssh/ssh_host_rsa_key.pub \
    /etc/ssh/ssh_host_dsa_key.pub
    do
    [ -f $file ] && sudo sed -i "s/raspberrypi/$1/" $file
    done

    sudo hostname $1

    sudo tee /etc/network/interfaces <<-EOF
    auto lo
    iface lo inet loopback
    # iface eth0 inet dhcp
    auto eth0
    iface eth0 inet static
    address 192.168.3.$2
    gateway 192.168.3.1
    netmask 255.255.255.0
    network 192.168.3.0
    broadcast 192.168.3.255
    # allow-hotplug wlan0
    # iface wlan0 inet manual
    # wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
    # iface default inet dhcp
    EOF

    ssh-keygen -N '' -f /home/pi/.ssh/id_rsa

    sudo reboot