2018년 11월 25일

mysql 조회시 동일 값 중 가장 빠른 번호를 보

조회시 동일값중 하나를 조회할때..


SELECT article, dealer, price
FROM   shop
WHERE  price=(SELECT MAX(price) FROM shop);


서브쿼리를 수행하면 쉽게 조회가 가능하다. max, min 등등과같이 옵션을 변경하면 되겟다.

2018년 11월 17일

Font Awesone 의 CSS 아이콘 사용하기

아이콘 스타일시트의 CDN 주소를 <head></head> 사이에 넣는다.

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">



아이콘을 쓰려면 아래와 같이 2가지 방식으로 쓸 수 있다.

<i class="fas fa-stroopwafel"></i> <!-- 1) 무료는 fas 와함께 아이콘 이름을 씀 -->
<i class="fas fa-stroopwafel"></i> <!-- <i> 를 쓰거나 -->
<span class="fas fa-stroopwafel"></span> <!-- <span> 을 써서 아이콘 삽입 -->


아이콘의 크기는 fa-xs  ~ fa-10x 까지 설정가능하다

<i class="fas fa-stroopwafel fa-xs"></i>
<i class="fas fa-stroopwafel fa-sm"></i>
<i class="fas fa-stroopwafel fa-lg"></i>
<i class="fas fa-stroopwafel fa-2x"></i>
<i class="fas fa-stroopwafel fa-3x"></i>
<i class="fas fa-stroopwafel fa-5x"></i>
<i class="fas fa-stroopwafel fa-7x"></i>
<i class="fas fa-stroopwafel fa-10x"></i>



아이콘 컬러를 입히려면 span 으로 컬러코드를 주면 된다.

<span style="font-size: 3em; color: Tomato;">
  <i class="fas fa-stroopwafel"></i>
</span>

<span style="font-size: 48px; color: Dodgerblue;">
  <i class="fas fa-stroopwafel"></i>
</span>

<span style="font-size: 3rem;">
  <span style="color: Mediumslateblue;">
  <i class="fas fa-stroopwafel"></i>
  </span>
</span>


아이콘은 회전을 시키거나 flipping(상하좌우 반전)

<div class="fa-4x">
  <i class="fas fa-magic" data-fa-transform="rotate-90" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="rotate-180" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="rotate-270" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="rotate-30" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="rotate--30" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="flip-v" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="flip-h" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="flip-v flip-h" style="background:MistyRose"></i>
</div>


자 이제 사용법은 알았으니 어떤 아이콘을 쓸수있는지 여기서 아이콘 이름을 찾자.

https://fontawesome.com/icons?d=gallery

2018년 11월 11일

CentOS7 apache 에서 .htm .html 파일에서 php 코드 실행하기

일단 경로를 보자면
/etc/httpd/conf/httpd.conf
에 AddType 관련한 설정을 찾아봤는데 php관련 설정은 안보인다.
/etc/httpd/conf.d/php.conf
라고해서 php관련한 설정을 이 파일에 따로 하는것을 알수있었다..
내용이 얼마 안되니까 풀코드를 써보겠다.
아래 부분중 붉은 색부분이 추가된 내용이다.(코드뷰가 색깔을 지가 맘대로 지정해서 붉은색 시가 잘 안난다. 그래서 글자를 키웠다. 큰 글씨가 추가된 부분임.
#
# Allow php to handle Multiviews
#
AddType text/html .php .html .htm

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

# mod_php options
<IfModule  mod_php7.c>
    #
    # Cause the PHP interpreter to handle files with a .php extension.
    #
    <FilesMatch \.(php|phar|htm|html)$>
        SetHandler application/x-httpd-php
    </FilesMatch>

    #
    # Uncomment the following lines to allow PHP to pretty-print .phps
    # files as PHP source code:
    #
    #<FilesMatch \.phps$>
    #    SetHandler application/x-httpd-php-source
    #</FilesMatch>

    #
    # Apache specific PHP configuration options
    # those can be override in each configured vhost
    #
    php_value session.save_handler "files"
    php_value session.save_path    "/var/lib/php/session"
    php_value soap.wsdl_cache_dir  "/var/lib/php/wsdlcache"

    #php_value opcache.file_cache   "/var/lib/php/opcache"
</IfModule>
변경된 설정을 저장하고 아파치 재시작 해주면 끝
systemctl restart httpd

2018년 11월 9일

CentOS7 에서 git 서버 자체서버로 운용하기

yum 으로 git 는 설치한걸로 가정하고 git 를 이해못하는 본인으로써 그냥 명령어들을 하나하나 나열해 보고자 한다.



기본환경에 아래의 경로로 작업을 했다.. 대부분 이와 거의 비슷하리라 본다.

1. CentOS 7 에 git  repository  디렉토리  /home/git/repo/
2. 웹서버에서 실제돌아가는 디렉토리  /home/rhdqn/htdocs/
3. 우리집 윈도우 컴퓨터 디렉토리 d:\home\rhdqn\htdocs\


<CentOS 7> 에서 git 생성 + 웹서버 파일을 git 레포로 집어넣기

1. git계정생성 홈디렉토리가  /home/git/

useradd git

2. git계정 비번 설정

passwd git

3. git 의 bare 만들기   rhdqn.git   라는 디렉토리를 만든다. 디렉토리명으로 git를 쓰는건 보통 git를 만들때 정한 무언의 규칙.

su - git
ssh-keygen -t rsa
mkdir /home/git/repo
mkdir /home/git/repo/rhdqn.git
cd /home/git/repo/rhdqn.git
git init --bare --shared

4.  웹서버 디렉토리로 이동해서 웹파일을 git로 올린다.

su - rhdqn
cd   : 현재위치는 (/home/rhdqn/ ) 가 되겠지
git init
git config --global user.name "name is here"
git config --global user.email "email is here"
git commit -m "first commit" -a
git remote add origin ssh://git@127.0.0.1/home/git/repo/rhdqn.git
git push origin master

5. <윈도우클라이언트> 집에서 쓰는 내 개인용 프로그래밍 할 컴퓨터에서 할 일

git init
git remove add origin ssh://git@www.rhdqn.kr/home/git/repo/rhdqn.git
git pull remote origin master

이후 소스가 수정되면
pull commit push  를 하면서  git 를 사용한다.

추천 게시물

시놀로지 NAS 외부 접속이 안될떄 점검 항목(최종본)

 1. DNS 서버 주소 확인   ☞ DSM의 제어판>네트워크>일반  수동으로 DNS 서버 구성      기본 DNS는 8.8.8.8  대체 DNS는 8.8.4.4 로 설정한다. 2. LAN 포트를 2개 이상 사용할 경우 기본 게이트웨이 확...