Repository: TheDen/0xfee1dead.top Branch: master Commit: 4951db6466f7 Files: 14 Total size: 15.3 KB Directory structure: gitextract_4zmqjexi/ ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── config/ │ ├── certbot.sh │ └── nginx.default ├── htopgen.sh ├── index.html ├── package.json ├── process.yml ├── public/ │ ├── reload.js │ ├── ribbon.css │ └── stylesheet.css └── server.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Swap [._]*.s[a-v][a-z] [._]*.sw[a-p] [._]s[a-v][a-z] [._]sw[a-p] # Session Session.vim # Temporary .netrwhist *~ # Auto-generated tag files tags # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2017 Denis Khoshaba Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Makefile ================================================ # build app .PHONY: install install: sudo npm install -g pm2 npm install .PHONY: stop stop: pm2 delete live-htop || true kill $$(pgrep -f htopgen.sh) || true .PHONY: start start: ./htopgen.sh & pm2 start process.yml .PHONY: renew-cert-dry-run renew-cert-dry-run: sudo certbot renew --dry-run .PHONY: renew-cert renew-cert: sudo certbot renew ================================================ FILE: README.md ================================================ # 0xfee1dead.top Live `htop` output of a server ## Build ### Prerequisites * htop * Node * [aha](https://github.com/theZiz/aha) * coreutils Running `make install` installs the npm modules and the `pm2` cli tool ## Run ```make run``` will run the node `pm2` and `htopgen.sh` to generate the `htop.html` files ## Screenshot  ## Thanks * [krismsd](https://github.com/krismsd) for helping me out with `sockets.io` * [tobiasahlin](https://github.com/tobiasahlin) for the css spinner ================================================ FILE: config/certbot.sh ================================================ #!/bin/sh if ! grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep -q certbot; then sudo add-apt-repository ppa:certbot/certbot sudo apt-get update sudo apt-get install python-certbot-nginx -y fi echo "y" | sudo ufw enable sudo ufw allow 'Nginx Full' sudo ufw delete allow 'Nginx HTTP' sudo ufw allow 'OpenSSH' sudo certbot --nginx -d 0xfee1dead.top -d www.0xfee1dead.top ================================================ FILE: config/nginx.default ================================================ server { root /var/www/html; index index.html index.htm index.nginx-debian.html; server_name 0xfee1dead.top www.0xfee1dead.top _; location / { proxy_pass http://localhost:8080; root /home/ubuntu/0xfee1dead.top/public/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } location ~* socket.io/* { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://localhost:8080; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location ^~ /.well-known/acme-challenge/ { alias /var/www/acme-challenge/; } } ================================================ FILE: htopgen.sh ================================================ #!/bin/bash touch public/htop.html touch public/htop.html.aux while true; do echo q | htop | aha --stylesheet --black --line-fix | sed 's/<\/style>/body {overflow-x: hidden; font-size: 2vh;}<\/style>/g' > ./public/htop.html.aux && mv -f ./public/htop.html.aux ./public/htop.html sleep 2 done ================================================ FILE: index.html ================================================