Scripts for modifying Raspberry Pi OS images before writing to SD card.
- QEMU - setup on x86 (faster)
chroot- Setup script. Set:
- hostname
- WiFi
- ssh keys
| // vanilla JS window width and height | |
| var w=window, | |
| d=document, | |
| e=d.documentElement, | |
| g=d.getElementsByTagName('body')[0], | |
| x=w.innerWidth||e.clientWidth||g.clientWidth, | |
| y=w.innerHeight||e.clientHeight||g.clientHeight; |
| var socket = io.connect('http://HOSTNAME:8080'); | |
| socket.on('reload', function (data) { | |
| location.reload(); | |
| }); | |
| /* | |
| socket.on('eval', function(data) { | |
| eval(data.evalString); | |
| }); |
Отладка SmartTV больная тема для большинства разработчиков. Мысли о том, что придется делать все в слепую отталкивают разработчиков, что негативно влияет на отрасль SmartTV и Web в целом. Я рассказажу, что не все так плохо и инструменты существуют. А те, которых нет не сложно запилить самому.
| sdb connect <ip>:<port> # connect to TV | |
| sdb -s <deviceName> capability # get <installationPath> | |
| # build | |
| tizen cli-config "default.profiles.path=<profile_path>" | |
| tizen build-web -out .buildResult -- <source-dir> | |
| tizen package --type wgt --sign profileName -- <source-dir>/.buildResult # extract <package-file> | |
| mv <package-file> . | |
| rm -rf <source-dir>/.buildResult |
| #Systemd - How to read live-tail logs of multiple services with journalctl | |
| sudo journalctl --follow _SYSTEMD_UNIT=docker.service + _SYSTEMD_UNIT=apache2.service |
| How to set up auto filesystem expansion for custom PI images | |
| ============================================================ | |
| Preamble | |
| ======== | |
| When a custom pi image is created, it is a good idea to expand the FS so that all the space on the SD card is used. This is done manaully using the raspi-config tool or raspi-config --expand-rootfs. | |
| The official pi images expand the FS automatically so it would be nice to replicate this process for custom images. | |
| The procedure below shows how to do this. | |
| Procedure |
| /** | |
| * Returns a Promise which resolves with a value in form of a tuple. | |
| * @param promiseFn A Promise to resolve as a tuple. | |
| * @returns Promise A Promise which resolves to a tuple of [error, ...results] | |
| */ | |
| export function tuple (promise) { | |
| return promise | |
| .then((...results) => [null, ...results]) | |
| .catch(error => [error]) | |
| } |
| # oh-my-zsh Theme | |
| # Default robbyrussell theme with node version info. | |
| # Installation: place this file in .oh-my-zsh/custom/themes/robbyrussell.zsh_theme | |
| function node_prompt_version { | |
| if which node &> /dev/null; then | |
| echo "%{$fg_bold[blue]%}node(%{$fg[red]%}$(node -v)%{$fg[blue]%}) %{$reset_color%}" | |
| fi | |
| } |
| const users = [ | |
| { | |
| id: 1, | |
| name: 'Leanne Graham', | |
| username: 'Bret', | |
| email: '[email protected]', | |
| }, | |
| { | |
| id: 2, | |
| name: 'Ervin Howell', |