Skip to main content

Posts

Showing posts from 2019

Redmine production.log to uri log

But.. It doesn't work well. (Because the sequence of line is not arranged.) It is better way to use ' redmine_access_logger' plugin than this #!/bin/bash # Setting LOG_FILE=/redmine-3.3.3/log/production.log #LOG_FILE=mylog.log PIDFILE=/var/run/redmine_info_log.pid # Program Variables OUTPUT_LOGDIR=`dirname ${LOG_FILE}` OPT_DEBUG=0 URI_FILTER_REGEX="(^\"/people/avatar)|(^/attachments/thumbnail/)|(^\"/issues/.*\.xml)" function echo_log() { if [ "$2" != "" ]; then echo "$1" >> $2 else echo "$1" fi } if [ -f $PIDFILE ] then PID=$(cat $PIDFILE) ps -p $PID > /dev/null 2>&1 if [ $? -eq 0 ] then echo "Process already running" exit 1 else ## Process not found assume not running echo $$ > $PIDFILE if [ $? -ne 0 ] then echo "Could not create PID file" exit 1 fi fi else echo $$ > $PIDFILE if [ $? -ne 0 ]

using docker.io/licensefinder/license_finder, and solve erros.

My errors npm ERR! peer dep missing: acorn@^6.0.0, required by acorn-dynamic-import@4.0.0 npm ERR! extraneous: ajv@6.9.1 /scan/node_modules/@angular-devkit/build-webpack/node_modules/ajv Try follows 1) npm install -g npm-check-updates 2) ncu -u 3) npm install 4) npm dedupe 5) npm prune --production 1),2),3) upgrade packages to lastest 4) remove duplicated packages 5) prune for removing extraneous

[Linux/BashScript/Vim] Encrypted vim file, cat util.

cat_vim_file.sh =============== #!/bin/bash usage() {   echo "$1 <filename>" } FILENAME=$1 if [ "$FILENAME" == "" ]; then   usage $0 elif [ -f ${FILENAME} ]; then   echo -n "EnterPassword:"   # Without echo (-s)   read -s szPassword   echo $szPassword| vim -es '+%print' '+:q!' $FILENAME else   echo "FileNotFound: $FILENAME"   usage $0 fi =============== Reference: https://stackoverflow.com/questions/3980668/how-to-get-a-password-from-a-shell-script-without-echoing

Ubuntu xrdp settings

Base : Ubuntu 18.04 Command of xrdp session restart -  systemctl restart xrdp-sesman.service /etc/xrdp/startwm.sh Example (For session bus error exception : unset.) ============ unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS if test -r /etc/profile; then #xrdp multiple users configuration  . /etc/profile fi xfce-session mate-session if test -r /etc/default/locale; then         . /etc/default/locale         test -z "${LANG+x}" || export LANG         test -z "${LANGUAGE+x}" || export LANGUAGE         test -z "${LC_ADDRESS+x}" || export LC_ADDRESS         test -z "${LC_ALL+x}" || export LC_ALL         test -z "${LC_COLLATE+x}" || export LC_COLLATE         test -z "${LC_CTYPE+x}" || export LC_CTYPE         test -z "${LC_IDENTIFICATION+x}" || export LC_IDENTIFICATION         test -z "${LC_MEASUREMENT+x}" || export LC_MEASUREMENT         test -z "

[Linux/Grep] How to find hangul or japanese characters in soruce code

Following scripts offer you that finding Hangul, Katakana, Hiragana, Ganji(Han), Hiragana in your source code (ts file) "^((?!\/\/).)*"means that ignore "// comments". The script uses " property-name" of  Regular Expressions. #!/bin/bash BASE_SRC_FOLDER=../src IGNORE_FILE_POSTFIX=( "spec.ts" ) #GREP_PATTERN="^((?!\/\/).)*(\p{Hiragana}|\p{Han}|\p{Katakana})" # for Japanse GREP_PATTERN="^((?!\/\/).)*\p{Hangul}.*" # for Hangul CUR_DIR=`pwd` if [ "`basename $CUR_DIR`" != "script" ]; then   echo "Error: you must run `basename $0` in script directory."   exit fi echo "Search predefined characters in ts file of ${BASE_SRC_FOLDER} folder." TS_FILE_LIST=`find ${BASE_SRC_FOLDER} -name "*.ts"` for CUR_FILE in $TS_FILE_LIST do   let IS_RUN=1   for CUR_IGNORE_FILENAME in ${IGNORE_FILE_POSTFIX[@]}   do     if [ "${CUR_FILE%${CUR_IGNORE_FILENAME}}" != ${CUR