User:E.zn/hackpact: Difference between revisions
(→-) |
(→-) |
||
Line 148: | Line 148: | ||
:::-- [https://serverfault.com/questions/538803/nginx-reverse-ssl-proxy-with-multiple-subdomains Reverse proxy w/multiple subdomains] | :::-- [https://serverfault.com/questions/538803/nginx-reverse-ssl-proxy-with-multiple-subdomains Reverse proxy w/multiple subdomains] | ||
:::-- [https://webmasters.stackexchange.com/questions/60133/difference-between-cname-and-subdomain DNS records : Subdomain // A/CNAME ] | :::-- [https://webmasters.stackexchange.com/questions/60133/difference-between-cname-and-subdomain DNS records : Subdomain // A/CNAME ] | ||
:::-- [https://github.com/nodesource/distributions | :::-- [https://github.com/nodesource/distributions Nodejs install] | ||
:::-- [https://www.howtoforge.com/tutorial/ubuntu-etherpad-editor-server-installation/ | :::-- [https://www.howtoforge.com/tutorial/ubuntu-etherpad-editor-server-installation/ Nodejs / MySQL / Etherpad] | ||
:::-- [https://github.com/ether/etherpad-lite Git : Etherped-lite] | :::-- [https://github.com/ether/etherpad-lite Git : Etherped-lite] | ||
:::-- [https://networksofonesown.constantvzw.org/etherbox/manual.html#build-your-own-etherbox Networks Of Ones Own - Etherpad install] | :::-- [https://networksofonesown.constantvzw.org/etherbox/manual.html#build-your-own-etherbox Networks Of Ones Own - Etherpad install] |
Revision as of 01:54, 12 November 2020
-
- - 1 -------------------------------------------------------------------------------------------
- - Running a web server on RPi at my place and hosting leverburns.blue
- - Using Terminado to access the terminal on the server via browser [many thanks to Michael]
lynx http://www.webleedlikeg.com/
-
- - 2 -------------------------------------------------------------------------------------------
- Send lib.txt to 192.168.1.xxx over port 45788 using netcat
nc 192.168.1.xxx 45788 < lib.txt
- Receive lib.txt over port 45788
nc -l 45788 > lib.txt
- Send text over url
echo '///////////////////' | nc leverburns.blue 33872
- Receive the message on a web server over 33872
nc -l 33872
Fixing bricked SD card -- microSD card [mmcblk0] had 2 partitions, both showing less total capacity [only 2 gb out of 16] >> lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 223,6G 0 disk ├─sda1 8:1 0 206,7G 0 part / └─sda2 8:2 0 16,9G 0 part [SWAP] mmcblk0 179:0 0 14,9G 0 disk <<<<<<< ├─mmcblk0p1 179:1 0 100M 0 part /media/ezn/x <<<<<<< └─mmcblk0p2 179:2 0 1,9G 0 part /media/ezn/x1 <<<<<<< -- Delete partitions >> sudo fdisk /dev/mmcblk0 >> d >> 1 >> d >> q -- Unmount both -- Format >> sudo mkfs.ext4 /dev/mmcblk0
-
- - 3 -------------------------------------------------------------------------------------------
- - Hosting an Etherpad instance on my RPi at eth.leverburns.blue
sudo -i curl -sL https://deb.nodesource.com/setup_15.x | bash - apt-get install -y nodejs apt-get install -y build-essential git clone --branch master https://github.com/ether/etherpad-lite.git && cd etherpad-lite && bin/run.sh errors ---------------------------------------------------------------- npm ERR! code FETCH_ERROR npm ERR! errno FETCH_ERROR npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/libnpx (over 300000ms) npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-11-11T00_21_16_947Z-debug.log ---------------------------------------------------------------- apt install mysql-server mysql-client apt-get install npm git errors ---------------------------------------------------------------- [...] Depends: node-which (>= 1.3~) but it is not going to be installed Depends: node-wrappy (>= 1.0.2~) but it is not going to be installed Depends: node-write-file-atomic (>= 2.3~) but it is not going to be installed E: Unable to correct problems, you have held broken packages. ---------------------------------------------------------------- apt update apt install aptitude cd /opt sudo git clone https://github.com/ether/etherpad-lite.git mv etherpad-lite etherpad sudo adduser --system --no-create-home --home=/opt/etherpad --group etherpad sudo chown -R etherpad:etherpad etherpad cd etherpad sudo --user etherpad cp settings.json.template settings.json sudo --user etherpad nano settings.json apt-get install mysql-server errors ---------------------------------------------------------------- This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: mariadb-server-10.0 E: Package 'mysql-server' has no installation candidate ---------------------------------------------------------------- sudo apt install mariadb-server-10.3 php-mysql mysql »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» create database etherpad; grant all on etherpad.* to 'etherpaduser'@'localhost' identified by 'ethpss'; «««««««««««««««««««««««««««««««««««««««««««««« mysql -u etherpaduser -p etherpad exit sudo nano /etc/systemd/system/etherpad.service »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» [Service] Type=simple User=etherpad Group=etherpad WorkingDirectory=/opt/etherpad ExecStart=/usr/bin/nodejs /opt/etherpad/node_modules/ep_etherpad-lite/node/server.js Restart=always [Install] WantedBy=multi-user.target «««««««««««««««««««««««««««««««««««««««««««««« sudo systemctl start etherpad sudo systemctl status etherpad
- - nginx site configuration
server { listen 80; server_name eth.leverburns.blue; location / { proxy_set_header X-Real-IP $remote_addr; proxy_pass http://localhost:9001/; } }