顯示具有 image 標籤的文章。 顯示所有文章
顯示具有 image 標籤的文章。 顯示所有文章

how to use the piclayer plugin in josm for map making

開放街圖常用 JOSM 軟體當作其 Java 版圖資編輯器。用 JOSM 標示設施時,有時須要參考相關圖片,例如景點空拍圖或官方設施圖等,疊圖以確定其位置。這時可安裝 piclayer 外掛,將這些圖片放進 JOSM 圖層,挑選其中幾個顯眼目標,透過平移、縮放、旋轉等操作,和開放街圖作對齊,以利針對景點相關設施位置,進行標示作業。

以下以修改故宮至善園的標示為例作說明。

0a.預先將景點設施圖以螢幕擷圖貼到小畫家存成【至善園.png】圖檔,如下:
0b.點選【編輯/偏好設定】,如下:
0c.點選【外掛/搜尋】輸入 piclayer,按【OK】,開始安裝 piclayer 外掛,如下:
1a.點選【圖磚/來自檔案的新相片圖層】,如下:
1b.點選預先擷取好的【至善園.png】圖檔,放進新圖層,命名為【至善園.png】圖層,如下:
2.點選【至善園.png】圖層為作用圖層,利用左側piclayer工具欄的平移、旋轉、縮放按鈕,操作圖層的圖片, 挑選其中幾個顯眼目標,將疊圖和底層圖資校正對齊。範例中的圖層由上而下依序顯示(visible)如下, 最上層為【至善園.png】圖層,透明度 < 50%, 中間層為【nlsc_wms_2019EMAP98】臺灣通用電子地圖(新),透明度 < 50%, 最底層為【nlsc_wms_2019PHOTO2】正射影像圖(通用)
3.點選【資料圖層1】圖層為作用圖層,顯示開放街圖向量圖資,利用左側開放街圖工具欄,開始修改設施位置及標示。
4.點選【檔案/上傳資料...】,上傳圖資更新集。稍後重新載入,即可得到新版至善園開放街圖,如下:
    註解
  1. 如何於JOSM載入臺灣通用電子地圖(新)及正射影像圖(通用)圖磚,可參考「how to show NLSC taiwan maps on JOSM」說明。
  2. 對於扭曲不大,或水平/垂直軸比例一致的圖片,piclayer 外掛允許操作左側工具欄的平移、旋轉、縮放三顆按鈕,將圖片校正對齊底圖; 對於扭曲較大,或水平/垂直軸比例不一致的圖片,piclayer 外掛也允許操作左側工具欄的綠色右上箭頭按鈕。先於圖片以圓圈標示3處檢查點, 再操作左側工具欄的紅色右上箭頭按鈕,分別對準圓圈正中央,移動檢查點和底圖對應位置重疊。 如此不斷修正圖片和底圖的3處檢查點對應關係,試著以仿射變換,將圖片校正對齊底圖,過程如「Using PicLayer plugin in JOSM...」YouTube範例所示。

docker command line summary

docker command line summary

image: a read-only file system consisting of a base layer and a series of difference layers

container: a writable file system consisting of an image and a top writable layer with network and volume hooks

    Note:
  • an image has id, name, tag, read-only_layers, entrypoint, and cmd
  • a container has id, name, source_image, writable_layer, overwrite_cmd, cpu_limit, memory_limit, volume_hook, network_hook, and state (active/un-active)
what docker can do with images in a local image store
  -- creation --
  - import/export with docker hub
   search in a docker hub (docker search)
   pull from a docker hub (docker pull)
   push to a docker hub (docker push)
  - import/export with local filesystem
   load from a local file (docker load)
   save to a local file (docker save)
  - born from scratch
   commit an un-active container to create an image (docker commit)
   build an image with Dockerfile instructions (docker build)
 
  -- management --
  list (docker images)
  remove (docker rmi)

what docker can do with containers in a local container store
  -- creation -- 
   create an un-active container from an image (docker create)
   run from an image with an overwrite command (docker run)
   execute a command (docker exec)

  -- management
   stop an active container with a grace period (docker stop)
   kill an active container (docker kill)
   start an un-active container (docker start)
   restart an active container (docker restart = 
   		docker stop + docker start)
  -
   copy with local filesystem (docker cp)
  -
   attach the console to a container (docker attach)
  -
   commit an un-active container to create an image (docker commit)
  -
   list (docker ps [-a])
   remove (docker rm [-f])
    Note:
  • an image runs a new container with an overwrite command = an image creates a new container + the container starts with an overwrite command
  • a container is created when docker creates from an image or runs from an image with an overwrite command
  • an image is created when docker commits a container or builds from a base image and a Dockerfile
#
#
# image operation
#
#

#### search for an image
docker search image_keyword

#### download an image
docker pull [registry.hub.docker.com/]image_path[:tag] 

#### list images in local drive
docker images [image_path]

#### create new images
1.docker commit -m "submit message" -a "submit user" container_id image_path[:tag]

 $ vi ./Dockerfile
 # This is a comment
 FROM ubuntu:14.04
 MAINTAINER Docker Newbee <newbee docker.com="">
 RUN apt-get -qq update
 RUN apt-get -qqy install ruby ruby-dev
 RUN gem install sinatra
 # put my local web site in myApp folder to /var/www
 ADD myApp /var/www
 # expose httpd port
 EXPOSE 80
 # the command to run
 CMD ["/usr/sbin/apachectl", "-D", "FOREGROUND"]

2.docker build -t="image_path:tag" .  

3.cat ubuntu-14.04-x86_64-minimal.tar.gz  | docker import - ubuntu:14.04

4.docker tag container_id image_path:new_tag

#### upload an image
docker push image_path # all tags

#### save and load an image as local file 
docker save -o ubuntu_14.04.tar ubuntu:14.04

docker load --input ubuntu_14.04.tar
docker load < ubuntu_14.04.tar

#### remove a local image
docker rmi image_path

#
#
# container operation
#
#

#### start and run a container with an image
docker run [-name container_name] ubuntu:14.04 /bin/echo 'Hello world'
docker run -t -i ubuntu:14.04 /bin/bash   ### start a container in interactive mode
docker start ubuntu:14.04

docker run -d ubuntu:14.04 /bin/sh -c "while true; do echo hello world; sleep 1; done"
docker ps [-a]     ### list containers, [all, inclusive of un-active containers]
docker logs insane_babbage

#### start and stop container
docker restart
docker stop
docker run -idt ubuntu
docker attach container_name

#### start a shell in a container, detach from it, and re-attach to it
docker exec -it container_name /bin/bash
# use Ctrl-p + Ctrl-q to detach from the container
docker attach container_name

#### import and export container 
docker export container_id > snapshot.tar
cat snapshot.tar | docker import - image_path[:tag]
docker import snapshot_url image_path

#### remove container
docker rm container_name
docker rm $(docker ps -aq)  ## remove all exited containers



References:
1.《Docker —— 從入門到實踐­》Run命令

2.How to use Docker without sudo on Ubuntu
  # grant docker permission to specific user 'foobar'
  > sudo setfacl -m user:foobar:rw /var/run/docker.sock
  > getfacl /var/run/docker.sock
  getfacl: 從絕對路徑名尾部去除"/"字符
  # file: var/run/docker.sock
  # owner: root
  # group: docker
  user::rw-
  user:foobar:rw-
  group::rw-
  mask::rw-
  other::---

3.Prepare docker.service.d/override.conf for the systemd drop-in service
  > sudo systemctl edit docker
  [Service]
  ExecStartPost=/bin/sh -c '/usr/bin/setfacl -m user:foobar:rw /var/run/docker.sock'
  > sudo systemctl daemon-reexec	# re-execute the systemd process
  > sudo systemctl daemon-reload	# reload the systemd manager configuration
  > sudo systemctl restart docker	# stop and start the docker service
    
4.Play With Docker provides an Alpine Linux 3.10 environment with docker and git ready for use
     CPU: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz with 8 cores
     Memory: 32GB
     Drive: 64GB with 16GB used
     Limit: Use of up to 5 nodes for up to 4 hours per session

how to connect codex app to remote ollama backend through caddy relay

如何讓 Codex App 連接公司架設的 LLM 從 Caddy 閘道安裝、遠端 Ollama API 金鑰,到 Codex 的 config.toml 組態設定,一次整理成可直接照做的流程。 前言 OpenAI 提供免費下載...

總網頁瀏覽量