Study/Bookmark2021. 2. 3. 16:09
Study/Tip & Tech2020. 10. 6. 14:30

1. 유휴 시간 확인 (변경 전)

cmd > net config server

유휴 세션 시간(분) 15 <= 15분

 

2. 자동 끊기 해제

cmd > net config server /autodisconnect:-1

 

3. 유휴 시간 확인 (변경 후)

cmd > net config server

유휴 세션 시간(분) -1

 

bigmark.tistory.com/82

 

네트워크 드라이브 연결 끊김 해결방안

네트워크 드라이브 연결 끊김 현상에대한 해결방안을 공유하고자 합니다. 현재 업무상 타PC에 대한 공유폴더를 생성하여 사용하고 있는데요. 네트워크 드라이브 연결끊김 현상이 자주 발생하�

bigmark.tistory.com

 

4. 네트워크 드라이버 연결 해제 및 강제 연결

net use M: /d

net use M: \\192.168.1.111\data "your_password" /user:your_id /persistent:no

Posted by 굥쓰
카테고리 없음2020. 9. 17. 14:05

Web API 프로젝트에 Swagger 을 적용한 뒤에 Parameter 에 대한 설명등을 추가하려면 별도의 작업이 필요합니다.

이를 위해 XML 관련 설정을 추가해 주고 소스 코드에 주석을 달면

이를 자동화해서 도움말에 설명도 추가 할 수 있습니다.

Startup.cs 의 ConfiguraServices 메소드에 아래 내용을 적용 후

#region Locate the XML file being generated by ASP.NET...
                var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.XML";
                var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);

                //... and tell Swagger to use those XML comments.
                c.IncludeXmlComments(xmlPath);
                #endregion

Controller 구현부에 아래와 같은 ///주석을 통해 설명을 추가합니다.

        /// <summary>
        /// Create Templete
        /// </summary>
        /// <remarks>
        /// Request Body : {"uId":"아이디","charId":"캐릭터ID","name":"이름"}
        /// </remarks>
        /// <param name="uId">아이디</param>
        /// <param name="charId">캐릭터ID</param>
        /// <param name="name">이름</param>
        /// <returns>A serialized json string</returns>
        [HttpPost]
        [Produces("application/json")]
        [ProducesResponseType(StatusCodes.Status201Created)]
        [ProducesResponseType(StatusCodes.Status400BadRequest)]
        [Route("CreateTemplate")]
        public ActionResult CreateTemplate()
        {
            /// body
        }

소스 코드에 적용한 주석은 아래와 같은 형태로 설명 문서에 적용됩니다.

exceptionnotfound.net/adding-swagger-to-asp-net-core-web-api-using-xml-documentation/

Posted by 굥쓰
Study/ASP.NET MVC & Core2020. 9. 16. 14:33

API 구현 하면서 문서화에 대한 부분은 고민이 많은데 Swagger 를 적용하면 몇 라인의 코드 적용만으로도

문서화 및 디버깅까지 가능한 훌륭한 구조를 프로젝트에 포함 시킬 수 있는 장점이 있습니다.

 

1. 구현 미리보기

2. Nuget 패키지 관리에서 Swashbuckle.AspNetCore  추가

3. Startup.cs

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();

            services.AddSwaggerGen(c => {

                // sepcify our operation filter here.  
                c.OperationFilter<AddCommonParameOperationFilter>();

                c.SwaggerDoc("api", new OpenApiInfo { Title = "Web API", Description = "WebAPI 사용법\r\nId : 43, charId : 282362182980730885"
                , Contact = new OpenApiContact { Name = "Minecraft", Email = string.Empty
                , Url = new Uri("http://localhost:1790") }
                });
            });
        }
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();

                app.UseSwagger();
                app.UseSwaggerUI(c => {
                    c.SwaggerEndpoint("api/swagger.json", "Api Documents");
                });
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                app.UseHsts();
            }
        }

docs.microsoft.com/ko-kr/aspnet/core/tutorials/web-api-help-pages-using-swagger?view=aspnetcore-3.1

 

Swagger/OpenAPI를 사용한 ASP.NET Core Web API 도움말 페이지

이 자습서에서는 Swagger를 추가하여 Web API 앱에 대한 설명서 및 도움말 페이지를 생성하는 연습을 제공합니다.

docs.microsoft.com

 

4. 사용자 정의 Parameter 처리를 위한 클래스 추가

Web API 개발의 일반 적인 구조는 Entity 를 주고 받는 형태로 되어 있으므로 이 부분은 불필요 하지만

Entity 를 사용하지 않는 구조라면 고려할 만 합니다.

Custom 파라미터 적용을 위한 방법

https://www.c-sharpcorner.com/article/add-custom-parameters-in-swagger-using-asp-net-core-3-1/

 

Add Custom Parameters In Swagger Using ASP.NET Core 3.1

This article showed you a sample of how to add custom request parameters in Swagger using ASP.NET Core 3.1 and Swashbuckle.AspNetCore 5.0.0

www.c-sharpcorner.com

위 구조를 적용하고 나면 1번 미리보기 화면의 uId, charId 입력 파라미터 구조를 사용할 수 있습니다.

뚝딱뚝딱! MSDN 문서 뒤지고 구글링 해봐도 머리만 아팠는데 막상 적용하고 나니 깔끔하네요. ^ㅡ^

 

Posted by 굥쓰
Study/Tip & Tech2020. 8. 19. 12:25
Posted by 굥쓰

동기화 코드

다음의 logstash 파이프라인은 앞서 설명드린 동기화 코드를 구현합니다.

logstash-mysql.conf

 

input {
  jdbc {
    jdbc_driver_library => "C:\Program Files\Java\jre1.8.0_251\lib/mysql-connector-java-8.0.16.jar"
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/es_db?serverTimezone=Asia/Seoul"
    jdbc_user => <my username>
    jdbc_password => <my password>
    jdbc_paging_enabled => true
    tracking_column => "unix_ts_in_secs"
    use_column_value => true
    tracking_column_type => "numeric"
    schedule => "*/5 * * * * *"
    statement => "SELECT *, UNIX_TIMESTAMP(modification_time) AS unix_ts_in_secs FROM es_table WHERE (UNIX_TIMESTAMP(modification_time) > :sql_last_value AND modification_time < NOW()) ORDER BY modification_time ASC"
  }
}
filter {
  mutate {
    copy => { "id" => "[@metadata][_id]"}
    remove_field => ["id", "@version", "unix_ts_in_secs"]
  }
}
output {
  # stdout { codec =>  "rubydebug"}
  elasticsearch {
      index => "rdbms_sync_idx"
      document_id => "%{[@metadata][_id]}"
  }
}

https://www.elastic.co/kr/blog/how-to-keep-elasticsearch-synchronized-with-a-relational-database-using-logstash

 

Logstash와 JDBC를 사용해 RDBMS와 Elasticsearch의 동기화를 유지하는 방법

Elasticsearch가 기존 관계형 데이터베이스(RDBMS)와 더불어 검색 솔루션으로 배포될 때, 두 데이터 저장소 간에 데이터 동기화를 유지하는 것이 중요합니다. Logstash JDBC 입력 플러그인을 이용해 손쉽�

www.elastic.co

 

Posted by 굥쓰
Study/Bookmark2020. 8. 5. 15:51

웹 브라우저를 통해 폴더 및 파일 조회가 가능하게 해 주는 encode-explorer 을 소개합니다.

php 로 구현된 기능으로 MIT 오픈소스로 되어 있어 입맛에 맞게 커스터마이징이 가능하며

기본 구현된 소스도 깔끔하고 확장성 있게 구현되어 있습니다.

apache, php 환경이 설치된 곳에 올려두면 바로 이용이 가능합니다.

 

Standard 모드
Mobile 모드

다운로드 및 자세한 사항은 아래 github 에서 확인 가능합니다.

https://github.com/marekrei/encode-explorer

 

marekrei/encode-explorer

Contribute to marekrei/encode-explorer development by creating an account on GitHub.

github.com

 

Posted by 굥쓰
Study/DevOps2020. 6. 25. 12:04

아직 실무에서 SVN을 주로 쓰는 입장에서

보통은 trunk 만으로도 충분히 개발하는 경우가 많을 수 있다.

몇명 안되는 소규모 팀에서 프로젝트를 공동으로 관리하면서 소통만 제대로 이뤄 진다면야 뭐든 OK. 

다만 개발과 빌드환경을 분리하고 싶다거나, 개발, QA, 배포 단계에서 버전을 구분해 관리한다거나,

공통, 국내, 글로벌, 지역한정 특성으로 구분을 하려면 머리가 터질 수 있으므로... 브랜치와 태그를 적극 활용하는게 정신건강에 이로울 수 있다.

실무에서 많이 고민하는 Trunk 만 쓰다 배포된 일부 버그를 수정 해 재 배포 하고 싶을때의 좋은 예시가 있어 소개합니다.

https://stackoverflow.com/questions/5759822/i-kept-working-in-trunk-when-i-should-have-created-a-branch-for-some-major-chang

 

I kept working in Trunk when I should have created a Branch for some major changes (Subversion, TortoiseSVN)

I embarked on a set of major changes that touch a lot of different areas of the application, have required changes to the database schema, our objects and presentation code. I started at rev.1101 ...

stackoverflow.com

늘 그렇듯 영어가 낯설면 크롬 번역 기능을 적극 활용하자! ㅋ

Posted by 굥쓰
Study/DevOps2020. 6. 16. 17:33
Posted by 굥쓰
[P] Download2020. 6. 3. 10:10

 

THIS IS THE BEST WAY to manage remote files in Google Drive, Google Shared drives,Google Photos, OneDrive, SharePoint,Dropbox, Box, pCloud, Yandex Disk,MEGA, AWS, Azure, GCP, NCP,WebDAV, SFTP, FTP

https://www.raidrive.com/

raidrive-1-8-0.zip.001
10.00MB
raidrive-1-8-0.zip.002
10.00MB
raidrive-1-8-0.zip.003
3.64MB

 

Posted by 굥쓰