본문 바로가기

cross-domain 해결방안 - JSONP JSONP 란?개발을 하다보면 어쩔 수 없이 다른 도메인으로부터 데이터를 가져와야 하는 경우가 많기에 많은 사람들이 cross-domain 이슈를 겪고 있습니다. 이런 경우 사용할 수 있는 것이 JSONP(JSON with Padding)입니다.http://sugerent.tistory.com/424 참고 1. PHP - 요청한 콜백함수를 통해 데이터를 전달한다. 2-1. NODE JS(Javascript) - JSONP로 PHP서버에 접속하여 데이터를 가져온다. let menu_list = new Array(); //로컬 서버 저장 배열$.ajax({ type: "POST", url: "페이지.php", dataType: "jsonp", async : false, jsonpCallback : "myCa..
postgresql 연동 1. postgresql 설치 pi@raspberrypi :~ $ apt-get install postgresql https://zetawiki.com/wiki/%EC%9A%B0%EB%B6%84%ED%88%AC_PostgreSQL_%EC%84%A4%EC%B9%98 2. npm 설치 pi@raspberrypi :~ $ sudo npm install pg 3. pg 연동 var pg = require('pg'); exports.postgresql = function(item, i, slipno) { const config = { user: 'pos_kds', //env var: PGUSER database: 'easypos', //env var: PGDATABASE password: 'kiosk', //en..
SERIAL PORT 고정설정 pi@raspberrypi:~ $ dmesg | grep ttyUSB [4.074363] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUSB0 [4.075590] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB1 시리얼 정보를 받아본다pi@raspberrypi:~ $ udevadm info --name=/dev/ttyUSB0 --attribute-walk ... pi@raspberrypi:~ $ udevadm info --name=/dev/ttyUSB1 --attribute-walk 각각의 시리얼에 상세정보를 받아본 후 ATTRS{serial}=="A1LPXWF"AT..
ECONNREFUSED - network가 붙기전에 DB가 붙어버린 오류해결 sudo mysql -u rootuse mysql; update user set authentication_string=password(''), plugin='mysql_native_password' where user='root';flush privileges;
[ Raspberry Pi ] 화면회전 및 터치보정 라즈베리파이 화면 회전 라즈베리파이를 화면을 회전시킨다.sudo nano /boot/config.txtdisplay_rotate = 3 (0 = 0도, 1 = 90도, 2 = 180도, 3 = 270도) 라즈베리파이 터치 보정 라즈베리파이를 화면을 회전시키면 터치를 보정시켜야 한다.sudo nano /etc/X11/xorg.conf.d/90-rotate-screen.conf( xorg.conf.d가 없을경우 생성) sudo nano /usr/share/X11/xorg.conf.d/90-rotate-screen.conf아래 내용 복사해서 붙여넣기 Section "Input Class" Identifier "RotateTouchCW" MatchProduct "ILITEK ILITEK-TP" Option "T..
[ Raspberry Pi ] 비밀번호 변경 라즈베리파이 비밀번호 변경 라즈베리파이를 비밀번호를 변경한다.sudo raspi-config1. Change User password 클릭 Enter new UNIX password : 비밀번호 입력 ( 숨김 )Retype new UNIX password : 비밀번호 재확인 ( 숨김 )passwd : password updated successfully ( 변경 성공 )
[ Raspberry Pi ] 마우스 커서 숨기기 라즈베리파이 마우스 커서 숨기기 라즈베리파이를 마우스 커서를 숨긴다.sudo apt-get install uncluttersudo nano ~/.config/lxsession/LXDE-pi/autostart@unclutter -idle 0sudo reboot
[ Raspberry Pi ] 절전모드 및 스크린세이버 해제 라즈베리파이 절전모드 해제 라즈베리파이를 절전모드 해제sudo nano /etc/lightdm/lightdm.conf#xserver-command = x => xserver-command = x -s O -dpms 라즈베리파이 스크린세이버 해제 라즈베리파이를 스크린세이버 해제sudo nano /etc/X11/xinit/xinitrcxset s offxset -dpmsxset s noblank