Skip to content

Instantly share code, notes, and snippets.

View kujyp's full-sized avatar

kujyp kujyp

View GitHub Profile
@kujyp
kujyp / codespitz_week05.html
Last active December 12, 2018 01:01
codespitz_week05.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<style>
.urgent{color:red}
.high{color:orange}
.normal{color:skyblue}
#!/bin/bash
function ensure_privileged_or_exit()
{
local cap_lst=$(capsh --decode=00000007ffffffff | cut -d "=" -f2 | tr ',' ' ')
for curr_cap in $(capsh --print | grep Current: | cut -d "=" -f2 | tr ',' ' '); do
cap_lst=$(echo "$cap_lst" | sed -e "s/$curr_cap//g")
done
cap_lst=$(echo "$cap_lst" | sed -e "s/ //g")
#이번에 제 centos7용 docker-ce, nvidia-docker install script가 갑자기 깨져서, 확인중입니다.
#내용은 스크린샷처럼 docker-ce와 nvidia-docker2 2.0.3의 dependency관계 때문에 문제가 생겼습니다.
#에러는 yum install -y nvidia-docker2 수행중 발생하고, 에러내용은 스크린샷으로 올렸습니다.
#제 스크립트 중 설치하는부분만 빼서 보면 아래 내용인데요.
sudo bash -e <<EOF
yum-config-manager \
--add-repo \
@kujyp
kujyp / load_from_googlesheets.py
Created May 23, 2019 21:00
p2p 투자 실수익금 계산 스크립트
# coding=utf-8
from __future__ import print_function
import datetime
import json
import os
from copy import deepcopy
import gspread
from oauth2client.service_account import ServiceAccountCredentials
@kujyp
kujyp / setup.py
Created June 8, 2019 15:42
setup.py checking prerequisite example
import os
from setuptools import setup, find_packages
from mtml.about import __version__, __description__
try:
import CPLEX
except ImportError as e:
raise EnvironmentError("""You must install CPLEX manually first.
@kujyp
kujyp / TextSwitch.java
Created June 10, 2019 12:23
Android Switch with TextView(Left-side)
import android.content.Context;
import android.content.res.TypedArray;
import android.support.v7.widget.SwitchCompat;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Checkable;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import requests
def get_header_names(decoded):
ret = []
first_tr_idx_st = decoded.find("<tr>")
first_tr_idx_ed = decoded.find("</tr>")
headers = decoded[first_tr_idx_st + len("<tr>"):first_tr_idx_ed]
# print(headers)
@kujyp
kujyp / subshelltest.sh
Created July 15, 2019 05:59
subshell ``, $() check differences
#!/bin/bash
a=abc!!
echo a=[$a]
echo ""
result=`echo $a | sed -e 's/!/\\\\!/g'`
echo \`~\`=[$result]
echo ""
#!/bin/sh -e
OS=${OS:-`uname`}
old_rev="$1"
new_rev="$2"
get_file_rev() {
git rev-list -n 1 "$new_rev" "$1"
}
@kujyp
kujyp / resolved_tf1.4_CMakeLists.txt
Last active November 9, 2019 08:18
CMakeLists.txt with tensorflow 1.4 for Android
# Sets the minimum version of CMake required to build the native library.
cmake_minimum_required(VERSION 3.4.1)
# Ref: https://github.com/tensorflow/tensorflow/blob/v1.4.0/tensorflow/contrib/android/cmake/CMakeLists.txt#L37-L48
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIS_SLIM_BUILD \
-std=c++11 -fno-rtti -fexceptions \
-O2 -Wno-narrowing -fomit-frame-pointer \
-fPIE \
-ftemplate-depth=900 \
-DGOOGLE_PROTOBUF_NO_RTTI \