Nextcloud davfs2 マウント設定(Ubuntu)

https://wiki.archlinux.jp/index.php/Davfs2 /etc/fstab https://nextcloud.example.com/remote.php/dav/files/myuser/ /mnt/nextcloud davfs rw,nofail,user,uid=myuser 0 0 /etc/davfs2/secrets https://nextcloud.example.com/remote.php/dav/files/myuser/ myuser APP_PASSWORD

2021年11月13日 · aoirint

Nextcloud Desktop Client PPA (Ubuntu)

https://launchpad.net/~nextcloud-devs/+archive/ubuntu/client sudo apt install software-properties-common sudo add-apt-repository ppa:nextcloud-devs/client sudo apt update sudo apt install nextcloud-desktop nautilus-nextcloud

2021年11月13日 · aoirint

WordPress

https://hub.docker.com/_/wordpress docker-compose.yml version: "3.9" services: wordpress: image: wordpress:5.8.2-apache restart: always ports: - "${SERVER_PORT}:80" environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress WORDPRESS_DB_NAME: wordpress volumes: - wordpress:/var/www/html db: image: mariadb:10.7 restart: always environment: MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress MYSQL_RANDOM_ROOT_PASSWORD: '1' volumes: - db:/var/lib/mysql volumes: wordpress: db: .env SERVER_PORT=127.0.0.1:8000

2021年11月13日 · aoirint

docker-composeでBuildKitを使う

ビルドコマンド https://stackoverflow.com/questions/58592259/how-do-you-enable-buildkit-with-docker-compose DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose build Dockerfile https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/ # syntax=docker/dockerfile:1.3-labs

2021年11月8日 · aoirint

Ubuntu 20.04, Unattended Upgradesを停止

https://unix.stackexchange.com/questions/470709/how-do-i-stop-disable-unattended-upgrades-from-being-launched-automatically 勝手にnvidia driverの更新が走って、 カーネルに読み込まれているdriverバージョンと、 ディスク上にあるdriverバージョンが一致しなくなって、 デスクトップアプリが起動しなくなったりする。 どうせ結構な頻度でapt upgradeするし、 再起動が保証されないタイミングで更新されて、 不安定になるのはいただけない。 sudo dpkg-reconfigure -plow unattended-upgrades これでTUIが起動するので、<No>を選ぶ。

2021年11月8日 · aoirint

ArchiveBox

https://github.com/ArchiveBox/ArchiveBox https://hub.docker.com/r/archivebox/archivebox curl -O 'https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/master/docker-compose.yml' docker-compose.yml # Usage: # docker-compose run archivebox init --setup # docker-compose up # echo "https://example.com" | docker-compose run archivebox archivebox add # docker-compose run archivebox add --depth=1 https://example.com/some/feed.rss # docker-compose run archivebox config --set PUBLIC_INDEX=True # docker-compose run archivebox help # Documentation: # https://github.com/ArchiveBox/ArchiveBox/wiki/Docker#docker-compose version: "3.9" services: archivebox: image: archivebox/archivebox:sha-f809e3b command: server --quick-init 0.0.0.0:8000 ports: - "${SERVER_PORT:-8000}:8000" environment: ALLOWED_HOSTS: "*" MEDIA_MAX_SIZE: 2g # SEARCH_BACKEND_ENGINE: sonic # uncomment these if you enable sonic below # SEARCH_BACKEND_HOST_NAME: sonic # SEARCH_BACKEND_PASSWORD: SecretPassword volumes: - "${DATA_ROOT:-./data}:/data" # To run the Sonic full-text search backend, first download the config file to sonic.cfg # curl -O https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/master/etc/sonic.cfg # after starting, backfill any existing Snapshots into the index: docker-compose run archivebox update --index-only # sonic: # image: valeriansaliou/sonic:v1.3.0 # environment: # SEARCH_BACKEND_PASSWORD: SecretPassword # volumes: # - ./sonic.cfg:/etc/sonic.cfg:ro # - ./data/sonic:/var/lib/sonic/store ### Optional Addons: tweak these examples as needed for your specific use case # Example: Run scheduled imports in a docker instead of using cron on the # host machine, add tasks and see more info with archivebox schedule --help # scheduler: # image: archivebox/archivebox:latest # command: schedule --foreground --every=day --depth=1 'https://getpocket.com/users/USERNAME/feed/all' # environment: # USE_COLOR: True # SHOW_PROGRESS: False # volumes: # - ./data:/data .env SERVER_PORT=127.0.0.1:8000 DATA_ROOT=./data 初期設定 管理ユーザの作成、プライベートサーバ化、再起動。 ...

2021年11月6日 · aoirint

Minecraft Server

https://github.com/itzg/docker-minecraft-server https://feedback.minecraft.net/hc/en-us/sections/360001186971-Release-Changelogs docker-compose.yml version: "3.9" services: minecraft: image: itzg/minecraft-server ports: - "${SERVER_PORT}:25565" environment: EULA: "TRUE" OVERRIDE_SERVER_PROPERTIES: 'false' # overwrite on every container start if true TZ: ${TZ} TYPE: ${TYPE} # https://github.com/itzg/docker-minecraft-server#server-types VERSION: ${VERSION} # https://feedback.minecraft.net/hc/en-us/sections/360001186971-Release-Changelogs SERVER_NAME: ${SERVER_NAME} MOTD: ${MOTD} ENABLE_WHITELIST: ${ENABLE_WHITELIST} WHITELIST: ${WHITELIST} OPS: ${OPS} SPAWN_PROTECTION: ${SPAWN_PROTECTION} VIEW_DISTANCE: ${VIEW_DISTANCE} SEED: ${SEED} DIFFICULTY: ${DIFFICULTY} MODE: ${MODE} PVP: ${PVP} LEVEL_TYPE: ${LEVEL_TYPE} GENERATOR_SETTINGS: ${GENERATOR_SETTINGS} ONLINE_MODE: ${ONLINE_MODE} tty: true stdin_open: true restart: unless-stopped volumes: - ./data:/data .env SERVER_PORT=0.0.0.0:25565 TZ=Asia/Tokyo TYPE=VANILLA VERSION=1.17.1 SERVER_NAME=MyServer MOTD=A Vanilla Minecraft Server powered by Docker ENABLE_WHITELIST=true WHITELIST=user1,user2 OPS=user1 SPAWN_PROTECTION=0 VIEW_DISTANCE= SEED= DIFFICULTY=normal MODE=survival PVP=true LEVEL_TYPE= GENERATOR_SETTINGS= ONLINE_MODE=true スーパーフラット https://github.com/itzg/docker-minecraft-server#level-type-and-generator-settings https://minecraft.fandom.com/wiki/Superflat ※ 1.17.1でうまく動きませんでした(常にデフォルトのフラットワールドが生成される)。 代わりに、クライアントでワールドを生成してからサーバにコピーする方法が使えます。 ...

2021年11月6日 · aoirint

GitLab CI, GitLab PagesにビルドしたHTMLを公開する

https://docs.gitlab.com/ee/user/project/pages/ リポジトリのGitLab Pages機能を有効化したあと、 GitLab CI上でpagesというジョブにpublicというパスのArtifactがあるとき、 自動的にpages:deployというジョブが実行され、GitLab Pagesへのデプロイが行われる。 リポジトリがプライベートリポジトリのとき、 デプロイされたGitLab Pagesは、GitLabアカウントで認証が行われる。 .gitlab-ci.yml https://docs.gitlab.com/ee/user/project/pages/getting_started/pages_from_scratch.html#specify-a-stage-to-deploy image: ruby:2.7 workflow: rules: - if: '$CI_COMMIT_BRANCH' pages: stage: deploy script: - gem install bundler - bundle install - bundle exec jekyll build -d public artifacts: paths: - public rules: - if: '$CI_COMMIT_BRANCH == "main"'

2021年11月6日 · aoirint

Overleaf Community Edition

https://overleaf.com/ オンラインLaTeXエディタのShareLaTeXとOverleafは、Overleaf v2として2017年に統合され、OverleafはShareLaTeXのエディタを使うようになった。 https://www.sharelatex.com/ https://ja.overleaf.com/blog/sharelatex-joins-overleaf-2017-07-20 Overleaf(ShareLaTeX)は、overleaf.comで提供されているクラウド版と、セルフホスト可能なオープンソース版(Community Edition)が公開されている。 https://github.com/overleaf/overleaf この記事では、Overleaf Community Editionの公式Dockerイメージ(イメージ名はsharelatex/sharelatex)を使って、セルフホストする。 https://hub.docker.com/r/sharelatex/sharelatex/ クラウド版とCommunity Editionの機能の違いは、以下を参照。 https://www.overleaf.com/for/enterprises/features 使用できない機能 Git管理 Git管理やGitHub連携については、Community Editionには実装されていない(クラウド版のみ)。クラウド版のGit管理はクローズドソースなファイル履歴APIを利用して実装されており、これが技術的な課題になっているらしい。 https://github.com/overleaf/overleaf/issues/782 https://github.com/overleaf/overleaf/issues/10 Overleafに管理させないでよいのなら、ファイルは/var/lib/sharelatex/data/compiles/{project_id}-{user_id}に保存されるので、ここを監視して自動コミットするようなプログラムを使ってもいいかもしれない。 # 後者のIDがユーザIDであることの確認 docker-compose exec mongo mongo sharelatex --eval "db.users.find()" テンプレート クラウド版・Pro版限定機能。 https://github.com/overleaf/web/issues/203 https://github.com/overleaf/overleaf/issues/109 https://github.com/overleaf/overleaf/wiki/Server-Pro:-Setting-up-templates docker-compose.yml https://github.com/overleaf/overleaf/blob/a752bbefdd7ef3316aaf0c34302f08e6024aaadb/docker-compose.yml https://github.com/overleaf/overleaf/wiki/Configuring-Overleaf version: '3.9' services: sharelatex: image: sharelatex/sharelatex:3 restart: always depends_on: mongo: condition: service_healthy redis: condition: service_started ports: - "${SERVER_PORT}:80" volumes: - "${DATA_ROOT}:/var/lib/sharelatex" - "${TEXLIVE_ROOT}:/usr/local/texlive" environment: # https://github.com/overleaf/overleaf/wiki/Configuring-Overleaf SHARELATEX_APP_NAME: Overleaf Community Edition SHARELATEX_MONGO_URL: mongodb://mongo/sharelatex SHARELATEX_REDIS_HOST: redis REDIS_HOST: redis ENABLED_LINKED_FILE_TYPES: 'project_file,project_output_file' # Enables Thumbnail generation using ImageMagick ENABLE_CONVERSIONS: 'true' # Disables email confirmation requirement EMAIL_CONFIRMATION_DISABLED: 'true' # temporary fix for LuaLaTex compiles # see https://github.com/overleaf/overleaf/issues/695 TEXMFVAR: /var/lib/sharelatex/tmp/texmf-var # SHARELATEX_SITE_URL: http://sharelatex.mydomain.com # SHARELATEX_NAV_TITLE: Our ShareLaTeX Instance # SHARELATEX_HEADER_IMAGE_URL: http://somewhere.com/mylogo.png # SHARELATEX_ADMIN_EMAIL: [email protected] # SHARELATEX_LEFT_FOOTER: '[{"text": "Powered by <a href=\"https://www.sharelatex.com\">ShareLaTeX</a> 2016"},{"text": "Another page I want to link to can be found <a href=\"here\">here</a>"} ]' # SHARELATEX_RIGHT_FOOTER: '[{"text": "Hello I am on the Right"} ]' # SHARELATEX_EMAIL_FROM_ADDRESS: "[email protected]" # SHARELATEX_EMAIL_AWS_SES_ACCESS_KEY_ID: # SHARELATEX_EMAIL_AWS_SES_SECRET_KEY: # SHARELATEX_EMAIL_SMTP_HOST: smtp.mydomain.com # SHARELATEX_EMAIL_SMTP_PORT: 587 # SHARELATEX_EMAIL_SMTP_SECURE: false # SHARELATEX_EMAIL_SMTP_USER: # SHARELATEX_EMAIL_SMTP_PASS: # SHARELATEX_EMAIL_SMTP_TLS_REJECT_UNAUTH: true # SHARELATEX_EMAIL_SMTP_IGNORE_TLS: false # SHARELATEX_EMAIL_SMTP_NAME: '127.0.0.1' # SHARELATEX_EMAIL_SMTP_LOGGER: true # SHARELATEX_CUSTOM_EMAIL_FOOTER: "This system is run by department x" mongo: image: mongo:4.0 restart: always volumes: - "${MONGO_ROOT}:/data/db" healthcheck: test: echo 'db.stats().ok' | mongo localhost:27017/test --quiet interval: 10s timeout: 10s retries: 5 redis: image: redis:5 restart: always volumes: - "${REDIS_ROOT}:/data" .env SERVER_PORT=127.0.0.1:8000 DATA_ROOT=./data/sharelatex TEXLIVE_ROOT=./data/texlive MONGO_ROOT=./data/mongo REDIS_ROOT=./data/redis 設定 https://github.com/overleaf/overleaf/wiki/Quick-Start-Guide TeXLiveのフルインストール TeXLiveのフルバージョンは巨大なため、Dockerイメージには最小構成のみが含まれている。 フルバージョンを使うには、インストールコマンドを実行する必要がある。 ...

2021年11月5日 · aoirint

cron

Linux上でプログラムの実行をスケジュールするためのプログラム。 独自の書式をもつcrontabファイルでスケジュールを設定する。 想定環境 Ubuntu 20.04 /etc/crontab SHELL=/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin MAILTO= # Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * user-name command to be executed 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) crontabの時刻形式は独特で、複雑な設定を新しく書き起こすのは面倒くさい。 ...

2021年11月5日 · aoirint