728x90

출처

RSA 개인키를 생성

$ openssl genrsa -out private.key 2048
Generating RSA private key, 2048 bit long modulus
....................................+++++
..........+++++
e is 65537 (0x10001)

RSA 개인키를 이용해서 RSA 공개키를 생성

$ openssl rsa -in private.key -pubout -out public.key
writing RSA key

CSR(인증요청서) 생성

$ openssl req -new -key private.key -out private.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:KR
State or Province Name (full name) [Some-State]:_
Locality Name (eg, city) []:Seoul
Organization Name (eg, company) [Internet Widgits Pty Ltd]:bluexmas
Organizational Unit Name (eg, section) []:root CA
Common Name (e.g. server FQDN or YOUR name) []:test.iptime.org
Email Address []:test@test.com
 
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:test
An optional company name []:test

CRT(인증서)만들기

CA 역할을 할 CA 대칭키 생성

$ openssl genrsa -aes256 -out rootCA.key 2048
Generating RSA private key, 2048 bit long modulus
..................................................+++++
....................+++++
e is 65537 (0x10001)
Enter pass phrase for rootCA.key:test
Verifying - Enter pass phrase for rootCA.key:test

rootCA.key를 이용해서 rootCA.pem 생성

$ openssl req -x509 -new -nodes -key rootCA.key -days 2650 -out rootCA.pem
Enter pass phrase for rootCA.key:test
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:KR
State or Province Name (full name) [Some-State]:_
Locality Name (eg, city) []:Seoul
Organization Name (eg, company) [Internet Widgits Pty Ltd]:bluexmas
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:test
Email Address []:test

웹서버에 HTTPS적용을 위해 필요한 CRT 인증서를 생성

$ openssl x509 -req -in private.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out private.crt -days 3650
Signature ok
subject=/C=KR/ST=_/L=Seoul/O=bluexmas/OU=root CA/CN=lastxmas.iptime.org/emailAddress=test@test.com
Getting CA Private Key
Enter pass phrase for rootCA.key:test

C:\usr\local\Apache24\conf\httpd.conf

# Secure (SSL/TLS) connections
Include conf/httpd-ssl.conf

LoadModule rewrite_module modules/mod_rewrite.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule ssl_module modules/mod_ssl.so

C:\usr\local\Apache24\conf\httpd-ssl.conf

#
# When we also provide SSL we have to listen to the 
# standard HTTP port (see above) and to the HTTPS port
#
Listen 443

#   Pass Phrase Dialog:
#   Configure the pass phrase gathering process.
#   The filtering dialog program (`builtin' is an internal
#   terminal dialog) has to provide the pass phrase on stdout.
SSLPassPhraseDialog  builtin

#   Inter-Process Session Cache:
#   Configure the SSL Session Cache: First the mechanism 
#   to use and second the expiring timeout (in seconds).
#SSLSessionCache         "dbm:c:/Apache24/logs/ssl_scache"
SSLSessionCache        "shmcb:C:/usr/local/Apache24/logs/ssl_scache(512000)"
SSLSessionCacheTimeout  300

##
## SSL Virtual Host Context
##

<virtualhost _default_:443="">

#   General setup for the virtual host
# DocumentRoot "C:/usr/local/Apache24/htdocs"
DocumentRoot "C:/usr/local/Apache24/public_html"
ServerName www.example.com:443
ServerAdmin admin@example.com
ErrorLog "C:/usr/local/Apache24/logs/error.log"
TransferLog "C:/usr/local/Apache24/logs/access.log"

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

#   Server Certificate:
#   Point SSLCertificateFile at a PEM encoded certificate.  If
#   the certificate is encrypted, then you will be prompted for a
#   pass phrase.  Note that a kill -HUP will prompt again.  Keep
#   in mind that if you have both an RSA and a DSA certificate you
#   can configure both in parallel (to also allow the use of DSA
#   ciphers, etc.)
#   Some ECC cipher suites (http://www.ietf.org/rfc/rfc4492.txt)
#   require an ECC certificate which can also be configured in
#   parallel.
SSLCertificateFile "C:/usr/local/Apache24/conf/private.crt"

#   Server Private Key:
#   If the key is not combined with the certificate, use this
#   directive to point at the key file.  Keep in mind that if
#   you've both a RSA and a DSA private key you can configure
#   both in parallel (to also allow the use of DSA ciphers, etc.)
#   ECC keys, when in use, can also be configured in parallel
SSLCertificateKeyFile "C:/usr/local/Apache24/conf/private.key"
728x90
728x90

출처

Subversion 플로그인 설치

Deploy to container 플로그인 설치

프로젝트 생성

[새로운 Item] 메뉴 선택

item name(프로젝트 이름) 설정, Freestyle project, [OK] 버튼 선택

Subversion 선택, URL 주소 설정, Svn 접속 계정 추가 

Svn 계정 설정, [Add] 버튼 선택

추가 Svn 주소가 있는 경우, [Add module] 버튼 선택

Subversion 선택, URL 주소 설정

Build에서 [Invoke Ant] 설정

Ant - Target과 빌드 파일 설정

빌드 후 조치(배포), [Deploy war/ear to a container] 선택

베포 웹서버 설정 

728x90
728x90

출처

%TOMCAT_HOME%/conf/tomcat-users.xml

관리자 페이지는 manager-gui 권한의 활성화와 계정 정보가 설정되어야 사용이 가능하므로 %TOMCAT_HOME%/conf/tomcat-users.xml 파일을 열어서 아래와 같이 manager-gui 권한을 추가합니다.

<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
  <user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
  <user username="role1" password="<must-be-changed>" roles="role1"/>
-->
	
	<!-- manager-gui 권한 추가 -->
	<role rolename="manager-gui"/>
	<role rolename="manager-script"/>
	<role rolename="manager-status"/>
	<user username="admin" password="admin" roles="manager-gui,manager-script,manager-status"/>
</tomcat-users>

관리자 페이지 접속

관리자 암호를 설정하고 [로그인] 버튼 선택

관리자 페이지

728x90
728x90

출처

Jenkins war 다운로드

Jenkins 사이트의 war 파일 다운로드

Jenkins war 복사

%TOMCAT_HOME%/warapps 폴더에 jenkins.war 파일 복사

Jenkins 접속

웹브라우져에서 http://localhost:8080/jenkins 접속

Unlock Jenkins

아래 경로에 비밀번호가 적힌 파일(initialAdminPassword)에 적힌 비밀번호를 확인 후 비밀번호를 입력하고, [Continue] 버튼 선택

플로그인 설치

[Install suggested plugins] 선택하고 설치 - 나중에 플러그인을 추가, 삭제 가능

플러그인 설치 과정

사용자 추가

Jenkins URL 정의

Jenkins 실행

Jenkins 설치 관료후 메인 화면

728x90
728x90

출처

UITableView 초기화

class MainViewController: UIViewController {
    
    override func loadView() {
        super.loadView();
        
        self.initWebView(activityIndicator: self.activityIndicator1)
        self.setUrl(hostUrl: MainViewController.url_archim_host, baseUrl: MainViewController.url_archim_base, appUrl: url_archim)
        
        let appDelegate = UIApplication.shared.delegate as! AppDelegate
        //appDelegate.viewController = self
        
        //current_orientation = UIInterfaceOrientationMask.Portrait
        
        // 배경색
        self.navigationController?.navigationBar.barTintColor = UIColor.white
        /*
        // 중앙타이틀
        self.navigationController?.navigationBar.topItem?.title = "중앙타이틀"
        // 좌우 글자색
        self.navigationController?.navigationBar.tintColor = UIColor.red
        // 왼쪽 타이틀
        self.navigationItem.leftBarButtonItem?.title = "왼쪽메뉴"
        */
        
        /*
        // titleView로 사용할 Label을 생성
        var frame = CGRect(x: 0, y: 0, width: 200, height: 21)
        let label = UILabel(frame: frame)
        label.text = "이것을 타이틀로 사용합니다"
        // viewController의 titleView를 생성한 Label로 셋업
        self.navigationController?.navigationBar.topItem?.titleView = label
        */
        
        // 중앙
        // let logo = UIImage(named: "main_logo.png")
        let logo = Utiltiy.resizeImage(image: UIImage(named: "main_logo.png")!, targetSize: CGSize(width: 140, height: 32))
        let imageView = UIImageView(image: logo)
        self.navigationItem.titleView = imageView
        
        //
        let leftBarItemImage = Utiltiy.resizeImage(image: UIImage(named: "main_gnb.png")!, targetSize: CGSize(width: 50, height: 50))
        self.navigationItem.leftBarButtonItem?.tintColor = UIColor(rgb: 0x636363)
        self.navigationItem.leftBarButtonItem?.image = leftBarItemImage;
        self.navigationItem.leftBarButtonItem?.imageInsets = UIEdgeInsets(top: 0, left: -18, bottom: 0, right: 0)
        
        //
        let rightBarItemImage = Utiltiy.resizeImage(image: UIImage(named: "main_list.png")!, targetSize: CGSize(width: 50, height: 50))
        self.navigationItem.rightBarButtonItem?.tintColor = UIColor(rgb: 0x636363)
        self.navigationItem.rightBarButtonItem?.image = rightBarItemImage;
        self.navigationItem.rightBarButtonItem?.imageInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: -18)
 
        /*
        // setTitlePositionAdjustment 함수 호출
        self.navigationItem.leftBarButtonItem?.setTitlePositionAdjustment(UIOffset(horizontal: 30, vertical: 30), for: UIBarMetrics.compact)
        */
        
        /*
        // UIBarButtonItem 추가
        // http://mtsparrow.blogspot.com/2016/01/blog-post.html
        let leftTarget = self.navigationItem.leftBarButtonItem?.target
        let leftAction = self.navigationItem.leftBarButtonItem?.action
        let leftButton = UIBarButtonItem(image: UIImage (named: "main_gnb.png"), style: UIBarButtonItem.Style.plain, target: leftTarget, action: leftAction)
        let negativeSpacer = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
        negativeSpacer.width = -16
        //self.navigationItem.leftBarButtonItem = logo2
        self.navigationItem.setLeftBarButtonItems([negativeSpacer, leftButton], animated: false)
        */
    }

UITableViewController - Row 선택

    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        
        // 선택된 index 순서 출력
        // print(indexPath.row)
        
        let cell = super.tableView(tableView, cellForRowAt: indexPath) as! UITableViewVibrantCell
        
        if case cell.reuseIdentifier = "menu_quality" {
            let storyboard = UIStoryboard(name : "MainStoryboard_iPhone", bundle : nil)
            let nextViewController = storyboard.instantiateViewController(withIdentifier: "TabBarController") as! NiaspMainViewController
            self.present(nextViewController, animated: true, completion: nil)
        }
    }

uitableview에서 cell클릭시 다음 view로 데이터 넘기기

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        let vc = segue.destination as! infoPUBG_kind
        //vc.value2 = value
        let cell = sender as! UITableViewCell
        let indexPath = tableView.indexPath(for: cell)
        vc.kindTitle = infoList[(indexPath?.row)!]//내가누른 cell의 text
        vc.kindRow = (indexPath?.row)!//내가누른 cell의 row값
    }

SideMenu

SideMenuNavigationController.swift

@objcMembers
open class SideMenuNavigationController: UINavigationController {

SideMenuManager

@objcMembers public class SideMenuManager : NSObject {

    @objc public enum PresentDirection : Int {

        case left

        case right
    }

    /// Default instance of SideMenuManager.
    public static let `default`: SideMenu.SideMenuManager

    /// Default instance of SideMenuManager (objective-C).
    public class var defaultManager: SideMenu.SideMenuManager { get }

    /// The left menu.
    open var leftMenuNavigationController: SideMenu.SideMenuNavigationController?

    /// The right menu.
    open var rightMenuNavigationController: SideMenu.SideMenuNavigationController?

    /**
         Adds screen edge gestures for both left and right sides to a view to present a menu.
    
         - Parameter toView: The view to add gestures to.
    
         - Returns: The array of screen edge gestures added to `toView`.
         */
    public func addScreenEdgePanGesturesToPresent(toView view: UIView) -> [UIScreenEdgePanGestureRecognizer]

    /**
        Adds screen edge gestures to a view to present a menu.
        
        - Parameter toView: The view to add gestures to.
        - Parameter forMenu: The menu (left or right) you want to add a gesture for.
    
        - Returns: The screen edge gestures added to `toView`.
        */
    public func addScreenEdgePanGesturesToPresent(toView view: UIView, forMenu side: SideMenu.SideMenuManager.PresentDirection) -> UIScreenEdgePanGestureRecognizer

    /**
     Adds a pan edge gesture to a view to present menus.
     
     - Parameter toView: The view to add a pan gesture to.
     
     - Returns: The pan gesture added to `toView`.
     */
    public func addPanGestureToPresent(toView view: UIView) -> UIPanGestureRecognizer
}

extension SideMenuManager {

    @available(*, deprecated, renamed: "leftMenuNavigationController")
    open var menuLeftNavigationController: SideMenu.SideMenuNavigationController?

    @available(*, deprecated, renamed: "rightMenuNavigationController")
    open var menuRightNavigationController: SideMenu.SideMenuNavigationController?

SideMenu 버튼 클릭 이벤트

import SideMenu

class SideMenuTableViewController: UITableViewController {

    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        
        print(indexPath.row)
        
        if case indexPath.row = 3 {
            //SettingsMainViewController *comChange = [[SettingsMainViewController alloc] init];
            //[self.navigationController pushViewController:comChange animated:NO];
            //var comChange : SettingsMainViewController
            
            /*
            let storyboard : UIStoryboard = self.storyboard!
            let nextView = storyboard.instantiateViewController(identifier: "MainStoryboard_iPhone")
            self.present(nextView, animated: true, completion: nil)
            */
            
            let storyboard = UIStoryboard(name : "MainStoryboard_iPhone", bundle : nil)
            let nextView = storyboard.instantiateInitialViewController()
            self.present(nextView!, animated: true, completion: nil)
        }
    }

SideMenuNavigationControllerDelegate

extension MainViewController: SideMenuNavigationControllerDelegate {
    
    func sideMenuWillAppear(menu: SideMenuNavigationController, animated: Bool) {
        print("SideMenu Appearing! (animated: \(animated))")
    }
    
    func sideMenuDidAppear(menu: SideMenuNavigationController, animated: Bool) {
        print("SideMenu Appeared! (animated: \(animated))")
    }
    
    func sideMenuWillDisappear(menu: SideMenuNavigationController, animated: Bool) {
        print("SideMenu Disappearing! (animated: \(animated))")
    }
    
    func sideMenuDidDisappear(menu: SideMenuNavigationController, animated: Bool) {
        print("SideMenu Disappeared! (animated: \(animated))")
    }
}

activeDelegate (SideMenuNavigationController.swift)

@objcMembers
open class SideMenuNavigationController: UINavigationController {

    /// Delegate for receiving appear and disappear related events. If `nil` the visible view controller that displays a `SideMenuNavigationController` automatically receives these events.
    public weak var sideMenuDelegate: SideMenuNavigationControllerDelegate?

... 생략 ...

private extension SideMenuNavigationController {

    weak var activeDelegate: SideMenuNavigationControllerDelegate? {
        guard !view.isHidden else { return nil }
        if let sideMenuDelegate = sideMenuDelegate { return sideMenuDelegate }
        return findViewController as? SideMenuNavigationControllerDelegate
    }

    var findViewController: UIViewController? {
        foundViewController = foundViewController ?? presentingViewController?.activeViewController
        return foundViewController
    }



728x90
728x90

안드로이드 환경 설정

메뉴 [Edit] > [Preferences...] 선택

Preferences 창의 [External Tools]에서 JDK, Android SDK, Android NDK 경로 설정 

안드로이드 빌드

메뉴 [File] > [Build Settings...] 선택

Scenes In Build 창의 [Android]에서 버튼[Build And Run] 선택해서 빌드및 설치

728x90
728x90

출처

Docker for Windows 다운로드

https://docs.docker.com/docker-for-windows/install/#download-docker-for-windows

Docker for Windows 설치

Docker for Windows 설치 프로그램 실행

[Install Update]버튼 선택

설치가 완료 되면 hosts 파일이 변경 됩니다.

Windows 하단 오른쪽 작업표시줄에서 Docker 아이콘을 오늘쪽 마우스를 눌러 팝업 메뉴에서 [Kitematic] 메뉴 선택

Kitematic가 설치 되어 있지 않으면 아래와 같이 다운로드 창에서 [Download] 버늩 선택

다운로드 받은 파일 Kitematic-Windows.zip 압축을 풀어서 C:\Program Files\Docker\Kitematic에 복사

다시 Kitematic를 실행해서 기존에 아이디가 있으면 로그인은 하거나 아이디가 없으면 [Sign Up]을 선택해서 계정을 생성

[ubuntu-upstart] 이미지의 [Create] 버튼을 선택해서 Ubuntu 생성

[EXEC] 버튼을 선택해서 Shell 실행




이미지 다운로드

docker run -it -p 6006:6006 -p 2222:22 -v "pwd":/Japanese-Character-Recognition -w /Japanese-Character-Recognition tensorflow/tensorflow:1.1.0 bash

Docker 파일 복사

PC에서 Host로 파일 복사

docker container cp D:/Data.OCR/ETL/ETL1.zip compassionate_perlman:/ETL1.zip

Host에서 PC로 파일 복사

docker container cp compassionate_perlman:/Japanese-Character-Recognition/Japanese-Character-Recognition/model.pb D:/Data.OCR/ETL/

728x90
728x90

[허교수의 ARM Mbed 프로그래밍 입문 리뷰] 이벤트로 도서를 받았습니다.


마이크로비트 오프라인 컴파일로 처음 Mbed를 접하게 되면서,

기초부터 배우고 싶었는데, 이 도서의 출판과 이벤트에 당첨되어 리뷰를 작성합니다.

Mbed의 기초(실행방법부터 컴파일, 설치까지)부터 각종 통신방법(디지탈I/O, 아두이노I/O, UART, I2C)과 각종 센서의 동작 원리와 작동 방법까지 자세히 설명되어 있어 기초부터 실정에 필요한 내용이 이 책하나에 다 있습니다.

기초부터 시작하시는 처음 배우시는 분도, 기존에 하셨분들도 필요한 부분만 찾아서 보셔도 챕터별로 정리가 잘되서 있어 좋은 책인것 같습니다.

이 책은 4단계로 나누어져서 설명이 되어 있는데,

1단계는 "Mbed소개"로 ARM프로세서의 소개 및 역사, Mbed가 지원하는 보드의 소개, Mbed의 컴파일과 누클레오 보드에 설치하는 방법이 나와있습니다.

2단계는 "기본 프로그래밍"에서는 MbedAPI, 디지털 I/O, UART 시리얼 통신, 아나로그, PWM 출력, SPI 통신, I2C 통신 방법이 원리부터 설명이 되어 있고,

3단계는 "주변장치 프로그래밍"에서는 블루투스, 로터리 인코더, 온습도 센서, 초음파 거리센서, 릴레이, 텍스트 LCD, RTC, DC모터 서보모터제어가,

4단계는 "고급 프로그래밍"에서는 RTOS-멀티스레드, 누클레오-우두이노 UART 통신이 설명 되어 있습니다.  

이 책에서 사용하는 누클레오 보드는 국내 쇼핑몰의 경우 외국에서 배송되는 것이라서 배송이 일주일정도 걸려서, 중고나라에서 1만원 주고 구입했습니다.

728x90

+ Recent posts