생각하는 족족 고.따.구 냐..

Posted
Filed under About Knowledge/Dev_OPS
git저장소에 self-signed ssl 인증서를 사용하려면 verify기능을 비활성해야 합니다.

1. Command Line에서 수행
GIT_SSL_NO_VERIFY=true git clone http://url ./
 -
GIT_SSL_NO_VERIFY=true : ssl verify비활성
 - git clone http://url : url서버에서 clone
 - ./ : 현재 디렉토리에 소스 복사

2. Config 설정
git config --global http.sslVerify false
 - git config : config 설정
 - --global: 전역 설정, --local으로 할 경우 프로젝트 단위 설정
 -
http.sslVerify false : verify 비활성

3. 로그인정보 저장
git config credential.helper 'store'  <== disk에 영구저장 (계정정보 노출위험)
git config credential.helper 'cache'  <== 메모리에 일시저장
2020/03/10 21:51 2020/03/10 21:51
Posted
Filed under About Knowledge/Dev_OPS
;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(setq inhibit-splash-screen t)
(setq inhibit-startup-message t)
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                    (not (gnutls-available-p))))
       (proto (if no-ssl "http" "https")))
  (when no-ssl
    (warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
2. Remove this warning from your init file so you won't see it again."))
  ;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
  (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
  ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
  (when (< emacs-major-version 24)
    ;; For important compatibility libraries like cl-lib
    (add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
      
;; line number mode select one of below$$$$$$$
(global-linum-mode t)
(global-display-line-numbers-mode)
(setq line-number-mode t)
;;$$$$$$$$$$$$$$$$$$$$$$$$$$

(setq column-number-mode t)
(add-hook 'window-configuration-change-hook (lambda () (ruler-mode 1)))
(setq-default indent-tabs-mode nil)
(global-set-key [(control kanji)] 'set-mark-command)
(global-set-key [(control ?h)] 'delete-backward-char)
(setq default-buffer-file-coding-system 'utf-8)
(set-language-environment "UTF-8")
(setq default-input-method "korean-hangul")
;;(setq scroll-margin 1
;;scroll-conservatively 0
;;scroll-up-aggressively 0.01
;;scroll-down-aggressively 0.01)
(autoload 'markdown-mode "markdown-mode"
   "Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
(autoload 'gfm-mode "markdown-mode"
   "Major mode for editing GitHub Flavored Markdown files" t)
(add-to-list 'auto-mode-alist '("README\\.md\\'" . gfm-mode))
(add-to-list 'load-path "~/.emacs.d/elpa/hydra-0.14.0")
(add-to-list 'load-path "~/.emacs.d/elpa/vdiff-0.2.3")
 
(add-to-list 'load-path "~/.emacs.d/lisp/neotree")
(require 'neotree)
(global-set-key [f8] 'neotree-toggle)
(setq neo-smart-open t)
(setq projectile-switch-project-action 'neotree-projectile-action)
(defun neotree-project-dir ()
    "Open NeoTree using the git root."
    (interactive)
    (let ((project-dir (projectile-project-root))
          (file-name (buffer-file-name)))
      (neotree-toggle)
      (if project-dir
          (if (neo-global--window-exists-p)
              (progn
                (neotree-dir project-dir)
                (neotree-find file-name)))
(message "Could not find git project root."))))
;;(setq neo-theme 'icons)
;;(setq neo-theme (if (display-graphic-p) 'icons 'arrow))
(setq-default indent-tabs-mode nil)
(setq tab-width 2)
(setq-default tab-width 2)
(setq c-basic-offset 2)
(setq tab-stop-list '(2 4 6 8 10 12 14 16 18))
(add-hook 'json-mode-hook
          (lambda ()
            (make-local-variable 'js-indent-level)
            (setq js-indent-level 2)))
(setq js-indent-level 2)
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-enabled-themes (quote (solarized-dark)))
 '(custom-safe-themes
   (quote
    ("0598c6a29e13e7112cfbc2f523e31927ab7dce56ebb2016b567e1eff6dc1fd4f" default)))
 '(package-selected-packages
   (quote
    (all-the-icons-ivy all-the-icons-dired all-the-icons-gnus all-the-icons djvu diffview json-mode tree-mode solarized-theme))))
(show-paren-mode 1)
(setq show-paren-delay 0)
2019/08/02 22:33 2019/08/02 22:33
Posted
Filed under About Knowledge/Dev_OPS
https://wiki.jenkins.io/display/JENKINS/Grant+Cancel+Permission+for+user+and+group+that+have+Build+permission



Purpose

This script is developed for JENKINS-14713.
Pre JENKINS-14713, Build permission implicitly grants Cancel permission; post JENKINS-14713, all user/group granted Build permission will lose Cancel permission unless Cancel permission has been given explicitly. This is a configuration incompatibility and can cause few dev start jumping up and down.
This script will help Jenkins admin grant Cancel Permission to everyone that has Build permission, therefore maintain the configuration compatibility.

Overview

This script will go through all groups and users in both Global security and per job security settings.
If the group/user has Build permission, Cancel permission will also be granted. If the user/group has Cancel permission already, it's a NOOP.
This script doesn't require JENKINS-14713 to be run.
Pre JENKINS-14713, this script is NOOP

I actually recommend you to run the script before you apply patch for JENKINS-14713, so you are can change and review your ACL setting without any impact to user.

It can also be easily modified for generic Permission bulk changes.

Usage

  • go to your Jenkins - > Manage Jenkins - > Script Console
  • copy and paste the code snippet from next section
  • review it and click Run, this will be a dryrun by default
  • follow the output to make real change

Code

import hudson.security.*
import jenkins.security.*
import jenkins.model.Jenkins
 
 
boolean dryrun=true
 
if (dryrun) {
  println ''.center(100,'!')
  println 'This is a dryrun, nothing will be changed'.center(100,'!')
  println 'Change this line: boolean dryrun=false to boolean dryrun=true to make the real change'.center(100,'!')
  println ''.center(100,'!')
}
 
switch (Jenkins.instance.authorizationStrategy){
  case GlobalMatrixAuthorizationStrategy:
    println '\nGlobal Matrix Strategy defined. Fixing Cancel permissions...\n'
    def sids = Jenkins.instance.authorizationStrategy.getAllSIDs().plus('anonymous')
    for (sid in sids){
      if (Jenkins.instance.authorizationStrategy.hasPermission(sid,hudson.model.Item.BUILD)){
        println '----'+sid+' has Build permission and Cancel permission will be add'
        if (!dryrun) Jenkins.instance.authorizationStrategy.add(hudson.model.Item.CANCEL,sid)
      }
    }
    if (!dryrun) Jenkins.instance.save()
  case ProjectMatrixAuthorizationStrategy:
    println '\nProject Matrix Strategy defined. fixing Cancel permissions...\n'
    def jobs = Jenkins.instance.items
    jobs.each {
      println it.name.center(80,'-')
      def authorizationMatrixProperty = it.getProperty(AuthorizationMatrixProperty.class)
      def sids = authorizationMatrixProperty?.getAllSIDs().plus('anonymous')
      for (sid in sids){
        if (authorizationMatrixProperty?.hasPermission(sid,hudson.model.Item.BUILD)){
          println ''+sid+' has Build permission and Cancel permission will be add'
          if (!dryrun) authorizationMatrixProperty?.add(hudson.model.Item.CANCEL,sid)
        }
      }
      if (!dryrun) it.save()
    }
    break
  default:
    println "No permission need to be mofdified gloabally"
    break
}
 
return

Disclaimer

The script is developed, tested and applied on Jenkins LTS 1.509.2. Use at your own risk!

2019/05/21 21:55 2019/05/21 21:55
Posted
Filed under About Knowledge/Dev_OPS

1) submodule 설정 파일에서 삭제
.gitmodules 에서 모듈 제거

2) git 캐시 삭제
git cached -- rm {path to, and submodule}.

3) deinit
git submodule deinit {sub module}

4) 서브모듈 파일 설정 삭제
rm -rf ./.git/modules/{sub module}

 

5) 파일 삭제
rm -rf {path to, and submodule}.

2019/03/12 12:19 2019/03/12 12:19