环境

  • Ubuntu 16.04

参考

步骤

  1. 更新源
    sudo apt update
    sudo apt upgrade
  2. 安装依赖
    sudo apt install ca-certificates curl openssh-server postfix

    如果只在本地网络使用,postfix设置时选择 Local only

  3. 下载官方安装脚本
    curl -LO https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh
  4. 安装gitlab-ce
    sudo apt install gitlab-ce
  5. 修改gitlab配置文件(位于 /etc/gitlab/gitlab.rb),配置URL
    找到 external_url ‘https://yourdomain’ 一行,修改为自己的域名或IP地址。
    没有SSL证书或者使用IP时将https改为http

    external_url 'http://192.168.xxx.xxx'
  6. 重新配置gitlab
    sudo gitlab-ctl reconfigure

    耗时较长

  7. 配置成功后输入IP/域名,设置管理员账户密码,之后即可访问Gitlabhost

I want to setup a local network printer for me and my roomates, so they can print papers remotely without sending file to me then I have to do the operation.

At the very beginning, I installed Windows Server 2016 on a miniPC, it works perfectly fine but the CPU (Atom D425 1.8GHz) is really a pain in the ass when I try to do other jobs(Remote Display, IIS Hosting, etc). So I change the OS to Ubuntu and the performace becomes better.

Sharing a printer on Ubuntu is not that hard(it’s more complicated than its on Windows which has a GUI configuration and you just need to click some buttons), we just need to configure the printer in the system then install CUPS.

Environment

  • Ubuntu 16.04

Steps

  1. Plug the printer in and set it up.
    • In Ubuntu desktop, go to Settings -> Printers, then click the Add button. The left panel shows all the ports that already connected to the machine, choose the printer then choose the right driver, the system will take care of the rest configurations.
    • You can print a test page to check whether the printer is working when it’s done.
  2. Install CUPS
    1. Open Terminal(you can open it by pressing CTRL+ALT+T on desktop).
    2. Execute commands:
      sudo apt update
      sudo apt install cups

      After the installation, CUPS Web Page will listening on port 631, visit http://127.0.0.1:631 to get access to CUPS.

    3. 19-04-13 Update:
      I checked the settings again and realized that you don’t have to setup a reverse proxy, CUPS(version 2.1.3) will automatically listen on the external IP. But you still have to disable https if you don’t have a SSL certification or using a IP address.
      Open CUPS’ config file, located at /etc/cpus/cpusd.conf and add this line(the full config file documentation is here):

      DefaultEncryption Never

      Then restart CPUS service:

      sudo service cups restart
      # or use this
      sudo systemctl restart cups.service

      Visit http://[IP address or domain]:631 to see the web interface.
      Old stuff:

      If you want to visit CUPS web page on your other devices, you can install nginx to setup a simple reverse proxy.

      sudo apt install nginx

      Open a file named [your name].conf under /etc/nginx/conf.d/, then paste:

      server {
          listen 632;
          server_name cups;
          location / {
               proxy_pass http://127.0.0.1:631;
          }
      }

      Save changes, quit, execute commands:

      sudo nginx -t # test config file
      sudo nginx -s reload

      Then visit http://[your machine’s ip]:632 to get access to CUPS.

  3. Once you open the CUPS webpage, go to Administration, check the Share printers connected to this system box, then click Change Settings.
    • Type in your system account if it asks authentication.

If you successfully configured the printer in the system, CUPS will automatically detect the printer and share it in your local network. You just need to add the network printer on the other devices.

 

instantbox——在很短的时间内建立一个全新的Linux操作系统(使用ttyd Webshell访问控制)

环境

  • VPS一枚
  • Docker(instantbox并没有给出其他安装方式)

参考&项目地址

步骤

  1. 安装Docker,控制台输入指令
    wget -qO- https://get.docker.com/ | sh

    详见 多平台安装Docker

  2. 控制台输入指令
    mkdir instantbox && cd $_
    bash <(curl -sSL https://raw.githubusercontent.com/instantbox/instantbox/master/init.sh)

    之后按提示输入IP地址和网页监听端口,一键搭建

Continue reading “部署instantbox”