投稿者の投稿

UBUNTUでTOMCATを使用する場合で、ファイルを書き込むときの設定

/etc/systemd/system/multi-user.target.wants/tomcat9.service

# Security
User=tomcat
Group=tomcat
PrivateTmp=yes
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
CacheDirectory=tomcat9
CacheDirectoryMode=750
ProtectSystem=strict
ReadWritePaths=/etc/tomcat9/Catalina/
ReadWritePaths=/var/lib/tomcat9/webapps/
ReadWritePaths=/var/log/tomcat9/
ReadWritePaths=/upload_folder/ <- ここに追加

 

外のフォルダーをマウントするとき

mount -t cifs -o user=hogehoge,password=hogehoge,dir_mode=0777,uid=999,gid=999 //192.168.0.21/out_folder /upload_folder

uid=999はtomcat

 

 

CSSメモメモ


1..container では
 display: grid;

2.最初は小さい画面から作成する。
 その後で大きい画面
 @media screen and (min-width: 376px)
 376->600くらいの方がいい

3.ブロックのセンタリングは
 margin: 0 auto;

4.サイズ指定は%で指定する
 width: 31.2%;

5.画像の高さは横幅で拡縮
 height: auto;

6.均等配置は
 justify-content: space-between;

7.ハイパーリンクの心得
 color: inherit;
 text-decoration: none;

8.ul で横並び
 display: flex;
 list-style-type: none;
 justify-content: space-between;

9.grid チップス 繰り返すこともできる
 display: grid;
 grid-template-columns: 1fr 1fr;
 grid-template-rows: repeat(3, 22px);
 gap: 5px;

10.子要素の配置 grid バージョン
 display: grid;
 place-items: center; <-start center | center end などなど

11.子要素の配置 flex バージョン
 display: flex;
 justify-content: left | center | right; <- どれか
 align-items: start | center | end; <- どれか

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

[fork_child] (0x0020): [RID#152134] pipe (to) failed [24][ファイルを開きすぎです]が出たときの対応

[fork_child] (0x0020): [RID#152134] pipe (to) failed [24][ファイルを開きすぎです]が出たときの対応

linux でkerberos 認証を行っているのだけれども sssd のログにこのようなエラーが出た場合の対処法。

コマンドで見るとこんな感じなので、拡張する。
# ulimit -n
1024

# vi /etc/security/limits.conf

上限は 65536
全ユーザを対象
ソフトリミット、ハードリミット共に同じ値
という事で、以下の設定を追記。

* soft nofile 65536
* hard nofile 65536
* soft nproc 65536
* hard nproc 65536

この場合に必要なのは
* soft nproc 65536
* hard nproc 65536

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

let’s encrypt IIS 更新処理

管理者でコマンドプロンプトを出す

d:
cd D:\win-acme.v2.1.8.847.x64.pluggable
wacs.exe を起動する。
Rを入れてエンターする
Qを入れてエンターする
以上終了

一発コマンド
D:\wacs.exe –renew –baseuri “https://acme-v02.api.letsencrypt.org/”

PostgreSql フィールド情報取得

select
information_schema.columns.column_name as fieldname ,
information_schema.columns.data_type as fieldtype ,
information_schema.columns.character_maximum_length as length ,
information_schema.columns.is_nullable ,
information_schema.columns.column_default as defaultflg,
information_schema.columns.numeric_precision,
information_schema.columns.numeric_precision_radix,
information_schema.columns.numeric_scale,
(select description from pg_description where
pg_description.objoid=pg_stat_user_tables.relid and
pg_description.objsubid=information_schema.columns.ordinal_position
) as comment
from
pg_stat_user_tables,
information_schema.columns
where
pg_stat_user_tables.relname=’authority_mail’
and pg_stat_user_tables.relname=information_schema.columns.table_name
order by information_schema.columns.ordinal_position;

defaultflg
defaultvalue
comment

はいずこ

CentOS7でIPV4を有効化する

nmcli con mod ens192 ipv4.method auto
nmcli con down ens192 ; nmcli con up ens192

robocopy でコピーする

robocopy d: e: /e /xd “System Volume Information” “$RECYCLE.BIN”

最新のみをコピーする

robocopy d:\ e:\ /E /xo /xc /xd “System Volume Information” “$RECYCLE.BIN”