Raspberry Pi: Jako hračka
Na první malině běží už přes rok OpenELEC a je trvale připojena k TV. Tak jsem si na pokusy musel pořídit druhou. Co si nepamatuju, to si musím napsat. Takže takové poznámky ať to nemusím pořád googllit.
# https://web.archive.org/web/20150504234545/https://extremeshok.com/5841/ultimate-raspberry-pi-preparation-raspian/ # spusteni konfiguracniho pruvodce pres ssh, kdyz nemam pripojen monitor, klavesnici, mys sudo raspi-config # aktualizace kernelu apd. sudo rpi-update # aktualizace debianu # https://web.archive.org/web/20140525003331/http://algebraicthunk.net:80/~dburrows/projects/aptitude/doc/cs/index.html # https://www.linuxexpres.cz/praxe/jak-na-aptitude sudo aptitude update sudo aptitude upgrade sudo aptitude autoremove sudo aptitude clean # rucni spusteni desktopu startx # su, sudo sudo su # prepnuti na roota sudo !! # pokud se predchozi prikaz nepustil protoze nemel root prava, toto ho pusti pres sudo # instalace rdp sudo aptitude install xrdp sudo service xrdp stop sudo service xrdp start # bohuzel xrdp pouziva svuj soubor keymap, takze vsechny pokusy o nastaveni klavesnice jsou marne a musi se jit do /etc/xrdp # dost informaci je zde: https://forums.raspberrypi.com/viewtopic.php?t=48568&p=378954 # cesky km-0405.ini: https://web.archive.org/web/20170802020101/http://xrdp-devel.766250.n3.nabble.com:80/Xrdp-devel-Keymap-file-for-Czech-locale-td3799815.html rozbalil jsem,a nakopiroval jako km-0409.ini do /etc/xrdp - FUNGUJE! # zmena klavesnice sudo nano /etc/default/keyboard # zmenit gb na us, nebo cz. POZOR nema vliv na rozlozeni pres xrdp viz vyse! # pokud by to nekomu nefungovalo, tak by melo pomoci vytvorit soubor /home/pi/.xsessionrc s obsahem "setxkbmap cz" # odinstalovani zbytecnosti # https://forums.raspberrypi.com/viewtopic.php?f=66&t=57001#p431065 sudo aptitude purge vim-common # s vimem se opravdu nekamaradim, zlaty nano sudo aptitude purge sonic-pi # programovani nejakych hratek se zvukem sudo aptitude purge wolfram-engine # programovani matematickych uloh sudo aptitude purge smartsim # navrh a simulace logickych obvodu sudo aptitude purge omxplayer # videa si pres terminal ani pres rdp prehravat nebudu sudo aptitude purge scratch # programovani pro deti a la KAREL sudo aptitude purge dillo # opravdu divny a osklivy prohlizec sudo aptitude purge penguinspuzzle # hra sudo aptitude purge minecraft-pi # hra sudo aptitude clean sudo aptitude autoremove # naopak chybi zasadni spravce souboru mc sudo aptitude install mc # a zasadni nastaveni v ~/.bashrc pridat alias, diky tomu zustane shell ve slozce ve ktere byl mc pred ukoncenim alias mc=". /usr/lib/mc/mc-wrapper.sh" # rozhodne se budu muset zkusit skamaradit s aptitude https://www.linuxexpres.cz/praxe/jak-na-aptitude # zmena scheduleru deadline->noop pry je to opravdu znat a lepsi a tak # https://web.archive.org/web/20150318125047/https://extremeshok.com/1081/raspberry-pi-raspbian-tuning-optimising-optimizing-for-reduced-memory-usage/ # https://fiasko.io/projects/rpi/writeless.html.en sudo sed -i 's/deadline/noop/g' /boot/cmdline.txt && shutdown -r now # na overeni jaky scheduler je aktualne nastaven zadejme cat /sys/block/mmcblk0/queue/scheduler # cron # https://web.archive.org/web/20210621082030/https://www.raspberrypi.org/documentation/linux/usage/cron.md # https://web.archive.org/web/20160117165616/https://quaintproject.wordpress.com/2013/09/29/how-to-schedule-a-job-on-the-raspberry-pi/ # https://ss64.com/bash/crontab.html # https://www.thegeekstuff.com/2011/07/cron-every-5-minutes/ # bezici ulohy ps -o pid,sess,cmd afx | grep -A20 "cron$" crontab -e # upravy crontab -l # zobrazeni # logy # https://www.root.cz/clanky/logrotate-zkroceni-zlych-logu/ # https://linux.die.net/man/8/logrotate nejakyscript.sh > /var/log/nejakyscript/nejakyscript.log 2>&1 # presmerovani vystupu, musi byt moznost zapisu do slozky /var/log/nejakyscript! /etc/logrotate.d/nejakyscript # konfigurace logrotate logrotate -d nejakyscript # rucni spusteni pripadne -df "f" jako force, melo by rotovat i kdyz nemusi # maily sudo apt-get install mailutils # maily by mely byt v "cat /var/spool/mail/pi" ("sudo cat /var/spool/mail/root") # bash/dash # jako vychozi shell je pouzit dash, takze /bin/sh = /bin/dash # https://wiki.ubuntu.com/DashAsBinSh # ve scriptu je proto treba pripadne pouzit #!/bin/bash misto #!/bin/sh # v cronu pripadne zadat SHELL=/bin/bash