개소리 왈왈/컴퓨터2018. 10. 22. 19:21

갑자기 펜이 인식이 안되거나

갑자기 흘려쓰기로 써진다거나(펜이 계속 눌림)

한번 인식 안되면 살아나지 않아서 배터리 뽑았다 꽂아야 한다거나


하는 증상이 다시 발생

아.. 배터리 다 된건가?


[링크 : https://www.clien.net/service/board/use/9083975]

[링크 : http://data.energizer.com/pdfs/ind-6lr61pl_eu.pdf]

[링크 : https://www.dell.com/.../microsoft-surface-pro-4-sp4-스타일러스-배터리-수명-및-문제-해결?lang=ko]

[링크 : http://bbs.ruliweb.com/hobby/board/300010/read/1033974]


+

딱 두달 전 인가..

출퇴근 한시간 반 * 2= 3시간 정도 씩 주 5일 사용한거 같은데 2달 버티다니...

2018/08/23 - [개소리 왈왈/컴퓨터] - 서피스 프로 3 펜 AAAA 배터리 획득(?!)

Posted by 구차니
Programming/node.js2018. 10. 22. 17:38

typeof를 이용해서 undefined 와 비교하면 됨

(req.body나 req.param 로 들어오는 녀석들 값 있는지 존재여부 비교하기 용)


if (typeof query !== 'undefined' && query !== null){

   doStuff();

[링크 : http://misoin.tistory.com/53]

[링크 : https://stackoverflow.com/.../how-can-i-check-whether-a-variable-is-defined-in-node-js]


+

2018.10.23

써보니. undefined는 변수로 사용되는 reserved keyword가 아니다

즉, "undefined"나 'undefined'와 비교를 해주어야 한다.

'Programming > node.js' 카테고리의 다른 글

curl jwt  (0) 2018.10.26
node-rtsp-stream 과 node-rtsp-stream-es6 차이  (0) 2018.10.24
node.js를 이용한 자기 자신의 ip 얻기  (4) 2018.10.22
웹소켓 그리고 공유기?  (4) 2018.10.18
node-rtsp-stream의 pid 얻기  (0) 2018.10.18
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 구차니
개소리 왈왈/컴퓨터2018. 10. 22. 15:45

HDMI-in 이라고 되어있어서 무언가 좋은 기능인줄 알고 찾아봤는데

대놓고 무쓸모 -_-


일단.. 하스웰 내장 그래픽 카드를 쓰고

외부 모니터를 HDMI로 연결하고(메뉴얼에 의하면)

다른 HDMI source를 받아서 alt-c 등의 미리 등록된 단축키를 사용하여

메인보드에서 HDMI selector 역활을 해주는 녀석

전원 꺼도 상관없다지만 정확하게는 S5 절전상태고 완전 전원 뽑은 상태에서는 안되는 기능


메인보드로 입력하길래 HDMI 캡쳐라던가 동영상 저장 기능이라도 있을줄 알았는데 그것도 아니고

내장 그래픽 소켓으로만 된다니 대실망쇼~


[링크 : https://www.youtube.com/watch?v=wivYGt_SIg8]

[링크 : http://www.asrock.com/news/index.asp?cat=News&ID=1274]

[링크 : https://www.asrock.com/mb/Intel/Z87%20OC%20Formula/]


1. If there is no video displayed on your monitor, make sure that the cables are properly connected and make sure that “Deep S5” option in BIOS SETUP is set to [Disable]. 2. If required, connect a power source to the adapter that lets the smartphone/tablet output HDMI signal 

[링크 : http://asrock.pc.cdn.bitgravity.com/Manual/Z87%20OC%20Formula.pdf]


+

메인보드 설계상 HDMI in 1채널과 HDMI out 1채널이니까

CPU 쪽 HDMI 출력과 HDMI in 출력을

USB 키보드 입력에 따라서 단순하게 전환해주면 되는 기술..

단지, HDMI 셀렉터의 버튼을 키보드로 치환했을 뿐인 용도 불명의 기술.. -_-

Posted by 구차니
Programming/node.js2018. 10. 22. 15:11

javascript로는 ip를 얻을 수 없지만 node.js라면 가능하니까 머..

(자기 자신의 IP를 얻어서 보낸다거나)


var ip = require("ip");

console.dir ( ip.address() ); 

[링크 : https://stackoverflow.com/questions/3653065/get-local-ip-address-in-node-js]

'Programming > node.js' 카테고리의 다른 글

node-rtsp-stream 과 node-rtsp-stream-es6 차이  (0) 2018.10.24
node.js undefined 확인하기  (0) 2018.10.22
웹소켓 그리고 공유기?  (4) 2018.10.18
node-rtsp-stream의 pid 얻기  (0) 2018.10.18
node.js post body  (0) 2018.10.17
Posted by 구차니
Linux API2018. 10. 22. 14:52

[링크 : https://linux.die.net/man/3/system]

[링크 : https://linux.die.net/man/2/wait]


+

system으로는 실행 내용을 돌릴수 없으므로 ppipe 이용

[링크 : http://wanochoi.com/?p=178]


+

POST 인자로 body에 id와 password를 넘겨주는 curl을 실행하는 예제

#include <stdio.h>

#include <stdlib.h>


void main()

{

        int ret = 0;

        int status = 0;


        unsigned char cmd[255];

        unsigned char id[32] = "admin";

        unsigned char pw[32] = "admin";

        unsigned char url[] = "http://localhost:3000/api/test";

        unsigned char header[] = "-H 'Content-Type: application/json'";

        unsigned char data = "-d '{ \"id\":\"%s\",\"password\":\"%s\"}'";

        sprintf(cmd, "curl -X POST %s %s -d '{ \"id\":\"%s\",\"password\":\"%s\"}'",

                url, header, id, pw);

        printf("%s\n",cmd);


//      ret = system(cmd);

//      wait(&status);


        FILE *output = popen(cmd, "r");

        char buf[255];

        int pos = 0;

        while( !feof(output) && !ferror(output) )

        {

                int bytesRead = fread( buf + pos , 1, 128, output );

                pos += bytesRead;

        }


        printf("buf : [%s]\n",buf);


//      printf("ret : [%d]\n",ret);

//      printf("sta : [%d]\n",WEXITSTATUS(status));


+

이상한 메시지는 curl 을 콘솔에서 실행할때에도 안나오는데 아무튼. pipe로 실행하면 넘겨져 온다. 

보기 싫으면 --silent 옵션주면 끝

# ./a.out

curl -X POST http://localhost:3000/api/test -H 'Content-Type: application/json' -d '{ "id":"1234","password":"1234"}'

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100   397  100   363  100    34  18426   1725 --:--:-- --:--:-- --:--:-- 19105 

[링크 : https://makandracards.com/makandra/1615-disable-output-when-using-curl[

'Linux API' 카테고리의 다른 글

libescp  (0) 2019.01.03
cups api  (0) 2018.12.20
ncurse  (0) 2015.04.27
lirc - linux IR Remote control  (0) 2015.03.31
vaapi vdpau uvd  (6) 2015.03.26
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 구차니
Programming/C Win32 MFC2018. 10. 22. 11:44

c언어에서 uuid 생성하기

$ cat uuid.c

#include <uuid/uuid.h>

#include <stdio.h>


void main()

{

        uuid_t out;

        uuid_generate_random(out);

        printf("%x",out);

}

$ gcc uuid.c -luuid

[링크 : https://linux.die.net/man/3/uuid_generate]

[링크 : https://superuser.com/questions/1175935/how-can-i-fix-uuid-uuid-h-no-such-file-error-in-centos]


 typedef unsigned char uuid_t[16];

[링크 : https://git.busybox.net/busybox/plain/e2fsprogs/uuid/uuid.h?h=1_3_stable]

'Programming > C Win32 MFC' 카테고리의 다른 글

while(-1) 이 될까?  (0) 2019.05.24
c언어용 JSON 라이브러리 목록  (0) 2018.10.23
엔디안 급 멘붕..  (0) 2018.05.29
const char *과 char * const 차이  (0) 2018.01.31
소스 코드 포맷 적용하기  (0) 2018.01.08
Posted by 구차니