Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. <nav> * {{fa>server?color=#8B0000}} Linux * [[:rpi_common|■ General Things on Raspbian]] * [[:rpi_autism|Media Ditorium ─ AUTiSM Rainbow]] * [[:rpi_epigen|Private Cellarium ─ EPiGEN Crystal]] * [[:rpi_nimbus|Webius Officium ─ NiMBUS deBlanc]] * [[:debian_common|■ General info on Debian Linux]] * [[:deb_mutism|Opus Imperium ─ MUTiSM Magnum]] * [[:deb_gilead|Actu Periculum ─ GiLEAD Argenta]] * [[:deb_debris|Finca LaDichium ─ DEBRiS Chrome]] * {{fa>windows?color=#0000A0}} Windows * [[:pc_common|■ Common Works on Windows]] * [[:pc_mesonism|Primus Workstation ─ MESONiSM]] * [[:pc_mesonium|Manibus Tablet ─ MESONiUM]] * [[:pc_mesonist|Domumus Workstage ─ MESONiST]] * [[:pc_mesonity|Praevus Station ─ MESONiTY]] * {{fa>android?color=#006400}} Android * [[:cell_common|■ Common Stuffs on Androids]] * [[:cell_epiaux|Júne's Primus ─ EPiAUX 5X]] * [[:cell_epihex|Júne's Extentus ─ EPiHEX 6]] * [[:cell_epimer|Júne's Maximus ─ EPiMER 5P]] * [[:cell_epinex|Júne's Secondus ─ EPiNEX 5]] * [[:cell_epitab|Júne's Laminus - EPiTAB 7]] * [[:cell_epixus|Júne's Tertius ─ EPiXUS 4]] </nav> ====== Media Ditorium ─ AUTiSM Rainbow ====== {{:rpi_autism.jpg?nolink&250|}} Name: {{mdi>cards?28&color=#37000A}} ''**AUTiSM** Rainbow'' (official) | {{mdi>creation?28&color=#37000A}} ''라몽'' (korean) ---- ===== Specification ===== {{mdi>raspberry-pi?32&color=#37000A}} Model: [[https://www.raspberrypi.org/products/raspberry-pi-2-model-b//|Raspberry Pi 2 Model B+]] | [[wp>Raspberry_Pi#Model_B|Raspbierry Pi Model B]] {{mdi>database-plus?32&color=#37000A}} Storages --- {{mdi>harddisk}} [[SECURED:JUNE_HARDWARE#data_storage|Storage in details]] {{fa>lock}} * {{mdi>database?color=#37000A}} ''**500G**'' --- ''~/storage'' partition {{fa>usb?14&color=#005eb8}} * {{mdi>database?color=#37000A}} ''**500G**'' --- ''~/repository'' partition {{fa>usb?14&color=#005eb8}} === Live status of storages === <code ini> Mounted on Type Size Used Avail Use% ~/repository ext4 459G 289G 147G 67% ~/storage ext4 459G 179G 257G 42% </code> {{mdi>server-network?32&color=#37000A}} --- {{mdi>wifi-strength-3-lock}} [[SECURED:HOME_NETWORK#dhcp_assigned_ip|Júne's home network]] {{fa>lock}} * {{mdi>lan?color=#37000A}} Wired (''AUTiSM-enx001'') * {{mdi>wifi?color=#37000A}} Wireless {{fa>usb?14&color=#030303}} (''AUTiSM-wlx001'') * {{mdi>lan?color=#37000A}} Wired {{fa>usb?14&color=#030303}} (''AUTiSM-enx003'') {{mdi>video-wireless-outline?32&color=#37000A}} Video streaming and archives ---- ==== +Work logs ==== * Fixed ''conveyance daemon'' due to wrong lib sharing <sub> --- Updated on //2023/05/06 21:11// </sub> * Disable ''transmission web'' port, ''9090'' & ''9091'' and build ''proxy_pass'' pages <sub> --- Updated on //2020/07/11 03:22// </sub> * Plugin Wired Giga LAN {{fa>usb}} <sub> --- Updated on //2020/02/22 03:34// </sub> * physically exchange hard disk enclosures <sub> --- Updated on //2019/06/23 22:57// </sub> * ''replace'' HDD enclosure for ''~/repository'' & ''~/storage'' <sub> --- Updated on //2018/09/04 20:33//</sub> * ''fresh installation'' of Raspbian OS <sub> --- Updated on //2018/09/01 17:32//</sub> * change ''microSD memory'' for Raspbian OS <sub> --- Updated on //2018/05/09 12:59//</sub> * ''static IP'' using ''dhcpcd.conf'' with fallback option <sub> --- Updated on //2018/02/25 09:28//</sub> === +Que to do === * Register user-create shell script for autocomplete enabled --- bash-completion * List up the aliases and create user-defined command * FlexGet configuration before fresh installation ---- ===== Operation manuals ===== ==== Install Samba service ==== Update systems with latest packages <code bash> sudo apt update && sudo apt dist-upgrade -y </code> Install **Samba** service and related components <code bash> sudo apt install samba samba-common-bin </code> === Add Samba user === <code bash> sudo smbpasswd -a userid </code> Set user's password correctly. === Set configuration === Edit Samba configuration file --- ''/etc/samba/smb.conf'' <button type="danger" size="sm" icon="mdi mdi-settings-box">[[https://wiki.meson.one/doku.php?id=secured:server_config#machine_specific|Live Configuration]]</button> <code ini> [userid] comment = Any description showing your sharing path = /home/userid valid user = userid #writable = yes read only = no browseable = yes </code> If you need to specify **Workgroup** name with Windows machines, <code ini> workgroup = MYWORKGROUP </code> === Restart Samba service === <code bash> sudo /etc/init.d/smbd restart </code> or <code bash> sudo systemctl restart smbd.service </code> ---- ==== Setup Transmission ==== Build up Transmission (daemon + web remote) and configuration. Reference: Fundamental [[http://meson.in/2gTAppK|information on BitTorrent]] in {{flag>kr}} Korean (한국어). User should understand basic operation on BitTorrent. If not, your server will have tremendous traffics, which reduce your network resource. === Install transmission === <code bash> sudo apt install transmission-daemon </code> === Setup working directories === Decide a few directories to store torrent files for downloads. Do not use directory located on SD memory {{mdi>micro-sd}} but use directories mount on USB {{fa>usb?color=#000000}} attached storage. Assume external USB {{fa>usb?color=#000000}} HDD is ''/dev/sda'' and mount on ''/home/userid/BitTorrent'' <code bash> sudo mount /dev/sda /home/userid/BitTorrent </code> Create three directories (arbitrary names) for transmission to work efficiently. <code bash> mkdir /home/userid/BitTorrent/Downloaded mkdir /home/userid/BitTorrent/Downloading mkdir /home/userid/BitTorrent/WillDownload </code> ''Downloaded'' is for the finished files, ''Downloading'' is for the downloading files (still downloading or seeding) and ''WillDownload'' is used for watching directory, where you put ''.torrent'' file will start downloading automatically. Basically, transmission daemon is operated by user named ''debian-transmission'' and also group ''debian-transmission''. Therefore, next step you have to set folder and file permission. <code bash> sudo chgrp debian-transmission /home/userid/BitTorrent/Downloaded sudo chgrp debian-transmission /home/userid/BitTorrent/Downloading sudo chgrp debian-transmission /home/userid/BitTorrent/WillDownload sudo chmod 770 /home/userid/BitTorrent/Downloaded sudo chmod 770 /home/userid/BitTorrent/Downloading sudo chmod 770 /home/userid/BitTorrent/WillDownload </code> BitTorrent directories allow full permission to owner and ''debian-transmission'' group and ''userid'' is also its member. So ''debian-transmission'' and ''userid'' users have full permission to create, edit and delete. === Set configuration === Edit ''/etc/transmission-daemon/settings.json'' <button type="danger" size="sm" icon="mdi mdi-settings-box">[[https://wiki.meson.one/doku.php?id=secured:server_config|Live Configuration]]</button> <code yaml> "download-dir": "/home/userid/BitTorrent/Downloaded", "incomplete-dir": "/home/userid/BitTorrent/Downloading", "incomplete-dir-enabled": true, "rpc-authentication-required": true, "rpc-bind-address": "0.0.0.0", "rpc-enabled": true, "rpc-password": "TYPE_YOUR_OWN_PASSWORD_HERE", "rpc-port": 9090, "rpc-url": "/transmission/", "rpc-username": "userid", "rpc-whitelist": "127.0.0.1", "rpc-whitelist-enabled": false, "umask": 6, </code> ''umask'' is sensitive matter to security. If you want to copy/move through samba connection, Set ''umask'' as ''1'' with no further consideration. Append two lines before ''}'' <code yaml> "watch-dir": "/home/userid/BitTorrent/WillDownload", "watch-dir-enabled": true </code> Last string line does not have **'',''**. Save ''settings.json'' === Restart Transmission === <code bash> sudo systemctl restart transmission-daemon.service </code> If there is no error, transmission daemon works correctly and you can access transmission web remote in your browser. Assume machine's IP address (internal) is 192.168.50.10. Transmission Web Interface can be accessed with ''http://192.168.50.10:9090''. Port number can be changed ''"rpc-port": 9090'' and it could be better when it comes to security. Set download/upload speed limits in options. === Edit service webpages === {{mdi>web?color=#52325d}} Page for Transmission Web is ''/usr/share/transmission/web/index.html'' ---- ==== Dual Transmissions in single machine ==== If need more than one Transmission Web service, duplicate daemon in a single machine. Each service can be serviced with different port number. === Stop the Transmission === <code bash> sudo systemctl stop transmission-daemon.service </code> Update with the latest ones <code bash> sudo apt update && sudo apt dist-upgrade -y </code> === Duplicate Transmission daemon === Copy daemon resources and scripts. Call the second daemon as ''**conveyance-daemon**'' <code bash> sudo cp /usr/bin/transmission-daemon /usr/bin/conveyance-daemon sudo cp /etc/init.d/transmission-daemon /etc/init.d/conveyance-daemon sudo cp -a /var/lib/transmission-daemon /var/lib/conveyance-daemon sudo cp -a /etc/transmission-daemon /etc/conveyance-daemon sudo cp /etc/default/transmission-daemon /etc/default/conveyance-daemon </code> Create symbolic link for second daemon. <code bash> sudo ln -sf /etc/conveyance-daemon/settings.json /var/lib/conveyance-daemon/info/settings.json </code> === Edit the second daemon === Edit ''/etc/init.d/conveyance-daemon'' and change ''NAME'' with ''conveyance-daemon'' <code ini> NAME=conveyance-daemon </code> Edit ''/etc/conveyance-daemon/settings.json''. Compare and check settings with default values. <button type="danger" size="sm" icon="mdi mdi-settings-box">[[https://wiki.meson.one/doku.php?id=secured:server_config|Live Configuration]]</button> <code ini> "download-dir": "new download path of conveyance-daemon" "peer-port": 51414, "rpc-username": "NEW_USER", "rpc-password": "TYPE_YOUR_NEW_PASSWORD_HERE", "rpc-port": 9092, "rpc-whitelist-enabled": false, </code> Edit ''/etc/default/conveyance-daemon'' <code ini> CONFIG_DIR="/var/lib/conveyance-daemon/info" </code> Update init.d to let ''conveyance-daemon'' start at <code bash> sudo update-rc.d conveyance-daemon defaults </code> === Restart services === Start the original and the duplicated daemon to check any errors or conflicts <code bash> sudo systemctl start transmission-daemon.service sudo systemctl start conveyance-daemon.service </code> If no error, check with Transmission Web Interface. Original one is ''http://server.ip:9090'' and Second one is ''http://server.ip:9092'' according to your port settings. ---- ==== Notify completion of downloading ==== When downloading finishes in Transmission, get **notification** via message services. === Getting API from PushBullet === Get API key from PushBullet service --- [[https://www.pushbullet.com/#settings/account|Create Access Token]] * API key is like ''o.8jh96v9p49vW73X3U4HByxo87MLVw4kM'' === Getting API from Telegram === To get API from {{mdi>telegram?color=#0088cc}} **Telegram**, need to create Telegram Bot by which notification is sending. Create Telegram Bot --- [[https://telegram.me/botfather|Create your own Bot]] with ''/newbot'' command. Finish with specific information in ''settings'' such as **Bot Name**, **Description**, **Profile image** and so on. After finishing Bot, find the API key from **BotFather**. * API key is like ''977114901:279gLSo-d7XZokF4QqM69ZfF3xBKtnYQqMk'' To create script, it requires **''chat_id''** from API key. To figure out ''chat_id'', Goto ''https://api.telegram.org/bot**977114901:279gLSo-d7XZokF4QqM69ZfF3xBKtnYQqMk**/getUpdates'' If result returns nothing like ''chat_id'', go to Telegram and **give some chats with your Bot**. Of course, your Bot never answers you. Then visit again and it shows something like ''{"id":**29329664**,"first_name": ....},'' and ''**id**'' is your ''chat_id'' is ''29329664'' === Modify Transmission service === Stop Transmission <code bash> sudo systemctl stop transmission-daemon.service </code> Append the following lines in ''/etc/transmission-daemon/settings.json'' <code ini> "script-torrent-done-enabled": true, "script-torrent-done-filename": "/opt/script/download-done.sh", </code> === Make executive script === <code bash> sudo mkdir /opt/script sudo touch /opt/script/download-done.sh sudo chown debian-transmission:debian-transmission /opt/script/download-done.sh sudo chmod +x /opt/script/download-done.sh sudo vi /opt/script/download-done.sh </code> Put script with the following option: <button type="danger" size="sm" icon="mdi mdi-script-text-outline">[[https://wiki.meson.one/doku.php?id=secured:server_script|Live Scripts]]</button> == Script for Pushbullet == <code bash> #!/bin/bash curl -u o.8jh96v9p49vW73X3U4HByxo87MLVw4kM: \ -X POST https://api.pushbullet.com/v2/pushes \ --header 'Content-Type: application/json' \ --data-binary "{ \"type\": \"note\", \"title\": \"Transmission in EPiGEN\", \"body\": \"$TR_TORRENT_NAME file is ready @ $TR_TIME_LOCALTIME.\" }" </code> == Script for Telegram == <code bash> #!/bin/bash TEXT="$TR_TORRENT_NAME is finished" curl -d "chat_id=29329664&text=$TEXT" \ https://api.telegram.org/bot977114901:279gLSo-d7XZokF4QqM69ZfF3xBKtnYQqMk/sendMessage </code> == Script with Webhook == Webhook is HTTP push API for general purpose. Message services such as Slack {{mdi>slack?color=#e9a820}} provide <code bash> #!/bin/bash curl -X POST --data-urlencode "payload={\"channel\": \"#helpdesk\", \"username\": \"Sender Name\", \"text\": \"The File(s) in <http://bit.torrent/|Transmission Web> is(are) finished.\", \"icon_emoji\": \":ghost:\"}" https://hooks.slack.com/services/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 </code> WebHook address and setup instruction is guided by Slack (tm). === Restart Transmission === <code bash> sudo systemctl start transmission-daemon.service </code> ---- ===== Solved problems ===== ==== hash sum mismatch during apt-get update ==== <text type="danger">{{fa>bug}} **Symptom**</text>: Error ''hash sum mismatch'' shows during updating. This problem has something to do with ''slow connection'' or ''connection failure'' due to bad network situation. <text type="info">{{fa>lightbulb-o}} **Solution**</text>: <code bash> sudo vi /etc/apt/source.lists </code> Remove downloaded repository information from the ''/var/lib/apt/lists/'' directory. <code bash> sudo rm -rf /var/lib/apt/lists/* </code> Change mirror address seemingly to be fast. [[https://www.raspbian.org/RaspbianMirrors|Raspbian Mirrors]] {{mdi>source-repository-multiple?color=#000000}} This is a kind of temporary problem due to network condition. ---- rpi_autism Last modified: 2023/06/09 09:48by Júne Park