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”

Smarty 4.x: PHP 7.4 変数に日本語を使いたかった ;;_0_;;

class Smarty_Internal_Templatelexer
{


public function yylex2()
{
if (!isset($this->yy_global_pattern2)) {
$this->yy_global_pattern2 = $this->replace(“/\G((SMARTYldel)SMARTYal(if|elseif|else if|while)\\s+)|\G((SMARTYldel)SMARTYalfor\\s+)|\G((SMARTYldel)SMARTYalforeach(?![^\s]))|\G((SMARTYldel)SMARTYalsetfilter\\s+)|\G((SMARTYldel)SMARTYalmake_nocache\\s+)|\G((SMARTYldel)SMARTYal[0-9]*[、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠0-9a-zA-Z_]*(\\s+nocache)?\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[$]smarty\\.block\\.(child|parent)\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/][0-9]*[、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠0-9a-zA-Z_]*\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[$][0-9]*[、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠0-9a-zA-Z_]*(\\s+nocache)?\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/])|\G((SMARTYldel)SMARTYal)/isS”);



public function yylex3()
{
if (!isset($this->yy_global_pattern3)) {
$this->yy_global_pattern3 = $this->replace(“/\G(\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal)|\G([\”])|\G(‘[^’\\\\]*(?:\\\\.[^’\\\\]*)*’)|\G([$][0-9]*[、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠0-9a-zA-Z_]*)|\G([$])|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*([!=][=]{1,2}|[]?|[>][=]?|[&|]{2})\\s*)|\G(\\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even|div)\\s+by\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even))|\G([!]\\s*|not\\s+)|\G([(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\\s*)|\G(\\s*[(]\\s*)|\G(\\s*[)])|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*[-][>]\\s*)|\G(\\s*[=][>]\\s*)|\G(\\s*[=]\\s*)|\G(([+]|[-]){2})|\G(\\s*([+]|[-])\\s*)|\G(\\s*([*]{1,2}|[%\/^&]|[]{2})\\s*)|\G([@])|\G(array\\s*[(]\\s*)|\G([#])|\G(\\s+[0-9]*[、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z0-9_\-:]*\\s*[=]\\s*)|\G(([0-9]*[、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠0-9a-zA-Z_]*)?(\\\\[0-9]*[、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠0-9a-zA-Z_]*)+)|\G([0-9]*[、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠0-9a-zA-Z_]*)|\G(\\d+)|\G([`])|\G([|][@]?)|\G([.])|\G(\\s*[,]\\s*)|\G(\\s*[;]\\s*)|\G([:]{2})|\G(\\s*[:]\\s*)|\G(\\s*[?]\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G([\S\s])/isS”);



public function yylex5()
{
if (!isset($this->yy_global_pattern5)) {
$this->yy_global_pattern5 = $this->replace(“/\G((SMARTYldel)SMARTYautoliteral\\s+SMARTYliteral)|\G((SMARTYldel)SMARTYalliteral\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/]literal\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/])|\G((SMARTYldel)SMARTYal[0-9]*[、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠0-9a-zA-Z_]*)|\G((SMARTYldel)SMARTYal)|\G([\”])|\G([`][$])|\G([$][0-9]*[、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠a-zA-Z_][、-◯ア-ンガ-ボァ-ョヮッーあ-んが-ぼぁ-ょゎっー亜-龠0-9a-zA-Z_]*)|\G([$])|\G(([^\”\\\\]*?)((?:\\\\.[^\”\\\\]*?)*?)(?=((SMARTYldel)SMARTYal|\\$|`\\$|\”SMARTYliteral)))|\G([\S\s])/isS”);




}