2020년 12월 8일 화요일

Chrome - 크롬에서 웹페이지 전체 캡쳐 (Feat.사이즈 변경)

 

개발자 도구 열기

캡쳐를 하기 위해서는 개발자 도구를 열어야 합니다.

주소창 오른쪽에 있는 버튼을 누르고

도구 더보기 -> 개발자 도구를 눌러줍니다. Ctrl+ Shift + I를 누르거나 F12를 눌러도 됩니다.

커멘트창 열고 캡쳐하기

그 상태에서 Ctrl + Shift + P를 누르면 위와 같이 커멘트 창이 나오게 됩니다

Capture full size screenshot 라고 커멘트를 쳐주고 과감하게 엔터를 눌러줍니다.


사이즈 변경

캡쳐는 다양한 사이즈로도 가능합니다. 다양한 사이즈라는 말은 모바일 기기에서 본것처럼 보고 캡쳐할 수 있다는 말입니다.

아까 열어놓은 개발자 도구에서 저 핸드폰 기기처럼 생긴걸 누릅니다.

모바일 기기에서 본 것처럼 변해 있습니다. 가로 길이가 줄어들어서 컴퓨터에서 볼때와는 다르게 태그 메뉴가 사라졌네요.

기존에 있는 기기에서 해상도를 바꿀수도 있고 숫자를 바꿔서 원하는 사이즈로 설정도 가능합니다.

마지막으로 커멘트 창을 이용해서 캡쳐를 하면 모바일 기기에서 캡쳐한것처럼 캡쳐가 가능합니다.



[출처] https://steemit.com/kr/@debugger.break/k8obv

2020년 10월 23일 금요일

windows10 정품인증 마크 없애기 free

 

1. 현재 사용하고 있는 버전명에 해당하는 kms 클라이언트 시디키/제품키를 복사해 메모장에 붙여넣기 합니다.

 윈도우 버전

 KMS 클라이언트 정품 시디키

 Windows 10 Pro 

 W269N-WFGWX-YVC9B-4J6C9-T83GX

 Windows 10 Pro N

 MH37W-N47XK-V7XM9-C7227-GCQG9

 Windows 10 Home

 TX9XD-98N7V-6WMQ6-BX7FG-H8Q99

 Windows 10 Home N

 3KHY7-WNT83-DGQKR-F7HPR-844BM

 Windows 10 Enterprise

 NPPR9-FWDCX-D2C8J-H872K-2YT43

 Windows 10 Enterprise

 DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4

 Windows 10 Education

 NW6C2-QMPVW-D7KKK-3GKT6-VCFB2

 Windows 10 Education KN

 2WH4N-8QGBV-H22JP-CT43Q-MDWWJ


** 해당 제품키는 마이크로소프트 공식 홈페이지에서 클라이언트 정품인증을 위해 제공되는 CD키 입니다. 





윈도우10 명령 프롬프트 실행하는 방법

2. [윈도우버튼 - 검색창에 CMD 입력 - 명령 프롬프트 마우스 우 클릭 - 관리자 권한으로 실행]





윈도우10 kMS 클라이언트 제품키 입력하기

slmgr /ipk *****-*****-*****-*****-*****


ex) slmgr /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX


3. 좀전에 메모장에 복사한 제품키 앞을 위와같은 형태로 만든 다음 CMD 창에 입력합니다. 





윈도우10 KMS 서버주소 입력하기

slmgr /skms kms.digiboy.ir 

or

slmgr /skms kms8.msguides.com


4. 위 두가지 코드중 맘에드는 명령어를 복사해 입력합니다. 





윈도우10 정품인증 활성화 시키기

slmgr /ato 

5. 위 명령어 입력 [엔터 - 확인]을 클릭합니다.


6. 제품에 대한 정품인증을 받았습니다. 라고 나오면 제대로 정품인증이 완료된 상태입니다 이제 X를 클릭해 명령 프롬프트창을 종료 시킵니다. 

 - 마크가 안없어졌다면 오류가 있는 상태...

2020년 10월 15일 목요일

SVN commit hook connect JIRA - Add Comment(Only My Brain-fficial)

 

have following software installed

1. jira 다운 및 설치

링크 - https://www.atlassian.com/ko/software/jira/download

 - start jira server[8080] 으로 서벼 켜놓고 localhost:8080 으로 접속

 - 설치 후 jira 계정 생성 및 프로젝트 생성에서 대충 이슈 만들어서 세팅


2. VisualSVN server 다운 및 설치.

Visual SVN Server Download

https://www.visualsvn.com/server/download/


2 - 1. repository 생성

- 생성 하면 백업 폴더에 hooks 폴더 생성 되어있음.

참고 - https://www.visualsvn.com/server/getting-started/

create ex) 빨간 박스는 밑에 과정에서 생긴 파일들.



3. php 다운 및 설치 (perl 방식도 있으나 안해봄) - OS종류 잘 보고 따라할것.

 - https://www.lesstif.com/software-architect/svn-hook-commit-jira-17105782.html

 - 위 링크와 같도록 셋팅. (cmd 창 이미지는 기존 svn으로 사용하듯이 commit 해도 됨)

 - 정규식 관련 자료 - https://regexr.com/
    (나도 잘 모르므로 검색하시길..)


4. JIRA REST API v2 Document

 - https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-comments/#api-rest-api-2-issue-issueidorkey-comment-post

 - 위 링크에서 필요한 정보들 찾아서 추가 및 수정. (본인은 add comment 만 추가한 상태)


-------------- only my example codes ---------------


pre-commit.cmd

- .bat file

Copy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 echo start 1>&2 echo message 1>&2 echo : %MESSAGE% 1>&2 for /f "tokens=* USEBACKQ" %%i in (`svnlook log %1 -t %2`) do ( set "RESULT=%%i" ) echo "%RESULT%" 1>&2 :: ex ) "C:/Program Files/PHP/v7.2/php.exe" -n C:/Repositories/HookTest/hooks/pre-commit.php %1 %2 "%RESULT%" php "%1\hooks\pre-commit.php" "%1" "%2" "%RESULT%"

 - comment 부분 utf-8로 넘기는 작업



pre-commit.php

 - commit hook php file

Copy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 #!/usr/bin/env php <?php require_once 'jira_comment.php'; ////// ini 에서 가져온 값들 ////////// $configVars = parse_ini_file('myconfig.ini', TRUE); $username = $configVars['Account']['username']; $password = $configVars['Account']['password']; $jiraURL = $configVars['Address']['url']; $jiraURL_Issue = $configVars['Address']['url_issue']; //////////////////////////////////// # comment 가 4자 미만이면 커밋 거부 $minchars = 4; $svnlook = 'svnlook'; #-------------------------------------------- $repos = $argv[1]; $txn = $argv[2]; $comment = $argv[3]; #$comment = `$svnlook log -t "$txn" "$repos"`; $comment_temp = $comment; $comment = chop($comment); //공백제거. if ( strlen($comment) == 0 ) { fwrite(STDERR, "---------------------------------------------------------------------------\n"); fwrite(STDERR, "Your commit has been blocked because it didn't include a log message.!\n"); fwrite(STDERR, "Do the commit again, this time with a log message that describes your changes.!\n"); fwrite(STDERR, "---------------------------------------------------------------------------\n"); exit(1); } else if ( strlen($comment) < $minchars ) { fwrite(STDERR, "---------------------------------------------------------------------------\n"); fwrite(STDERR, "Comment must be at least $minchars characters. : $comment\n"); fwrite(STDERR, "---------------------------------------------------------------------------\n"); exit(1); } ## 커밋 메시지에 Jira issue keys 가 들어 있는지 확인 #$pattern = '/(?P<prj>[0-9a-zA-Z]{1,10})-{1,10}(?P<inum>[0-9]+):(?P<comm>[\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]{0,1000})+/u'; $pattern = '/(?P<prj>[0-9a-zA-Z]{1,10})-{1,10}(?P<inum>[0-9]+)/'; #$pattern = '/[^0-9a-zA-Z]?(?P<prj>[0-9A-Za-z]{1,10})-{1,10}(?P<inum>[0-9]+)./'; #$pattern = '/\w?(?P<prj>\w{1,10})-\d(?P<inum>\d{1,10})./'; $matches = 0; if (!preg_match($pattern, $comment, $matches)) { fwrite(STDERR, "---------------------------------------------------------------------------\n"); fwrite(STDERR, "Comment must match JIRA-ISSUE-KEY!!! \"$comment\"\n"); fwrite(STDERR, print_r($matches,TRUE)); fwrite(STDERR, "---------------------------------------------------------------------------\n"); exit(1); } $issue_key = $matches["prj"] . "-" . $matches["inum"]; #$comment_key = $matches["comm"]; $strLength = mb_strlen($issue_key) + 1; $comment_key = mb_substr($comment_temp,$strLength); ## jira issue key 가 존재하는지 JIRA REST API 로 확인. // ini 로 변경. #$ch = curl_init("http://localhost:8080/rest/api/2/issue/"); #$url = "http://localhost:8080/rest/api/2/search/"; /////////////// curl 날리는 방식 ///////////////////// /* ( $ch = curl_init(); $data = array("jql" => "issuekey=$issue_key","maxResults" => 5); $json_string = json_encode($data); curl_setopt($ch, CURLOPT_URL, $jiraURL); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_VERBOSE, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-type: application/json", 'Content-Length: ' . strlen($json_string) )); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $json_string); $result = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); $response = json_decode($result); if ($response == NULL or property_exists ($response,"errorMessages")) { fwrite(STDERR, "Error! " . ($response == NULL ? "Request failed" : $response->errorMessages[0]) . "\n"); exit(1); } else { var_dump($response); } ) */ ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////// jira issue 관련 //////////////////////////////////////////////////////// $url_issue = $jiraURL_Issue.$issue_key; $url_comment = $url_issue.'/comment'; JiraComment::BaseAuth($username, $password); JiraComment::GetIssueFromIssuekey($url_comment, $issue_key); JiraComment::AddIssueComment($url_comment, $comment_key); ######################## 로 그 찍 어 보 는 공 간 ( 에러 났을때 )######################## fwrite(STDERR , "------------------------------------------------------------------------\n"); fwrite(STDERR , "Comment - \"$comment\"\n"); fwrite(STDERR , "------------------------------------------------------------------------\n"); fwrite(STDERR , "Issue Key - \"$issue_key\"\n"); fwrite(STDERR , "------------------------------------------------------------------------\n"); fwrite(STDERR , "Comment key - \"$comment_key\"\n"); fwrite(STDERR , "------------------------------------------------------------------------\n"); fwrite(STDERR, print_r($matches,TRUE)); fwrite(STDERR , "------------------------------------------------------------------------\n"); fwrite(STDERR , print_r($data,TRUE)); fwrite(STDERR , "------------------------------------------------------------------------\n"); fwrite(STDERR , "json string - \" $json_string\"\n"); fwrite(STDERR , "------------------------------------------------------------------------\n"); fwrite(STDERR , "code - \" $code\"\n"); fwrite(STDERR , "------------------------------------------------------------------------\n"); fwrite(STDERR , "result - \" $result\"\n"); fwrite(STDERR , "------------------------------------------------------------------------\n"); ##################################################################################### exit(0); ?>



jira_comment.php

 - pre-commit jira support php file (feat.unirest)

Copy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 <?php require_once 'C:\Users\ldy\Documents\unirest-php-master\src\Unirest.php'; class JiraComment { ////////jira 기본 인증. public static function BaseAuth($username, $password) { Unirest\Request::auth($username, $password); } ////////이슈 정보 get. public static function GetIssueInfo($issueURL, $issueKey) { $headers = array( 'Accept' => 'application/json', ); $response = Unirest\Request::get( $issueURL.$issueKey, $headers ); if ($response == NULL or property_exists ($response,"errorMessages")) { fwrite(STDERR, "===============================================\n"); fwrite(STDERR, "Error! GetIssueInfo - " . ($response == NULL ? "Request failed" : $response->errorMessages[0]) . "\n"); fwrite(STDERR, "===============================================\n"); exit(1); } else { var_dump($response); } } ////////이슈에 댓글 정보 get. public static function GetIssueCommentsInfo($issueCommnetURL) { $headers = array( 'Accept' => 'application/json', ); return Unirest\Request::get( $issueCommnetURL, $headers ); } ////////이슈키에 맞는 댓글 정보 get. public static function GetIssueFromIssuekey($issueCommnetURL, $issuekey) { $headers = array( 'Accept' => 'application/json', ); $response_getcomment = Unirest\Request::get( $issueCommnetURL, $headers ); //입력한 이슈 키에 대한 이슈를 못가져 왔다면 error. if($response_getcomment->code != 200) { fwrite(STDERR, "===============================================\n"); fwrite(STDERR, "== Comment must match JIRA-ISSUE-KEY!!!!!!!!!!!!!! \"$issuekey\"\n"); fwrite(STDERR, "===============================================\n"); exit(1); } else { var_dump($response_getcomment); } } ////////이슈키에 맞는 이슈에 댓글 add. public static function AddIssueComment($issueCommnetURL, $comment) { $headers = array( 'Accept' => 'application/json', 'Content-Type' => 'application/json; charset=utf-8', ); /*$body = <<<REQUESTBODY { /////// 관리자전용 댓글 달수있게하는 옵션 ////////// "visibility": { "type": "role", "value": "Administrators" }, ////////////////////////////////////////////////// "body": "{$comment_key}" } REQUESTBODY; */ $body = <<<REQUESTBODY { "body": "{$comment}" } REQUESTBODY; $response = Unirest\Request::post( $issueCommnetURL, $headers, $body ); if ($response == NULL or property_exists ($response,"errorMessages")) { fwrite(STDERR, "===============================================\n"); fwrite(STDERR, "Error! AddIssueComment - " . ($response == NULL ? "Request failed" : $response->errorMessages[0]) . "\n"); fwrite(STDERR, "===============================================\n"); exit(1); } else { var_dump($response); } } } ?>


위 코드 사용시 Unirest관련 not found error 발생.

https://github.com/Kong/unirest-php

- 위 링크에서 받아서 압축 해제 후 php 코드 맨 위에 삽입.

require_once '/path/to/unirest-php/src/Unirest.php';

( jira_comment.php 상단에 있음 )


myconfig.ini

- ini file

Copy
1 2 3 4 5 6 7 8 9 ; My Account Setting [Account] username="jira-id" password="jira-password" ; Jira Address Setting [Address] url="http://'jira url'/rest/api/2/search/" url_issue = "http://'jira url'/rest/api/2/issue/"



- 번 외 -

jira-subversion-plugin

 - https://github.com/kashak88/jira-subversion-plugin/blob/master/atlassian-jira-subversion-plugin-3.0.2-jira8.jar

(jira8 에서 사용가능한 plugin - 설치는 되나 작동하는지 확인은 안됨)