カテゴリー: PHP環境設定
tinyMCEを使う
tinymce.init({ selector: '#質問内容', language: 'ja' , language_url: 'tinymce_6.8.2/tinymce/js/tinymce/langs/ja.js', autoresize_min_height: 200, autoresize_max_height: 10000, promotion: false, statusbar: false, plugins: 'autoresize anchor autolink charmap codesample emoticons image link lists media searchreplace table visualblocks wordcount ', toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table mergetags | align lineheight | tinycomments | checklist numlist bullist indent outdent | emoticons charmap | removeformat', tinycomments_mode: 'embedded', mergetags_list: [ { value: 'First.Name', title: 'First Name' }, { value: 'Email', title: 'Email' }, ], init_instance_callback: editor => { editor.on('drop', event => { const file = event.dataTransfer.files[0]; editor.on('Change', () => { if (file != undefined && file != null && file.name != '') { const doc = editor.getDoc(); const imgs = Array.from(doc.images); // const len = imgs.length; imgs.forEach(img => { if (img.src.match(/^blob/) || img.currentSrc.match(/^blob/)) { fetch(img.src) .then(response => { return response.blob(); }) .then(blob => { const fData = new FormData(); fData.append('image', blob, file.name); fData.append('action_cmd', 'upload'); fetch( "質問Detail.do", { method: 'POST', body: fData } ) .then(response => { return response.json(); }) .then(json => { img.src = json.result; // この「img」オブジェクトが挿入されるタグなので、「class」なり「data-caption」なり好きに追加できる }); }); } }); } }); }); } });
chrome os mvneにインストールする時
$ sudo bash chromeos-install.sh -src rammu_recovery.bin -dst /dev/nvme0n1p1/dev/nvme0n1
はエラーになるので
以下のコマンドでやるとうまくいく
$ sudo bash chromeos-install.sh -src rammus_recovery.bin -dst /dev/nvme0n1
asterisk 保留音を変換する
#!/bin/sh
INDIR=/music/original
OTDIR=/music/asterisk
find ${INDIR}/ -name “*.wav” | grep ” ” | sed -e ‘s/.*/”&”/; p; s/ /_/g’ | xargs -n2 mv
if [ ! -e ${INDIR} ]; then
echo “${INDIR}$1: 元のフォルダーが存在しません.”
return 0
fi
if [ ! -d ${INDIR} ]; then
echo “$1: 元のファイルがフォルダーではありません.”
return 0
fi
if [ ! -e ${OTDIR} ]; then
echo “${OTDIR}$1: 先のフォルダーが存在しません.”
return 0
fi
if [ ! -d ${OTDIR} ]; then
echo “$1: 先のファイルがフォルダーではありません.”
return 0
fi
for file in `ls -1A ${INDIR}/*.wav `
do
fname=`basename ${file}`
echo ${fname}
sox “${INDIR}/${fname}” -b 16 “${OTDIR}/${fname}” channels 1 rate 8k norm gain -24
done