blog.visualp.com
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
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
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') |
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
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' ]). '원' ; |
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' ]). '원' ; |
1 |
var priceHide = '' ; |
2 |
if (parseInt(price) == 0) priceHide = ' sound_only' ; |
1 |
opt += "<span class=\"sit_opt_prc\">" +opt_prc+ "</span>" ; |
1 |
opt += "<span class=\"sit_opt_prc" +priceHide+ "\">" +opt_prc+ "</span>" ; |
/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" /-->
cat
/proc/
$(pgrep maxscale)
/limits
실행 하면 maxscale의
open file 쪽에 1024로 설정 되어 있습니다.
이부분을 늘려 주기 위해서는
vi /usr/lib/systemd/system/maxscale.service
LimitNOFILE=65536
위와 같이 설정 합니다.
호스트 내임 변경
hostnamectl set-hostname blog.visualp.com
호스트 내임 확인
hostname
현재 세션(쉘)에서는 바뀌지 않지만,
재접속 하면 변경된것을 확인 할 수 있습니다.