Posted
Filed under JSP, JAVA
[원문]
http://krams915.blogspot.com/2010/12/spring-security-mvc-querying.html @Resource(name="sessionRegistry") private SessionRegistryImpl sessionRegistry; for (Object username: sessionRegistry.getAllPrincipals()) { logger.debug(username); }
2019/01/14 12:08 2019/01/14 12:08
Posted
Filed under Link
vi /etc/ssh/ssh_config
ServerAliveInterval 60
service sshd restart
2018/12/21 10:10 2018/12/21 10:10
Posted
Filed under Mysql
ALTER TABLE `tb_webstat_info`
 CHANGE COLUMN `wi_code` `wi_code` VARCHAR(10) binary DEFAULT NULL COMMENT '모바일명세표_코드' AFTER `wi_rnum`;

VARCHAR(10) binary  형식으로 설정을 해주던지
문자열 타입을  utf8_bin;으로 설정 한다
2018/09/28 18:12 2018/09/28 18:12
Posted
Filed under C#
c#  add mediaplayer component
Choose
Tool Box Items->Com Components->Windows Media Player

player.URL="재생 주소";
주소만 할당해주면 재생됨
2018/07/03 18:37 2018/07/03 18:37
Posted
Filed under Linux
scp 명령어를 이용한 파일 복사 및 전송

 

  ssh에서 제공되는 scp 명령어를 통해 로컬서버↔원격서버 로의 파일을 간단하게 전송할 수 있다.

 

 1. 사용방법
    1) 원격 서버 → 로컬 서버로 파일 전송
        # scp [옵션] [계정명]@[원격지IP주소]:[원본 경로 및 파일] [전송받을 위치]


        예제1) IP 111.222.333.444 서버의 abc라는 계정으로 /home/abc/index.html 파일을 로컬서버 /home/me/ 디렉토리에 전송 받기

                    # scp abc@111.222.333.444:/home/abc/index.html /home/me/

 

    2) 로컬 서버 → 원격 서버로 파일 전송
        # scp [옵션] [원본 경로 및 파일] [계정명]@[원격지IP주소]:[전송할 경로]


        예제2) 로컬서버 /home/me/wow.html 파일을 IP 111.222.333.444 서버의 /home/abc/ 디렉토리에 전송 하기
                   # scp /home/me/wow.html abc@111.222.333.444:/home/abc/

 

    3) ssh포트를 기본 22번으로 사용하고 있지 않는 서버로의 전송


        예제3) 2222번인 SSH포트를 사용한다면 아래와 같이 –P 옵션과 포트번호를 넣어준다.
                  # scp –P 2222 abc@111.222.333.444:/home/abc/index.html /home/me/
                  # scp –P 2222 /home/me/wow.html abc@111.222.333.444:/home/abc/

 

        [주의사항]
        옵션중에 –P와 –p가 있으니 대/소문자 확인을 하여야 한다.
        -P : 포트번호를 지정함
        -p : 원본파일 수정/사용시간 및 권한을 유지함
        -r : 하위 디렉토리 및 파일 모두 복사함

[원문]
http://faq.hostway.co.kr/?mid=Linux_ETC&page=9&document_srl=1426

2018/06/07 13:46 2018/06/07 13:46
Posted
Filed under PHP
In SQL Server, you can use CONVERT function to convert a string with the specified format to a DATETIME value. In MySQL, you can use STR_TO_DATE function if you need a specific format, or CONVERT if you need the default format.

Note that the order of parameters in SQL Server and MySQL CONVERT functions is different.

SQL Server:

  -- 3rd parameter specifies 121 style (ODBC 'YYYY-MM-DD HH:MI:SS.FFF' format with milliseconds)
  SELECT CONVERT(DATETIME, '2012-11-29 18:21:11.123', 121);
  # 2012-11-29 18:21:11.123
 
  SELECT CONVERT(DATETIME, GETDATE());
  # 2017-04-07 09:55:40.550

MySQL:

  -- Specify string format using format specifiers
  SELECT STR_TO_DATE('2012-11-29 18:21:11.123', '%Y-%m-%d %T.%f');
  # 2012-11-29 18:21:11.123000
 
   SELECT CONVERT(NOW(), DATETIME);
   # 2017-04-07 09:55:40

Mapping SQL Server Datetime Style to MySQL Format

When you convert CONVERT function to STR_TO_DATE you have to map the SQL Server style to the appropriate format string in MySQL:

SQL Server Style MySQL Format String String Example
101 US - MM/DD/YYYY '%m/%d/%Y' '11/29/2012'
121 ODBC - YYYY-MM-DD HH:MI:SS.FFF '%Y-%m-%d %T.%f' '2012-11-29 18:21:11.123'

Conversion examples:

SQL Server MySQL
CONVERT(DATETIME, '11/29/2012', 101) STR_TO_DATE('11/29/2012', '%m/%d/%Y')
CONVERT(DATETIME, '2012-11-29 18:21:11.123', 121) STR_TO_DATE('2012-11-29 18:21:11.123', '%Y-%m-%d %T.%f')

SQL Server CONVERT for SMALLDATETIME in MySQL

In SQL Server SMALLDATETIME data type stores a datetime value with 00 seconds. You can use the expression below to keep 00 seconds after using the CONVERT function in MySQL:

SQL Server:

  -- SMALLDATETIME is always with 00 seconds
  SELECT CONVERT(SMALLDATETIME, GETDATE());
  # 2017-04-07 10:05:00

MySQL:

   SELECT CONVERT(DATE_FORMAT(NOW(), '%Y-%m-%d %H-%i-00'), DATETIME);
   # 2017-04-07 10:05:00
2018/04/27 22:47 2018/04/27 22:47
Posted
Filed under PHP
[원문]
lib/shop.lib.php

#1
1 if($row['io_price'] >= 0)
2     $price = '  + '.number_format($row['io_price']).'원';
3 else
4     $price = '   '.number_format($row['io_price']).'원';


1 if($row['io_price'] > 0)
2     $price = '  + '.number_format($row['io_price']).'원';
3 else if ($row['io_price'] == 0)
4     $price = '';
5 else
6     $price = '   '.number_format($row['io_price']).'원';

로 수정


#2
1 if($row['io_price'] >= 0)
2     $price = '  + '.number_format($row['io_price']).'원';
3 else
4     $price = '   '.number_format($row['io_price']).'원';


1 if($row['io_price'] > 0)
2     $price = '  + '.number_format($row['io_price']).'원';
3 else if ($row['io_price'] == 0)
4     $price = '';
5 else
6     $price = '   '.number_format($row['io_price']).'원';

로 수정

js/shop.js

#1
1 var priceHide = '';
2 if (parseInt(price) == 0) priceHide = ' sound_only';

를 add_sel_option 에 추가

#2
1 opt += "<span class=\"sit_opt_prc\">"+opt_prc+"</span>";


1 opt += "<span class=\"sit_opt_prc"+priceHide+"\">"+opt_prc+"</span>";

로 수정

2018/04/09 17:50 2018/04/09 17:50
Posted
Filed under JSP, JAVA

tomcat8
/webapp/manager/META-INF/context.xml

<!--Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /-->
주석 처리가 되어 있다면
주석을 해제하여 외부에서 접근 하는 것을 막을 수 있다.


2018/04/09 14:28 2018/04/09 14:28
Posted
Filed under Linux
cat /proc/$(pgrep maxscale)/limits
실행 하면 maxscale의
open file 쪽에 1024로 설정 되어 있습니다.
이부분을 늘려 주기 위해서는
vi /usr/lib/systemd/system/maxscale.service
LimitNOFILE=65536
위와 같이 설정 합니다.

2018/04/09 13:45 2018/04/09 13:45
Posted
Filed under Linux

호스트 내임 변경
hostnamectl set-hostname  blog.visualp.com

호스트 내임 확인
hostname

현재 세션(쉘)에서는 바뀌지 않지만,
재접속 하면 변경된것을 확인 할 수 있습니다.



2018/04/05 14:48 2018/04/05 14:48