Skip to content

Instantly share code, notes, and snippets.

set number
set relativenumber
inoremap ;; <Esc>
syntax on
set ruler
set ignorecase
set showmatch
set hlsearch
@serenitii
serenitii / guid_32bit.cpp
Created January 5, 2018 03:35
32bit GUID Generator
static u32 guid_32bit() {
static u32 s_guid_step_counter = 0;
struct timeval curr_time;
gettimeofday(&curr_time, nullptr);
//printf("%ld:%ld\n", curr_time.tv_sec, curr_time.tv_usec);
u32 secs = curr_time.tv_sec % 1000000;
u32 msecs = curr_time.tv_usec / 1000;
@serenitii
serenitii / install_boost_1_66_0.sh
Last active April 1, 2020 06:38
Boost Intall with options of -fPIC -std=c++1z
#!/bin/sh
wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2 && \
tar xjf boost_1_66_0.tar.bz2 && \
cd boost_1_66_0 && \
sh bootstrap.sh && \
./b2 --reconfigure stage toolset=gcc cxxflags="-std=c++1z -fPIC -O3 -Werror -Wno-unused-local-typedef -Wno-deprecated-declarations -Wno-unused-function" link=static,shared variant=release threading=multi linkflags="-fPIC" \
sudo ./b2 install
@serenitii
serenitii / setup_dist.sh
Last active December 1, 2018 08:27
Setup Dist Environment On Ubuntu 18.04
# Setup On Ubuntu 18.04
# vagrant init ubuntu/bionic64
# vagrant up
# curl -L <Gist Raw File URL> | bash
cd ~
sudo apt update && sudo apt upgrade
lsb_release -a
@serenitii
serenitii / TCPTestClient.cs
Created December 18, 2018 01:49 — forked from danielbierwirth/TCPTestClient.cs
TCP Client-Server Connection Example | Unity | C# | Bidirectional communication sample: Client can connect to server; Client can send and receive messages: Server accepts clients; Server reads client messages; Server sends messages to client
using System;
using System.Collections;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using UnityEngine;
public class TCPTestClient : MonoBehaviour {
#region private members
@serenitii
serenitii / Setup_MacOS.sh
Last active January 31, 2019 09:07
Setup_MacOS
#!/bin/bash
brew update # Fetch latest version of homebrew and formula.
brew tap caskroom/cask # Tap the Caskroom/Cask repository from Github using HTTPS.
brew search dropbox # Searches all known Casks for a partial or exact match.
brew cask info dropbox # Displays information about the given Cask
brew cask install dropbox # Install the given cask.
@serenitii
serenitii / ServerDevEnvironmentSetup.md
Last active January 28, 2020 06:46
C++ 서버 개발 환경 설정

C++ 서버 개발 환경 구성

boost

https://boostorg.github.io/

MacOS
최신 버전이면 brew를 통해서 하면 되지만, 특정 버전은 b2로 설치한다

@serenitii
serenitii / LibrarySetupForCMake.cmake
Last active January 23, 2020 06:04
CMake 라이브러리 설정
# Boost, Flatbuffers, MySQL, ZooKeeper
# https://cliutils.gitlab.io/modern-cmake/
# https://pleiades.io/help/clion/installation-guide.html
# https://cmake.org/cmake/help/latest/module/FindBoost.html
# [Boost]
# set(Boost_USE_STATIC_RUNTIME ON)
set(Boost_USE_STATIC_LIBS ON) # only find static libs
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_DEBUG_LIBS OFF) # ignore debug libs and
@serenitii
serenitii / Setup_CLI.md
Created April 18, 2020 05:17
Setup command line environment

Install zsh env

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install powerlevel10 theme

sudo apt install fonts-powerline
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
@serenitii
serenitii / setup_cli.sh
Created June 22, 2020 13:04
Setup command line with pratical tools like zsh, fd, fzf, exa,
#!/bin/bash
date
sudo apt install git curl zsh fonts-powerline cowsay lolcat figlet toilet -y
figlet hello | lolcat -a -d 20
echo "-"