Skip to content

Instantly share code, notes, and snippets.

View urin's full-sized avatar
🏸

Hayato Takenaka urin

🏸
View GitHub Profile
@urin
urin / get_os_info.sh
Created November 8, 2016 01:16
RHELやCentOS系のOS情報取得
get_os_info() {
local desc=$(cat /etc/*-release | uniq)
local ver=$(echo $desc | sed 's/.* release \(\S*\) .*/\1/')
local arch=$(uname -m)
case $desc in
Red*)
local os=RHEL
;;
CentOS*)
local os=CentOS
@echo off
::
:: logrotate.bat - Log rotation for windows
::
:: Usage: logrotate.bat filename maxfilecount [maxfilesize]
::
:: filename : The file name to rotate.
:: maxfilecount: Number of backup files.
:: maxfilesize : Rotated if the size of file exceeds specified size.
:: (Default is 0. Unit notation is available (K, M and G))
@urin
urin / gist:6c889931453b051b6c8e
Created September 30, 2014 04:41
bashスニペット
# カレントディレクトリのサブディレクトリサイズをMBでソートして表示
printf "%'10d(MB)\t%s\n" $(du -ms * | sort -n)
@urin
urin / makefile
Last active October 20, 2023 15:18
makefile - simple template to make an executable from *.cpp files.
COMPILER = g++
CFLAGS = -g -MMD -MP -Wall -Wextra -Winit-self -Wno-missing-field-initializers
ifeq "$(shell getconf LONG_BIT)" "64"
LDFLAGS =
else
LDFLAGS =
endif
LIBS =
INCLUDE = -I./include
TARGET = ./bin/$(shell basename `readlink -f .`)