- yos.bat
- yos.sh
- dockerfile
- apache conf
- nginx conf
- package.json
- jmeter bat
- Java & postgreSQL DEV ENV
- vscode_settings.json
- code
- Frontend Pagination
- php _http_post
- bash
- subtitles
- Create multiple files from template && php run files
- /etc/ssh/sshd_config
- chat system table
- remote-browser configuration | vscode
-
-
Save Phalacrocorax/557ecb4e70152b3dbec969d6060a0770 to your computer and use it in GitHub Desktop.
| { | |
| "extends": ["google"], | |
| "env": { | |
| "browser": true, | |
| "es6": true | |
| }, | |
| "plugins": [], | |
| "parserOptions": {}, | |
| "globals": {}, | |
| "rules": { | |
| "one-var": "off", | |
| "quotes": "off", | |
| "prefer-const": "off", | |
| "comma-dangle": "off" | |
| } | |
| } |
| " --- configure syntax highlighting --- " | |
| " possible cterm colors: | |
| " black, blue, cyan, gray, green, magenta, red, white, yellow | |
| color molokai | |
| " enable syntax highlighting | |
| syntax on | |
| " show the editing mode on the last line | |
| set showmode | |
| " highlight matching search strings | |
| set hlsearch | |
| " make searches case insensitive | |
| " set ignorecase | |
| set tabstop=4 | |
| " set autoindent |
#!/bin/bash
# echoの装飾用
# - Usage (30~37) Black Red Green Yellow Blue Magenta Cyan White
ESC="\e["
ESCEND=m
COLOR_OFF=${ESC}${ESCEND}
# Description
echo -en "${ESC}36${ESCEND}"
echo "*********FUNCTION LIST************"
echo "- USAGE (.\\_func.sh && <function>)"
echo "createImport: create import_<>.php"
echo "runImport: except [course] & [user upload]"
echo "**********************************"
echo -en "${COLOR_OFF}"
createImport () {
declare -a key=("coach" "join_course" "lesson" "join_lesson" "area" "block" "group" "club" "school_structure" "user_role")
declare -a file=("coach" "join_course" "lesson" "join_lesson" "area" "block" "group" "club" "schoolstructure" "userrole")
i=0
template='.\_template.php'
for e in ${file[@]}; do
csv="exp_${e}.csv"
cp -f ${template} ".\import_${e}.php"
sed -i -e "s/{{object_key}}/${key[$i]}/g; s/{{csv}}/${csv}/g" ".\import_${e}.php"
let i++
done
}
runImport(){
for f in import_*.php; do
echo -en "${ESC}33${ESCEND}"
echo "Executing: $f"
php $f
echo -en "${COLOR_OFF}"
done
}@echo off
set PATH_ORG=%PATH%
set PATH=C:\_dev\apache-jmeter-5.0\apache-jmeter-5.0\bin;%PATH%
setlocal enabledelayedexpansion
set login_password=%1
if "%login_password%" == "" (
echo "パスワードを指定して下さい"
exit /b 1
)
set jmeter_server=%2
if "%jmeter_server%" == "" (set jmeter_server=localhost)
set jmeter_thread1=%3
if "%jmeter_thread1%" == "" (set jmeter_thread1=10)
REM 設定ファイルパス
set CONFFILE=.\efpai_system_test.ini
REM 設定ファイルが存在するか確認する
if not exist %CONFFILE% (
echo ERROR: Not found %CONFFILE%
exit /b 1
)
REM 設定ファイルを読み込む
for /f "usebackq tokens=1,* delims==" %%a in ("%CONFFILE%") do (
set %%a=%%b
)
set F-723-02_maxLoop
set jmeter_proxyHost
set jmeter_proxyPort
set jmeter_serverPort
set jmeter_protocol
if "%jmeter_proxyHost%" == "" (
set jmeter_proxy_opt=
) else (
set jmeter_proxy_opt=-H %jmeter_proxyHost% -P %jmeter_proxyPort%
)
set jmeter_test_all_opt=-JloginPassword=%login_password% -JserverHost=%jmeter_server% -Jgroup1.thread=%jmeter_thread1% -JserverPort=%jmeter_serverPort% -Jprotocol=%jmeter_protocol%
rem Delete User & Import Data
rem call jmeter -n -t efapi_delete_data.jmx %jmeter_proxy_opt% %jmeter_test_all_opt% -JmaxLoop=%delete_data_maxLoop% -j efapi_delete_data_start.log
rem call jmeter -n -t efapi_delete_user.jmx %jmeter_proxy_opt% %jmeter_test_all_opt% -JmaxLoop=%delete_user_maxLoop% -j efapi_delete_user_start.log
rem Create User & Import Data
rem call jmeter -n -t efapi_create_user.jmx %jmeter_proxy_opt% %jmeter_test_all_opt% -JmaxLoop=%create_user_maxLoop% -j efapi_create_user.log
rem call jmeter -n -t efapi_import_data.jmx %jmeter_proxy_opt% %jmeter_test_all_opt% -JmaxLoop=%import_data_maxLoop% -j efapi_import_data.log
rem API System Test
set List[0]=F-723-02
set List[1]=F-723-03
set List[2]=F-723-04
set List[3]=F-723-05
set List[4]=F-723-06
set List[5]=F-723-07
set List[6]=F-723-08
set List[7]=F-723-09
set List[8]=F-723-10
set List[9]=F-723-11
set List[10]=F-723-12
for /l %%I in (0,1,5) do (
rem filename & log & csv
call set name=efpai_system_test_%%List[%%I]%%
rem maxLoop
call set maxLoop_tmp=%%List[%%I]%%_maxLoop
call set maxLoop=%%!maxLoop_tmp!%%
rem execute
call jmeter -n -t !name!.jmx %jmeter_proxy_opt% %jmeter_test_all_opt% -JmaxLoop=!maxLoop! -j !name!.log -l !name!.csv
)
rem Delete User & Import Data
rem call jmeter -n -t efapi_delete_data.jmx %jmeter_proxy_opt% %jmeter_test_all_opt% -JmaxLoop=%delete_data_maxLoop% -j efapi_delete_data_end.log
rem call jmeter -n -t efapi_delete_user.jmx %jmeter_proxy_opt% %jmeter_test_all_opt% -JmaxLoop=%delete_user_maxLoop% -j efapi_delete_user_end.log
endlocal
set PATH=%PATH_ORG%
exit /b 0
@echo on
4) read -r -p 'Please enter the rawname: ' rawname
38 read -p "First burn in?(y/n): " first #read file from other files
39 echo "start burn $rawname"
40 cd ~/Movies/_マジモテ/_workplace/
41 fix="_fi"
42 if [ $first = "y" ];then
43 ffmpeg -i "$rawname.mp4" -vf "ass=$rawname.ass" "$rawname$fix.mp4"
44 mv "$rawname.mp4" ../_raw/
45 mv "$rawname.ass" ../_ass/
46 else
47 ffmpeg -i "../_raw/$rawname.mp4" -vf "ass=../_ass/$rawname.ass" "$rawname$fix.mp4"
48 fi
49 read -p "Open output folder & write log?(y/n): " ifopen
50 if [$ifopen = "y"];then
51 open .
52 echo "`date` $rawname \n" >> MJMT_work.log #write log file
53 else
54 echo end
55 fi
56 ;;My YT DL bash script It outputs ids to a file so it doesn't try to rip them again next time it runs, It logs all to a log file with date and time stamps. It outputs thumb and description.
#!/bin/sh
YTUSR=youtubechannelnamehere
LOG=output.log
echo "****** $(date -R) ******" >> $LOG
echo "****** $(uptime) ******" >> $LOG
youtube-dl --download-archive "filelist.txt" -ciw --no-progress --write-thumbnail --write-description -f bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4/best ytuser:$YTUSR -o "%(upload_date)s.%(title)s.%(ext)s" --restrict-filenames >> $LOG
echo "****** $(date -R) ******" >> $LOG
echo "****** $(uptime) ******" >> $LOG| { | |
| "window.zoomLevel": 0, | |
| "workbench.iconTheme":"material-icon-theme", | |
| "workbench.colorTheme":"Monokai", | |
| "editor.fontSize":15, | |
| "editor.fontFamily":"Menlo", | |
| "material-icon-theme.showUpdateMessage":false, | |
| "extensions.ignoreRecommendations":true, | |
| "editor.multiCursorModifier": "ctrlCmd", | |
| // markdown | |
| "markdownlint.config": { | |
| "default": true, | |
| "MD047": false, | |
| "MD032": false, // blank line around list | |
| "MD034": false, // no bare links | |
| "MD039": false, // space inside links | |
| }, | |
| // php | |
| "phpfmt.psr2": true, | |
| "[php]": { | |
| "editor.formatOnSave":true, | |
| "editor.renderLineHighlight":"all", // 選択行を行番号含めすべてハイライト | |
| "editor.tabSize":4, // タブのサイズ変更 | |
| }, | |
| // python | |
| "python.linting.pylintArgs": [ | |
| "--disable","W0621,C0111,C0103", | |
| "--indent-string=\" \"", | |
| "--extension-pkg-whitelist", "numpy", | |
| "--generated-members","torch.*", | |
| "--indent-string=\" \"" | |
| ], | |
| // sftp | |
| "remoteBrowser.connectionOptions": { | |
| "host": "xxx.xxx.xx.xxxx", // MANDATORY | |
| "username": "hadoop", // MANDATORY | |
| "localHostname": "localhost", | |
| "privateKey": "C:/Users/xxxx/poct-anx-emr-keypair.pem", | |
| "localUsername": "localhost", // Identify as myuser@myhost | |
| "defaultPath": "/home/hadoop" // Default directory to start in on connect (Absolute path) | |
| }, | |
| "remoteBrowser.additionalConnections": [{ | |
| "host": "xxx.xxx.xx.xx", | |
| "username": "root", | |
| "defaultPath": "/var/www/" | |
| }] | |
| } | |
| } |
@echo off
: コメント
: cd C:\_dev\ef\git\earthfinder_postgresql\efdev
doskey ls=dir /w
doskey op=explorer
doskey ~=cd %HOMEPATH%
doskey cat=type $*
doskey ll=dir /ad
echo path 1: api_base
echo path 2: jmeter Overall_test
echo path 3: psc Rakuza upload csv
set USR_INPUT_STR=
set /P STR_INPUT="GOTO:"
IF "%STR_INPUT%" == "1" (
cd C:\_dev\ef\ef-env\api_base
)
IF "%STR_INPUT%" == "2" (
cd C:\_dev\apache-jmeter-5.0\_Overall_test
)
IF "%STR_INPUT%" == "3" (
cd C:\_dev\psc\src\ImportFile\Guzzle
) alias open=explorer
alias bashrc='vim ~/.bashrc'
alias tree='pwd;find . -path ./node_modules -prune -o -print | sort | sed '\''1d;s/^\.//;s/\/\([^/]*\)$/|--\1/;s/\/[^/|]*/| /g'\'''
# cd directory
function d(){
echo "Select the action
1) cd anyapp
2) cd DCA_Scrapy
x) exit
"
read n
case $n in
1) cd /c/Users/_dev/anyapp;;
2) cd /c/Users/DCA_Scrapy;;
3) cd /c/_dev/psc/src/psc-school-rakuza/rakuza;;
*) echo "exit";;
esac
}
# ✖ cd windows path
# ✔ use cd "" ※quotation marks
function cdwin(){
line=$(sed -e 's#^J:##' -e 's#\\#/#g' <<< "$1")
cd "$line"
}
# dictionary
function dict(){
curl "dict.org/d:$1"
}echo " -------------------
1) Backup DB
"
read n
case $n in
1) read -p "Please input dbname: " dbnm
dt=$(date +%Y%m%d)
echo "start"
mysqldump -uroot -p $dbnm > "${dbnm}_${dt}.sql"
echo "${dbnm}_${dt}.sql is generated!"
gdrive upload "${dbnm}_${dt}.sql" -p xxxxxxxxxxxxxxxxxxxxxxxxxxx
gdrive list -q "name contains '.sql' and name contains '${dbnm}'"
echo "Uploaded to gdrive/db_back"
;;
*) echo "hmmm invalid options";;
esac
Playbook | Java & postgreSQL DEV ENV
連絡帳概要メモ(192.168.11.29環境)
【環境の確認】===============================================================
■Gitリポジトリ
http://52.69.105.40/repos/git/psc-school-web-leifras
■サーバ側概要
・使用言語:Java, postgreSQL
・フレームワーク:SpringBoot, Tymeleaf
・DB:
USER:leifras
PASSWORD: postgres
DB NAME: leifras_db
HOST: 192.168.11.29
■ツール
・Eclipse
・TeraTerm
・WinSCP
・PSqlEdit
■192.168.11.29環境への接続(TeraTerm、WinSCP)
ホスト:192.168.11.29
ユーザ名:root
パスフレーズ:pscpsc
■画面側の確認
①Rakuzaのログイン
→http://192.168.11.29/sc/school/admin/admin_auth
ID:[email protected]
password:1
②左側のメニューから「連絡帳」>「連絡帳配信先選択」を押下
■連絡帳の強制ログアウト
下記コマンドを実行(TeraTermを使用)
[root@localhost ~]# redis-cli
127.0.0.1:6379> keys *
1) "spring:session:sessions:6aa32095-64f8-4703-a881-8ec2dea06fef"
2) "spring:session:expirations:1552984860000"
127.0.0.1:6379> flushdb
OK
127.0.0.1:6379> keys *
(empty list or set)
127.0.0.1:6379> exit
[root@localhost ~]#
[root@localhost ~]#
===========================================================================
【javaの設定】
■application.properties
spring.datasource.urlとleifras.chat.push.urlを修整。
【apacheの設定】
■設定ファイル
vi /etc/httpd/conf/httpd.conf
下記を追記
Alias /img/ "/var/www/leifras_file/"
<Directory "/var/www/leifras_file">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
■設定ファイル
vi /etc/httpd/conf.d/proxy_ajp.conf
下記を追記
ProxyPass /chat/ ajp://localhost:8009/chat/
■apache再起動
sudo /etc/init.d/httpd restart
■画像アップロード先のフォルダ作成
cd /var/www
mkdir -p leifras_file/chat
■フォルダの権限を変更
chown -R apache /var/www/leifras_file
chmod -R 755 /var/www/leifras_file
■warを配備
下記フォルダにwarを配備。(chat.warにリネームしてから)
/opt/apache-tomcat/apache-tomcat-8.5.38/webapps
■Tomcat再起動
/etc/init.d/tomcat restart
【DBの設定】
■下記SQLを実行しDB作成
CREATE USER leifras WITH PASSWORD 'postgres';
ALTER ROLE leifras SUPERUSER;
CREATE DATABASE leifras_db OWNER leifras;
■dumpの取り込み
SVN
\users\kanazawa\連絡帳\20190228_knzw.dump.sql
※192.168.11.29環境のdump。money型をtext型に修整済み。
psql -U postgres leifras_db < ~/20190228_knzw.dump.sql
■PUSH通知の設定
SVN
\documents_leifras\AA_受領資料\PUSH通知\api_field_mapping_設定.sql
\documents_leifras\AA_受領資料\PUSH通知\デモ環境\insert_trn_api_ipaddress.sql
【開発作業】
■Javaの修整内容の反映手順
①EclipseでMavenビルド→Gitのフォルダ:\psc-school-web-leifras\leifras_chat_app\target\chat_app-1.3.5.RELEASE.war が作成される
②192.168.11.29環境のTomcatを停止(TeraTermを使用)
/etc/init.d/tomcat stop
③192.168.11.29 /opt/apache-tomcat/apache-tomcat-8.5.38/webapp にある 「chat.war」と「chat」フォルダを削除
④192.168.11.29環境に「chat_app-1.3.5.RELEASE.war」を転送。(WinSCPを使用)
⑤「chat_app-1.3.5.RELEASE.war」を「chat.war」に名前変更
⑥192.168.11.29環境のTomcatを再開(TeraTermを使用)
/etc/init.d/tomcat start
Frontend Pagination
Bootstrap v4.2.1
<div id="page_button" class="pagination justify-content-center">
<nav aria-label="...">
<ul class="pagination">
<li class="page-item">
<a class="page-link" id="prev" val=0 href="#" aria-label="前" onclick="push_search_button(true, this.attributes.val.value, this.attributes.id.value)">
<span aria-hidden="true">«</span>
</a>
</li>
<li class="page-item first"><a class="page-link push-submit page-number" id="start" href="#" val=1 onclick="push_search_button(true, this.attributes.val.value, this.attributes.id.value)">1</a></li>
<li class="page-item second"><a class="page-link push-submit page-number" id="middle" href="#" val=2 onclick="push_search_button(true, this.attributes.val.value, this.attributes.id.value)">2</a></li>
<li class="page-item third"><a class="page-link push-submit page-number" id="end" href="#" val=3 onclick="push_search_button(true, this.attributes.val.value, this.attributes.id.value)">3</a></li>
<li class="page-item">
<a class="page-link" id="next" val=0 href="#" aria-label="次" onclick="push_search_button(true, this.attributes.val.value, this.attributes.id.value)">
<span aria-hidden="true">»</span>
</a>
</li>
</ul>
</nav>
</div>localStorage.setItem("total", total);
var page_count =Math.floor(total / localStorage.getItem('limit'));
localStorage.setItem("page_count", page_count);
localStorage.setItem('parent_list',JSON.stringify({parent_list}));
pagination_display(offset);
// ページング処理
function pagination_display(offset, act){
// 以前の処理のdisplay:noneを残さないようにする
$(".pagination li").css("display", "list-item");
// 現ページの表示をリセット
$(".page-item").removeClass("active").attr("aria-current=''");
var nowPageNo = localStorage.getItem('nowPageNo');
var page_count = Number(localStorage.getItem("page_count"));
if(Number(localStorage.getItem('total'))<=0) $("#page_button").css("display","none");
offset = Number(offset);
// ページ数 - 選択したページ数:0なら最終ページ
var page_limit_count = page_count - offset;
// ページの数字表示(現ページは真ん中)
$(".page-item.first .page-link").attr("val",offset-1).text(offset-1);
$(".page-item.second .page-link").attr("val",offset).text(offset);
$(".page-item.third .page-link").attr("val",offset+1).text(offset+1);
$(".page-item.second").addClass("active").attr("aria-current='page'");
// 最終ページの場合は、以降のページ番号は非表示
if(page_limit_count <= 0){
$(".page-item.third").css("display","none");
$("#next").css("display","none");
}else{
$("#next").css("display","block");
}
// 先頭ページの場合は、前のページ番号を非表示
if(offset == 1){
$(".page-item.first").css("display","none");
$("#prev").css("display","none");
}else{
$("#prev").css("display","block");
}
}/etc/ssh/sshd_config (mb local test server 192.168.11.104)
# $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
#Port 22
#Protocol 2,1
Protocol 2
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 768
# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no
#UsePAM no
UsePAM yes
# Accept locale-related environment variables
AcceptEnv LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none
# no default banner path
#Banner /some/path
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
settings.json for vscode remote-browser configuration
ctrl+shift+p to connect
``js
{
"C_Cpp.clang_format_fallbackStyle": "Visual Studio",
"window.zoomLevel": 0,
"workbench.activityBar.visible": false,
"editor.minimap.enabled": false,
"breadcrumbs.enabled": true,
"editor.multiCursorModifier": "alt",
"editor.tabCompletion": "on",
"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe",
"remoteBrowser.connectionOptions": {
"host": "192.168.11.101", // MANDATORY
"username": "manageb", // MANDATORY
// "privateKey": "C:/Users/myuser/.ssh/id_rsa", // Path to private key on local machine
"localHostname": "localhost",
"localUsername": "manageb", // Identify as myuser@myhost
"defaultPath": "/var/rakuza_yo/rakuza/" // Default directory to start in on connect (Absolute path)
},
// Optional array to configure additional connections
"remoteBrowser.additionalConnections": [{
"host": "139.162.121.43",
"username": "root",
"defaultPath": "/var/www/whatcode"
}
,
{
"host": "192.168.11.104",
"username": "root",
"defaultPath": "/var/rakuza_leifras/rakuza/reserve_source"
}
,{
"host": "34.85.121.54",
"username": "phalacrocorax",
"privateKey": "C:/Users/user/.ssh/id_rsa",
"defaultPath": "/var/www/html"
}
],
"workbench.colorTheme": "Visual Studio Dark",
}
gitbash config: Options > Looks
font: consolas;
font-size:11;
htaccess psc_school_rakuza
(API control access require pwd)