Skip to content

Instantly share code, notes, and snippets.

View code-machina's full-sized avatar
😌
Humble

GB Kim code-machina

😌
Humble
View GitHub Profile
@code-machina
code-machina / helloworld.sol
Last active December 17, 2018 02:37
Examples of solidity ^0.5.1
pragma solidity ^0.5.1; // (1) Version pragma
contract Helloworld {
// 문자열 멤버 변수
string public greeting;
// memory 키워드가 반드시 있어야 한다.
// greeting 멤버 변수를 초기화
function setGreeting(string memory _greeting) public {
greeting = _greeting;
@code-machina
code-machina / AWS_CLI.command
Last active March 23, 2019 06:41
AWS CLI command
# AWS 인스턴스를 실행
aws ec2 run-instances --instance-type [인스턴스 타입을 입력, t2.micro] --image-id [AMI 아이디를 입력, 인스턴스 정보] --count [생성할 인스턴스 수를 입력, 숫자]
# Topic : Create Custom AMI
## 권한 상승
sudo su
## 업데이트
yum update -y
## 아파치 웹서버 설치
@code-machina
code-machina / studentdal.sql
Created April 5, 2019 06:58
Mysql Sql Example for Student DAL(Data Access Layer)
create database projectdb
use projectdb
create table studenttab(
id int PRIMARY KEY AUTO_INCREMENT,
sname varchar(20),
scourse varchar(30),
sfee int
)
@code-machina
code-machina / Student.java
Created April 5, 2019 07:01
Model for Spring DAL
package com.gbkim.student.dal.entities;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@code-machina
code-machina / StudentRepository.java
Created April 5, 2019 07:02
Repository for Student Model
package com.gbkim.student.dal.repos;
import org.springframework.data.repository.CrudRepository;
import com.gbkim.student.dal.entities.Student;
// CrudRepository<Model_class_name, ids_type> (for example: CrudRepository<Student, Int>)
public interface StudentRepository extends CrudRepository<Student, Long> {
}
@code-machina
code-machina / poc.go
Created August 5, 2019 22:00
CVE-2019-5736
package main
// Implementation of CVE-2019-5736
// Created with help from @singe, @_cablethief, and @feexd.
// This commit also helped a ton to understand the vuln
// https://github.com/lxc/lxc/commit/6400238d08cdf1ca20d49bafb85f4e224348bf9d
import (
"fmt"
"io/ioutil"
"os"
@code-machina
code-machina / Vagrantfile
Created August 8, 2019 03:59
Vagrantfile for booting docker swarm and workers on windows 10
BOX_IMAGE = "ubuntu/xenial64"
WORKER_COUNT = 0 # U can specify the number of workers.
MANAGER_IP_ADDRESS = "192.168.100.10" # Also, can chagne the subnet network
Vagrant.configure("2") do |config|
config.vm.box = BOX_IMAGE
config.vm.define "manager" do |subconfig|
subconfig.vm.box = BOX_IMAGE
@code-machina
code-machina / docker-compose-init.yml
Created August 27, 2019 10:35
도커 컴포저를 이용한 Replica Set 간편 구성 (샘플1)
version: '3.7'
services:
anguis1:
image: mongo:4.1
hostname: anguis1
container_name: anguis1
networks:
- mongo-bridge
ports:
@code-machina
code-machina / FeaturefulTableComp.vue
Created August 31, 2019 07:01
코마의 featureful Table 샘플 (VUe.js)
<!--
filename: FeaturefulTableComp.vue
writer: code-machina
// IoC 컨테이너 용 설정
depends on: {
'scss': [
'@/static/scss/Table.scss',
// 생략
],
'js' : [
@code-machina
code-machina / .vimrc
Created November 13, 2019 22:02 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on