필드명도 table.field AS newfilename 으로 하면 되네


[링크 : https://statkclee.github.io/sql-ecology-lesson/kr/03-sql-joins-aliases.html]

Posted by 구차니

데이터가 좀 지랄 같이(?) 많은 녀석이긴 한데


mysql> select count(*) from dht11;

+----------+

| count(*) |

+----------+

|    57186 |

+----------+

1 row in set (0.09 sec)


mysql> select count(*) from ph;

+----------+

| count(*) |

+----------+

|    57637 |

+----------+

1 row in set (0.17 sec) 


아무생각 없이 조인하고 조건식을 돌리니 8초.. ㄷㄷ

select * from dht11 as T,ph as P where T.created = P.created and DATE(T.created) >= '2018-12-20'; 

97 rows in set (8.12 sec)


날짜 쳐내고 조인하니 0.44초!

select * from 

(select * from dht11 where DATE(created) >= '2018-12-20' ) as T,

(select * from ph where DATE(created) >= '2018-12-20' ) as P 

WHERE T.created = P.created; 

98 rows in set (0.44 sec)



+
요건 DATE() 찾아 본다고 링크 추가

[링크 : https://code.i-harness.com/ko-kr/q/1c4e6a]

Posted by 구차니
프로그램 사용/CUPS2018. 12. 21. 13:27

-o scaling=[0~100]

일정 비율로 줄일순 있는데 원하는 크기대로 출력하는건 아직 못 찾음..

pdf 등으로 변환해서 크기를 조절해야 하려나?


[링크 : https://www.cs.utexas.edu/facilities/documentation/printing-options]

[링크 : https://vincenttam.github.io/blog/2014/12/10/print-actual-sized-images/]

[링크 : https://www.cups.org/doc/options.html]

[링크 : http://www.it.uu.se/datordrift/maskinpark/skrivare/cups/]

Posted by 구차니
프로그램 사용/CUPS2018. 12. 21. 11:01

앞 단계에서 프린터 이름과 장치명(/dev/usb/lp0)를 연결해주는게 빠지긴 했는데 

아무튼 L805로 등록한 프린터를 기본으로 설정해주려면

lpoptions를 통해 -d 옵션으로 프린터를 지정해주면 된다.


pi@raspberrypi:~ $ lpstat -p -d


printer L805 is idle.  enabled since Thu 20 Dec 2018 08:29:17 UTC


        Rendering completed


no system default destination


pi@raspberrypi:~ $ lpoptions -d L805


copies=1 device-uri=usb://EPSON/L805%20Series?serial=5738384B3030303494 finishings=3 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=0 number-up=1 printer-commands=none printer-info=L805 printer-is-accepting-jobs=true printer-is-shared=false printer-location printer-make-and-model='Epson XP-850 Series, Epson Inkjet Printer Driver (ESC/P-R) for Linux' printer-state=3 printer-state-change-time=1545294557 printer-state-reasons=none printer-type=2101276 printer-uri-supported=ipp://localhost:631/printers/L805


pi@raspberrypi:~ $ lpstat -p -d


printer L805 is idle.  enabled since Thu 20 Dec 2018 08:29:17 UTC


        Rendering completed


system default destination: L805 

[링크 : https://bbs.archlinux.org/viewtopic.php?id=28914]

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

lp lpr 명령어(프린트)  (0) 2018.12.21
cups banner file format  (0) 2018.12.20
CUPS 외부에서 접근 가능하도록 설정하기  (0) 2018.12.20
리눅스에서 프린터 추가  (0) 2018.12.20
cups / lp로 출력하기  (0) 2018.12.18
Posted by 구차니
프로그램 사용/CUPS2018. 12. 20. 14:18

궁금해 하던

#PDF-BANNER

Template

Show 

요녀석의 출처인가?

[링크 : https://www.cups.org/doc/spec-banner.html]


+

2018.12.21

#PDF-BANNER 를 삭제하고 출력하니 그냥 텍스트로 출력된다.


+

2018.12.21

췟 안되잖아!?

pi@raspberrypi:~/src $ cat cups_testpage

#CUPS-BANNER


# What to show on the cover page

Show job-id job-name job-originating-user-name time-at-creation


$ lp cups_testpage

lp: Unsupported document-format "application/vnd.cups-banner".


이미 깔려있고 설치한다고 해서 먼가 달라지진 않는다. cups 설정에서 필터 사용하도록 활성화 하는게 있나?

$ apt-cache search cups-filters

cups-filters - OpenPrinting CUPS Filters - Main Package 

[링크 : https://github.com/apple/cups/issues/5173]

Posted by 구차니
프로그램 사용/CUPS2018. 12. 20. 14:11

특이하게도 아래 명령은 cups 패키지 안깔아도 있네(라즈베리 기준)

아무튼 아래의 명령을 하면 외부에서도 631번 포트를 통해 cups 관리 페이지 접근이 가능해진다.


# cupsctl --remote-admin --remote-any --share-printers 

[링크 : https://askubuntu.com/questions/23936/how-do-you-administer-cups-remotely-using-the-web-interface]

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

lpoptions 로 기본 프린터 지정하기  (0) 2018.12.21
cups banner file format  (0) 2018.12.20
리눅스에서 프린터 추가  (0) 2018.12.20
cups / lp로 출력하기  (0) 2018.12.18
cups.. 드라이버 경로 print$  (0) 2016.06.16
Posted by 구차니
프로그램 사용/CUPS2018. 12. 20. 14:04

대개 CUPS나

우분투의 프린터 프로그램을 통해서 추가하라고 하네..

일단 콘솔로 추가하는거 찾아 보니 cups를 기반으로 하는 듯..


[링크 : https://blog.ostermiller.org/ubuntu-printer-install-command-line/]

Posted by 구차니

걍 아이피 주면 될줄 알았는데 그건 dbname으로 인식하고

-h 옵션 뒤에 호스트 아이피나 도메인을 입력하면 된다.

$ mysql -u fooUser -p -h 44.55.66.77 

[링크 : https://support.rackspace.com/how-to/mysql-connect-to-your-database-remotely/]

Posted by 구차니
프로그램 사용/CUPS2018. 12. 18. 15:54

lp 파일명

lp 파일명 -o page-top=400 -o page-bottom=400


아래처럼 하니 사진이 무지 작게 나온다. 단위가 멀까?


-o page-bottom=N

-o page-left=N

-o page-right=N

-o page-top=N

Sets the page margins when printing text files. The values are in points - there are 72 points to the inch. 

[링크 : http://www.it.uu.se/datordrift/maskinpark/skrivare/cups/man-lp.html]


+

400/72=5.5 인치(?)

5.5 * 2.54 = 14.097 cm

A4 사이즈가 210mm*297mm 니까 

세로로 찍을때 bottom / top 지정해주면

297 - 140*2 = 17mm 정도 크기로 출력하게 될듯?

Posted by 구차니

열지도 처럼 가중치 줘서 출력 가능하고

출력하는 색상을 바꿀수 있는 듯.

(안개 출력하기 좋으려나?)


[링크 : https://navermaps.github.io/maps.js/docs/data/earthquake_weight.json

[링크 : https://navermaps.github.io/maps.js/docs/tutorial-Visualization.html]

[링크 : https://navermaps.github.io/maps.js/docs/tutorial-5-visualization-dotmap-w.example.html]

Posted by 구차니