Skip to content

Instantly share code, notes, and snippets.

View KangDroid's full-sized avatar

KangDroid

  • Universe
View GitHub Profile
@KangDroid
KangDroid / apache_build_fix.patch
Created January 22, 2020 13:19
liblog4cxx Compilation error fix patch
diff -uNr apache-log4cxx-0.10.0/config.guess edited/config.guess
--- apache-log4cxx-0.10.0/config.guess 2005-10-25 15:14:37.000000000 +0900
+++ edited/config.guess 2020-01-22 21:49:49.647262463 +0900
@@ -1,13 +1,12 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright 1992-2019 Free Software Foundation, Inc.
@KangDroid
KangDroid / find_character.cpp
Created October 19, 2020 00:33
System Programming Test Practice
#include <iostream>
#include <fstream>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <cstring>
#include <cstdio>
#include <sys/stat.h>
using namespace std;
@KangDroid
KangDroid / main.cpp
Last active October 24, 2020 05:51
AI-Genetic Algorithm Simulator[ONLY FOR EDUCATIONAL PURPOSE]
/*
* Copyright (c) 2020 KangDroid, aka Jason.HW.Kang[HyunWoo Kang]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@KangDroid
KangDroid / WindowsImageDockerfile
Created March 6, 2021 15:31
A Dockerfile for Windows LTSC 2019
FROM mcr.microsoft.com/windows/servercore:ltsc2019
RUN powershell (new-object System.Net.WebClient).Downloadfile('https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u282-b08/OpenJDK8U-jdk_x64_windows_hotspot_8u282b08.msi', 'C:\jre-8u91-windows-x64.msi')
RUN powershell (new-object System.Net.WebClient).Downloadfile('https://github.com/git-for-windows/git/releases/download/v2.30.1.windows.1/MinGit-2.30.1-64-bit.zip', 'C:\git.zip')
RUN powershell Expand-Archive 'C:\git.zip' -DestinationPath 'C:\git'
RUN powershell $env:PATH = 'C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin;{0}' -f $env:PATH ; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
RUN powershell msiexec.exe /i 'C:\jre-8u91-windows-x64.msi' INSTALLLEVEL=3 /quiet
CMD ["powershell"]
@KangDroid
KangDroid / UserTemplateRepository.kt
Created March 22, 2021 09:51
Template Repository for User[for now, only file-related function implemented]
package com.example.demo.domain
import com.mongodb.client.result.UpdateResult
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.data.mongodb.core.MongoTemplate
import org.springframework.data.mongodb.core.aggregation.*
import org.springframework.data.mongodb.core.query.Criteria
import org.springframework.data.mongodb.core.query.Query
import org.springframework.data.mongodb.core.query.Update
import org.springframework.stereotype.Repository
@KangDroid
KangDroid / gist:d188c0d499c47fd330ef7ddd89ca6263
Created May 1, 2021 16:16
Dockerfile[Github Runner on Ubuntu]
FROM adoptopenjdk:11-jdk-hotspot
RUN apt update
RUN apt install git -y
RUN git clone https://github.com/Navi-Cloud/Navi-Server /root/Navi-Server
CMD ["/bin/bash"]
@KangDroid
KangDroid / default
Created July 3, 2021 12:11
Ngninx Configuration default
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
@KangDroid
KangDroid / bootstrap.sh
Created July 3, 2021 12:40
Update Shell Script
#!/bin/bash
BASE_FILE=$1 # Base File
# Global New File
NEW_FILE=/tmp/newServer.jar
# Metadata for Set one
SET_ONE_NAME="Navi-Set1"
SET_ONE_PORT=8080
@KangDroid
KangDroid / run_dotnet_test.sh
Last active August 4, 2021 14:03
Run DotNet Test
#!/bin/bash
# Run Server with nohup
nohup /opt/mssql/bin/sqlservr --accept-eula &
# Sleep for 5 seconds..
sleep 5
# Setup default db
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P testPassword@ -Q "CREATE DATABASE [kdr-test]"
// 채팅방 정보 불러오기
var room = await database.ChatRooms
.Include(r => r.Participants)
.ThenInclude(p => p.Chatbot)
.FirstOrDefaultAsync(r =>
r.Participants.Count(p => p.ChatbotId == botId || p.UserId == user.Id) == 2 &&
r.Participants.Count == 2);
// '채팅방 참여자 정보'를 채팅방 정보에서 불러오기[
// 해당 코드는 데이터베이스에서 이루어지는 코멘트가 아닌 LINQ 쿼리입니다!]