闲置服务器废物利用_离线下载_私人影院_个人博客_私人云笔记_文件服务器

背景

  • 家里有台旧windows笔记本,PentiumB940 2.00GHz的cpu 4G内存,512G硬盘
  • 放在家里吃灰很久,最近几个月折腾折腾,装了linux操作系统,换了一个2T的硬盘
  • 这里记录下折腾的过程,有需要的可以参考

开通公网IP

  • 打电话给运营商一般都可以免费开通 但这个公网IP(ipv4)不是一成不变的,一般都是会变化的
  • 不过这里可以监控公网ip变化 直接修改dns解析就好 参考下方连接
  • 个人宽带网关上网方式用桥接,然后路由器选择拨号,个人服务器直接网线连接路由器,路由器开启DMZ功能,将流量打向家里的旧电脑

搭建个人git服务器

hugo搭建个人博客

离线下载

安装aria2

IOS自定义通知

静态文件服务器

  • 安装nodejs
  • 安装httpserver npm install http-server -g
  • cd /sharefiles;nohup http-server -a 0.0.0.0 -p 6666 >~/log/httpServer.log 2>&1 &
  • 结合动态域名解析 可以随时随地访问家里的文件服务器 包括一些电影/歌曲/纪录片等等

私人云笔记

  • 这里是无意间逛github看到的一个开源云笔记软件,目前个人一直还在使用 有兴趣的可以试试
  • 相关介绍网站
  • docker安装部署
    • 拉取镜像docker pull zadam/trilium:0.61-latest

    • 选定数据目录 修改配置文件config.ini

      • docker内部端口可以修改 也可以用默认 可以复制直接使用

        [General]

        Instance name can be used to distinguish between different instances using backend api.getInstanceName()

        instanceName=

        set to true to allow using Trilium without authentication (makes sense for server build only, desktop build doesn't need password)

        noAuthentication=false

        set to true to disable backups (e.g. because of limited space on server)

        noBackup=false

        Disable automatically generating desktop icon

        noDesktopIcon=true

        [Network]

        host setting is relevant only for web deployments - set the host on which the server will listen

        host=0.0.0.0

        port setting is relevant only for web deployments, desktop builds run on a fixed port (changeable with TRILIUM_PORT environment variable)

        port=8080

        true for TLS/SSL/HTTPS (secure), false for HTTP (unsecure).

        https=false

        path to certificate (run "bash bin/generate-cert.sh" to generate self-signed certificate). Relevant only if https=true

        certPath=
        keyPath=

        setting to give trust to reverse proxies, a comma-separated list of trusted rev. proxy IPs can be specified (CIDR notation is permitted),

        alternatively 'true' will make use of the leftmost IP in X-Forwarded-For, ultimately an integer can be used to tell about the number of hops between

        Trilium (which is hop 0) and the first trusted rev. proxy.

        once set, expressjs will use the X-Forwarded-For header set by the rev. proxy to determinate the real IPs of clients.

        expressjs shortcuts are supported: loopback(127.0.0.1/8, ::1/128), linklocal(169.254.0.0/16, fe80::/10), uniquelocal(10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7)

        trustedReverseProxy=false

    • docker启动

      • 将本机的8081端口映射到docker的8080端口 将本地/home/xxx/trilium_data挂载到docker内部的/home/node/trilium-data目录
      复制代码
        sudo docker run -d -p 0.0.0.0:8081:8080 -v /home/xxx/trilium_data:/home/node/trilium-data zadam/trilium:0.61-latest
      • docker logs 实例ID 查看没有报错 docker ps实例一直存在就是没有问题
    • 浏览器打开http://xxip:8081 初始化登录密码后就可以享受私人云笔记了

  • 软件版本升级
    • docker stop 实例id 停掉原有实例
    • docker pull zadam/trilium:0.62-latest 拉取新版本
    • sudo docker run -d -p 0.0.0.0:8081:8080 -v /home/xx/trilium_data:/home/node/trilium-data zadam/trilium:0.62-latest
      • 镜像地址换掉 磁盘目录映射 端口映射都不变,数据会自动迁移

开启smb文件共享,在小米电视看电影

安装samba

复制代码
sudo apt-get install samba

修改配置

  • sudo vi /etc/samba/smb.conf 在最后添加一下内容

    复制代码
    [share]
       comment = ubuntu_share
       path = /共享目录绝对路径
       public = yes
       writable = yes
       available = yes
       browseable = yes
  • 小米电视用的协议比较老 还需要做以下配置修改

    • 在global下面一行 加入 server min protocol = CORE

添加用户

复制代码
sudo smbpasswd -a ftp

重启samba服务

复制代码
sudo service smbd restart

其它局域网电脑查看方法

复制代码
smb://ip

小米电视访问samba共享文件 在电视上看电影

  • 应用里面有个**"高清播放器"** 打开,没有就搜索安装
  • 菜单左侧 "设备"
  • 添加设备 输入局域网ip 然后可能要输入账号或者密码
  • 接下来就可以愉快的看电影了
  • 目前离线下载了一些记录片 mv,英文动画片等等,小孩子看的比较多
  • 老婆大人偶尔也想看个高清电影,晚上离线,第二天电视看高清的体验确实不错.

本文由mdnice多平台发布

相关推荐
16_one6 分钟前
autoDL安装Open-WebUi+Rag本地知识库问答+Function Calling
人工智能·后端·算法
StockPP7 分钟前
印度尼西亚股票多时间框架K线数据可视化页面
前端·javascript·后端
3***g20514 分钟前
如何使用Spring Boot框架整合Redis:超详细案例教程
spring boot·redis·后端
狂奔小菜鸡29 分钟前
Day18 | 深入理解Object类
java·后端·java ee
未秃头的程序猿31 分钟前
🔒 从单机到分布式:三大锁机制深度剖析与实战指南
java·后端
得物技术41 分钟前
# 一、项目概览 Dragonboat 是纯 Go 实现的(multi-group)Raft 库。 为应用屏蔽 Raft 复杂性,提供易于使用的 NodeH
后端
4***14901 小时前
Rust系统工具开发实践指南
开发语言·后端·rust
s***35301 小时前
Spring Boot3.x集成Flowable7.x(一)Spring Boot集成与设计、部署、发起、完成简单流程
java·spring boot·后端
大头an1 小时前
Spring Boot CLI 从入门到企业级实战(上下篇)
后端
s***4531 小时前
SpringBoot返回文件让前端下载的几种方式
前端·spring boot·后端