Difference between revisions of "Issue Printer"

From CCCHHWiki
Jump to: navigation, search
m
m
Line 17: Line 17:
 
<pre>
 
<pre>
 
nmap 10.42.23.0/24 -p 22 | grep open -B 4 | grep -Po '\d+\.\d+\.\d+\.\d+' | tee /tmp/wo
 
nmap 10.42.23.0/24 -p 22 | grep open -B 4 | grep -Po '\d+\.\d+\.\d+\.\d+' | tee /tmp/wo
### power the Orange Pi on and wait a minute
+
# power the Orange Pi on and wait a minute
 
sleep 60s
 
sleep 60s
 
nmap 10.42.23.0/24 -p 22 | grep open -B 4 | grep -Po '\d+\.\d+\.\d+\.\d+' | tee /tmp/w
 
nmap 10.42.23.0/24 -p 22 | grep open -B 4 | grep -Po '\d+\.\d+\.\d+\.\d+' | tee /tmp/w
Line 32: Line 32:
 
sed -i -e 's/GOVERNOR/#GOVERNOR/' /etc/default/cpufrequtils
 
sed -i -e 's/GOVERNOR/#GOVERNOR/' /etc/default/cpufrequtils
 
echo -e '#GOVERNOR=powersave\nGOVERNOR=conservative\nMAX_SPEED=816000' | sudo tee -a /etc/default/cpufrequtils
 
echo -e '#GOVERNOR=powersave\nGOVERNOR=conservative\nMAX_SPEED=816000' | sudo tee -a /etc/default/cpufrequtils
 +
/etc/init.d/cpufrequtils restart
 
# maximize partition size
 
# maximize partition size
 
echo ", +" | sfdisk -N 1 /dev/mmcblk0 --force
 
echo ", +" | sfdisk -N 1 /dev/mmcblk0 --force
Line 45: Line 46:
 
sudo apt update
 
sudo apt update
 
sudo apt upgrade
 
sudo apt upgrade
 +
# set up wireless network
 +
sudo systemctl stop wpa_supplicant
 +
sudo systemctl disable wpa_supplicant
 +
sudo systemctl disable NetworkManager
 +
sudo systemctl disable NetworkManager-wait-online
 +
sudo systemctl disable networking.service
 +
echo ctrl_interface=/run/wpa_supplicant | sudo tee /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
 +
wpa_passphrase $SSID $PSK | sudo tee -a /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
 +
sudo systemctl start wpa_supplicant@wlan0
 +
sudo systemctl enable wpa_supplicant@wlan0
 +
echo -e '[Match]\nName=wlan0\n\n[Network]\nAddress=10.42.23.234/24\nGateway=10.42.23.1\nDNS=10.42.23.53\n' | sudo tee /etc/systemd/network/20-wireless.network
 +
sudo systemctl start systemd-networkd
 +
sudo systemctl enable systemd-networkd
 +
# reboot tut gut (german proverb)
 +
sudo reboot
 
</pre>
 
</pre>

Revision as of 01:05, 2 July 2018

Write Orange Pi Image to microSD Card.

# download latest armbian image archive
wget https://dl.armbian.com/orangepizero/Debian_stretch_next.7z -O image.7z
# extract image from archive
7z e image.7z
# put image on SD card
sudo dd if=Armbian_5.38_Orangepizero_Debian_stretch_next_4.14.14.img of=/dev/mmcblk0 status=progress
# flush block device buffer to ensure that SD card is written
sync

Plug the SD card into the Orange Pi, connect it to the network vie ethernet and power it up. Search for Orange Pi in network.

nmap 10.42.23.0/24 -p 22 | grep open -B 4 | grep -Po '\d+\.\d+\.\d+\.\d+' | tee /tmp/wo
# power the Orange Pi on and wait a minute
sleep 60s
nmap 10.42.23.0/24 -p 22 | grep open -B 4 | grep -Po '\d+\.\d+\.\d+\.\d+' | tee /tmp/w
diff /tmp/w /tmp/wo

SSH onto machine with username root and password 1234 Play through the dialog and create a new user with username user and password user. All other options are irrelevant.

# underlock to prevent overheating
sed -i -e 's/MAX_SPEED/#MAX_SPEED/' /etc/default/cpufrequtils
sed -i -e 's/GOVERNOR/#GOVERNOR/' /etc/default/cpufrequtils
echo -e '#GOVERNOR=powersave\nGOVERNOR=conservative\nMAX_SPEED=816000' | sudo tee -a /etc/default/cpufrequtils
/etc/init.d/cpufrequtils restart
# maximize partition size
echo ", +" | sfdisk -N 1 /dev/mmcblk0 --force
partprobe
resize2fs /dev/mmcblk0p1
sync
# set root password to root
usermod root --password root
# add user to sudo group
usermod user --append --groups sudo
# switch to user and upgrade
su user
sudo apt update
sudo apt upgrade
# set up wireless network
sudo systemctl stop wpa_supplicant
sudo systemctl disable wpa_supplicant
sudo systemctl disable NetworkManager
sudo systemctl disable NetworkManager-wait-online
sudo systemctl disable networking.service
echo ctrl_interface=/run/wpa_supplicant | sudo tee /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
wpa_passphrase $SSID $PSK | sudo tee -a /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
sudo systemctl start wpa_supplicant@wlan0
sudo systemctl enable wpa_supplicant@wlan0
echo -e '[Match]\nName=wlan0\n\n[Network]\nAddress=10.42.23.234/24\nGateway=10.42.23.1\nDNS=10.42.23.53\n' | sudo tee /etc/systemd/network/20-wireless.network
sudo systemctl start systemd-networkd
sudo systemctl enable systemd-networkd
# reboot tut gut (german proverb)
sudo reboot