겁 먹었었는데.. 가입이 되어 있었나?

그냥 네이버 아이디로 로그인 하니 문제없이 로그인 된다..


[링크 : https://www.ncloud.com/]

[링크 : https://www.ncloud.com/product/applicationService/maps]


독특하게(?) AI.Naver API 라고

AI Service와 Application Service가 합쳐져 있다.

Application Service에 Maps가 포함되고

AI Service에 Clova와 Papago가 포함된다.



[링크 : https://console.ncloud.com/mc/solution/naverService/application]



하단에 Applicaton 등록 누르고 동의 한다음

Application 이름 등록하고 쓸 서비스, 그리고 사용할 서비스 도메인을 등록한다.


그러면 아래와 같이 사용량 통계 나오고


인증정보를 누르면 아래와 같이 클라이언트 ID가 나온다.


가입하고 보니 친절한 설명이 나오네 ㅋㅋㅋ

[링크 : http://docs.ncloud.com/ko/naveropenapi_v3/application.html]

[링크 : https://navermaps.github.io/maps.js.ncp/]


<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <title>간단한 지도 표시하기</title>
    <script type="text/javascript" src="https://openapi.map.naver.com/openapi/v3/maps.js?ncpClientId=YOUR_CLIENT_ID"></script>
</head>
<body>
<div id="map" style="width:100%;height:400px;"></div>

<script>
var mapOptions = {
    center: new naver.maps.LatLng(37.3595704, 127.105399),
    zoom: 10
};

var map = new naver.maps.Map('map', mapOptions);
</script>
</body> 

</html> 


[링크 : https://navermaps.github.io/maps.js.ncp/tutorial-2-Getting-Started.html]



+

버전은 둘다 v3이고 clientId 식별자가 다른 키로 바뀌었다.


구버전

<script src="https://openapi.map.naver.com/openapi/v3/maps.js?clientId=USER_CLIENT_KEY"></script>


신버전

<script src="https://openapi.map.naver.com/openapi/v3/maps.js?ncpClientId=USER_CLIENT_KEY"></script>

Posted by 구차니

marker든 polyline 이든 setMap(null)을 해주면 사라진다.

한번에 편하게(?) 하는 법은 없고, 추가할때 배열로 관리해야 한다는 건 변하지 않네..


setMap(map)

오버레이를 지도에 추가합니다. 인수로 null을 전달하면 오버레이를 지도에서 제거합니다. 

[링크 : https://navermaps.github.io/maps.js/docs/naver.maps.Polyline.html]

[링크 : https://github.com/navermaps/maps.js/issues/31]

Posted by 구차니

ubuntu 18.04 Desktop Edition 64biut에

원인불명으로 mysql이나 mariadb를 설치하고 service start를 해주는데

한참 있다가 죽어 버리고 에러 메시지를 보니

시작 timeout 걸렸다거나

정상적인 종료 라고 써있어서 검색을 해보니


웬지 apparmor라는 놈이 제 2의 selinux 같은 악의 축으로 등극할 삘?

아무튼 이걸 아래 명령을 통해 apparmor로 보호하지 않도록 하면 문제없이 실행된다.

$ sudo ln -s /etc/apparmor.d/usr/sbin/mysqld /etc/apparmor.d/disable/ 


[링크 : https://jimnong.tistory.com/758]

Posted by 구차니

ffmpeg로 동영상을 합치는 방법

코덱 설정하면 하나로 합칠순 있겠지만.. 단일 파일별로 특정 시간 영역을 자르긴 무리일려나?


16. Joining multiple video parts into one

FFmpeg will also join the multiple video parts and create a single video file.

Create join.txt file that contains the exact paths of the files that you want to join. All files should be same format (same codec). The path name of all files should be mentioned one by one like below.

/home/sk/myvideos/part1.mp4

/home/sk/myvideos/part2.mp4

/home/sk/myvideos/part3.mp4

/home/sk/myvideos/part4.mp4

Now, join all files using command:


$ ffmpeg -f concat -i join.txt -c copy output.mp4 


[링크 : https://www.ostechnix.com/20-ffmpeg-commands-beginners/]

'프로그램 사용 > ffmpeg & ffserver' 카테고리의 다른 글

ffmpeg 레이턴시 관련 옵션 조사  (0) 2018.12.16
ffmpeg / ffplay cli interactive interface  (0) 2018.11.30
ffmpeg concat  (0) 2018.10.10
ffmpeg huffyuv  (0) 2017.02.28
ffmpeg으로 컨테이너 변경하기  (0) 2016.12.01
Posted by 구차니

의외로 싱겁네 -_-

콘솔에서 자주 이용하는데 매번 너무 길게 나와서 불편했는데..


[링크 : https://stackoverflow.com/.../how-to-show-git-log-history-for-a-sub-directory-of-a-git-repo]

'프로그램 사용 > Version Control' 카테고리의 다른 글

git 윈도우 자격증명 관리  (0) 2019.01.16
git tag  (0) 2018.12.07
.gitignore  (0) 2018.10.22
git 리비전 이동 후 pull 안되는 문제  (0) 2018.10.22
git 리비전 돌아 다니기  (0) 2018.10.18
Posted by 구차니
프로그램 사용/nginx2018. 10. 30. 18:51

nginx를 이용해서 http proxy로 사용하는 방법


다른서버 있어서 80은 못쓰고

81번으로 셋팅했고

/test1/ 은 nginx 서버와 동일한 ip의 3001번 포트로 포워딩

/test2/ 는 nginx 서버와 동일한 ip의 3002번 포트로 포워딩 해서 작동한다.


단, node.js나 angular의 경우 상대경로와 절대경로를 조심해서 작성해야 정상적으로 작동하게 된다.

(angular는 안써서 모르겠지만 deploy 시 경로를 잘 지정해야 할지도?)

[링크 : https://itnext.io/angular-cli-proxy-configuration-4311acec9d6f]


의외로 끝에 오는 / 의 역활이 지대하다

    server {

        listen       81 default_server;

        listen       [::]:81 default_server;

        server_name  _;

        root         /usr/share/nginx/html;


        # Load configuration files for the default server block.

        include /etc/nginx/default.d/*.conf;


        location / {

        }


        error_page 404 /404.html;

            location = /40x.html {

        }


        error_page 500 502 503 504 /50x.html;

            location = /50x.html {

        }


        location /test1/ {

                proxy_set_header X-Real-IP $remote_addr;

                proxy_set_header Host $host;

                proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;

                proxy_pass http://localhost:3001/;

        }


        location /test2/ {

                proxy_set_header X-Real-IP $remote_addr;

                proxy_set_header Host $host;

                proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;

                Host proxy_set_header $ HTTP_HOST;

                proxy_pass http://localhost:3002/;

        }

    }

 


[링크 : http://www.codingpedia.org/...-in-production-to-serve-angular-app-and-reverse-proxy-nodejs]

[링크 : https://www.joinc.co.kr/w/man/12/proxy]

[링크 : https://gist.github.com/soheilhy/8b94347ff8336d971ad0]

Posted by 구차니

+

2018.12.12

유입경로가 많아서 수정

latitude가 위도, longitude가 경도


위도 33도~38도 (북한 포함하면 43도 정도, 38선은 가로로 그인 선이니까 위도로 외우면 쉬움)

경도 126~131도

값을 지님


new naver.maps.LatLng(lat,lng) 함수는 위도 먼저, 경도 먼저인데

new naver.maps.LatLng(lat, lng)

Parameters
NameTypeDefaultDescription
latnumber0

위도

lngnumber0

경도

 


DB쪽의 실수인지 간혹 반대로 들어있는 경우도 존재한다.

귀찮으면(?)

function latlng_corrector(lat, lng) {

  if (33.0 <= lat && lat <= 43.0 && (124.0 <= lng && lng <= 132.0))

    return { lat: lat, lng: lng };

  else if (124.0 <= lat && lat <= 132.0 && (33.0 <= lng && lng <= 43.0)) {

    console.log("latitude/longitude swapped!!");

    return { lat: lng, lng: lat };

  } else return { lat: lat, lng: lng };

이런거 하나 넣고 대충 위도 경도 정보가 뒤바뀌었을 경우 자동으로 뒤집어 주는 것도 방법 일 듯?


+

2018.12.13

아래 예제에서 클릭해서 마커 지정하고

개발자 도구에서 marker.getPosition() 해주면 위치 값이 똭~ 나온다.

이 키워드로 검색하는 분들 목적은.. 위도경도 정보 뽑아 내는거라면 그게 더 나을지도?


[링크 : https://navermaps.github.io/maps.js/docs/tutorial-9-marker-position.example.html]


---

아무생각 없이(!) path에 좌표를 아래와 같이 LatLang([pos1, pos2]) 식으로 했더니

배열이 정렬되어 버리는지 작은 수랑 큰수랑 순서가 엉뚱하게 작동을 한다.

new naver.maps.Polyline({
path: [
new naver.maps.LatLng([
marker_db[data[idx].cid].lng,
marker_db[data[idx].cid].lat
]),
new naver.maps.LatLng([
marker_db[data[idx + 1].cid].lng,
marker_db[data[idx + 1].cid].lat
])
],
map: map,
endIcon: naver.maps.PointingIcon.OPEN_ARROW,
strokeColor: "#cc0000",
strokeWeight: 6
});


반드시(?) []를 빼고 아래와 같이 써야 하는건가...

근데 배열이랑 숫자랑 먼가 다른건가.. 삽입(?)하는 순서에 영향을 받네?

new naver.maps.Polyline({
path: [
new naver.maps.LatLng(
marker_db[data[idx].cid].lat,
marker_db[data[idx].cid].lng
),
new naver.maps.LatLng(
marker_db[data[idx + 1].cid].lat,
marker_db[data[idx + 1].cid].lng
)
],
map: map,
endIcon: naver.maps.PointingIcon.OPEN_ARROW,
strokeColor: "#cc0000",
strokeWeight: 6
});

[링크 : https://navermaps.github.io/maps.js/docs/naver.maps.LatLng.html


+

걍 고민을 해보니.. 변수 하나에 null값이 들어 갔을 뿐

lat lng의 순서 문제라던가 array의 문제라고 보긴 힘들지도...?

Posted by 구차니

머.. 거장한것 없이 프로젝트 최상위 폴더에

.gitignore로 생성하고

상위 폴더 경로나 특정 파일명 혹은 *을 포함해서 적어주면 된다.


[링크 : https://nesoy.github.io/articles/2017-01/Git-Ignore]


+

vscode에서 최상위 프로젝트 파일에다가 설정해주니 하위에서도 정상적으로 gitignore가 적용된다.

걍.. 폴더로 무시하는게 답이었던 듯..

$ cat .gitignore

node_modules/ 

[링크 : http://trend21c.tistory.com/1471]

Posted by 구차니

git pull 하다 보니 에러가 나서 확인하려고 보는데

detached branch 라던가

You are not currently on a branch 이라던가 나오는데


생각해보니 구버전으로 잠시 돌려놓았던 것이 문제..

아무튼 결론(?)은 master로 돌리고 나서 손을 보면 된다?


[링크 : https://okky.kr/article/437352]

[링크 : https://blog.npcode.com/2012/09/02/git-pull-할-때-옵션-안줘도-알아서-되게-하기/]

[링크 : http://sunphiz.me/wp/archives/2266?ckattempt=1]

[링크 : https://stackoverflow.com/...-currently-on-a-branch-error-when-trying-to-sync-fork-with-upstream]


+

2018.10.23

$ git branch

* (detached from 7ea96f5)

  master

$ git checkout master

Switched to branch 'master'

Your branch is behind 'origin/master' by 3 commits, and can be fast-forwarded.

  (use "git pull" to update your local branch) 


'프로그램 사용 > Version Control' 카테고리의 다른 글

git log . - 현재 디렉토리 이하의 변경내역 보기  (0) 2018.11.02
.gitignore  (0) 2018.10.22
git 리비전 돌아 다니기  (0) 2018.10.18
git 상태 다시 읽기  (0) 2018.09.20
git 원격지 주소 변경하기  (0) 2018.09.06
Posted by 구차니

checkout을 이용해서 특정 리비전을 돌아 다닐수 있다.

예전에 branch 오가던 느낌이네..


git checkout HEAD~10

git checkout master 

[링크 : https://mytory.net/archives/10078]

'프로그램 사용 > Version Control' 카테고리의 다른 글

.gitignore  (0) 2018.10.22
git 리비전 이동 후 pull 안되는 문제  (0) 2018.10.22
git 상태 다시 읽기  (0) 2018.09.20
git 원격지 주소 변경하기  (0) 2018.09.06
git archive (svn export)  (0) 2018.09.05
Posted by 구차니