2023-11-02

Chatの「メッセージは投稿者によって削除されました」を非表示にする方法

Chrome拡張機能を自作してやってみよう!


♪できるかな できるかな

・・・

無理ぽ (´・ω・`)


iframeの中に、実際のメッセージのやり取りが表示されるので、

$(function(){
    $('iframe[name^="spareFrame"]').contents().find('[data-is-tombstoned="true"]').hide();
});

って書いたけど

An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.

って言われてダメだったよ・・・


2023-10-17

Google Chat の「チャット」「スペース」「スレッド」

Google Chat には「チャット」「スペース」「スレッド」という考え方というか機能がある。

チャット

LINEと同じ使い方をする機能。複数人を招待して始めれば、グループチャットも開始できる。
1:1で始めたチャットには後からメンバーを追加できないが、グループチャットは後からメンバー追加ができる。

スペース

グループチャット(グループLINE)と同じ使い方もできるけど、
敢えて言おう!「板」であると‼

スレッド

まんま「スレ」。
スペースに送信したメッセージを「スレッドのタイトル」として扱い、以降の会話を「スレッドで返信」機能を使ってやり取りしたもの。
「スペースにメッセージを送信する」行為は「スレッドを立てる」行為そのもの。
なので、スペースのメッセージ送信ボタンの名称は「スレッドを立てる」って書いてもらいたいぐらい。

2023-10-14

Google Chat で文字列検索

2023/10/14

日本語は部分一致で検索できるけど、英数字の羅列は完全一致じゃないと検索できない。

英数字の商品型番でスペースにスレッド立ててるんだけど、完全一致じゃないとヒットしない。

うちの商品型番って「英字n文字 + 数字n文字」で構成されてて、英字部分が同じで数字部分だけ異なる品番が山ほどある。

で、英字部分だけで検索したいんだけどヒットしない。

「ABC123」「ABC456」「ABC789」って品番を検索すべく「ABC」って検索してもヒットしない。

「+ABC」でもダメ。


他にも、メッセージに「Skype」って入力してあって、「Sky」で検索してもヒットしないけど「Skype」だとヒットする。


誰か検索の方法教えて。

2023-06-16

Verification failed: (0x1A) Security Violation

 おー、何年振りかの更新

Ubuntu Desktop 日本語 Remix 

ubuntu-ja-22.04-desktop-amd64.iso

をDVDに焼いて、DVDから起動したら


ブルーバックに

Verification failed: (0x1A) Security Violation 

という文字が表示された。


BIOSのセキュアブートを無効にしたら起動できた。


2019-02-12

cron で bash を使うまでのお話

おー、ほぼ一年ぶりの更新だ・・・

普段、何気に設定していた cron なんですが、

「PATHは通っていないから、フルパス書いて」
「#!/bin/bash はお呪い」

っていう程度の認識しかなかった。


ので、一からお勉強。



まず、cron の シェル等を確認するには、cron実行ユーザーで

[root@localhost ~]# crontab -e

* * * * * printenv >/var/tmp/env.txt

ってやって1分待つ。

で、1分後に出来上がったファイルの中身を見てみる


[root@localhost ~]# cat /var/tmp/env.txt
...
SHELL=/bin/sh
USER=root
PATH=/usr/bin:/bin
PWD=/root
LANG=ja_JP.UTF-8
SHLVL=1
HOME=/root
LOGNAME=root
XDG_RUNTIME_DIR=/run/user/0
...


あー、shだ。
どおりで、/bin/bash って書かないと、動かない記述があるわけだ。

2017-11-02

telnet でメール送信

# telnet mail.example.com 25

HELO foo.bar.com

MAIL FROM: user@foo.bar.com

RCPT TO: foo@example.com

DATA
From: user@foo.bar.com
Subjet: Test Mail
Hello world.
.

QUIT

2017-10-18

Windows 10 の Windows Update が 0x80070426 でエラーになる

Microsoft Account Sign-in Assistant サービスを無効にしていると、エラーが発生する。

サービスのスタートアップの種類を「自動」にすると解決する。

2017-09-25

次間違えたら

一応、管理職なんだけどさ、俺。

でも、社長は俺の名前をしょっちゅう間違える。

次間違えたら

辞める。

---
2020/03
辞めたった。すっきりした。

2017-08-18

VirtualHost とデフォルトサイト

これは常識なのかもしれないけど、

・サイトは、すべて VirtualHost で定義する。
・VirtualHost 定義の一番先頭に、

<VirtualHost *:80>
</VirtualHost>

ってだけ書いておく。
・IP直打ちでアクセスされたときのために、デフォルトのドキュメントルート(/var/www/html)は空にしておく。
・VirtualHostの定義は、httpd.conf の一番最後で行う。サイトごとに別ファイルで定義するときは、httpd.conf の一番最後で Include する。
・名前ベースのバーチャルホストでSSLする。

ってことをするようにした。


こうすることで、

・IP直打ちアクセスや意図しないHOST_NAMEでのアクセスは、全部、デフォルトのドキュメントルートへ流す。

ことができて、これらの意図しないアクセスはすべて 403 で捌けるなと。

でも、その前の前提として、httpd.conf で

<Directory "/var/www/html">
 Options -Indexes +FollowSymLinks
・・・
</Directory>

ってしておくことと、

# rm /etc/httpd/conf.d/welcome.conf 

って消しておいてね

2017-07-22

http/https のセッション数 を netstat の state ごとに表示する

watch使う場合、sed -e 's/[^A-Z]*//' がみそ。
もし sed -e 's/[^A-Z]*//' がなかった場合どうなるかは、試してみて。

watch -n 1 "netstat -ant | egrep ':(80|443) '| egrep 'EST|SYN|FIN|CLOSE'| awk {'print $6'} | sed -e 's/[^A-Z]*//' | sort | uniq -c"


こんなのも

watch -n 2 "netstat -etpon | egrep ':(80|443) ' | egrep 'EST|SYN|FIN|CLOSE'"

2017-07-08

Aレコードがひければメールは届く

SE:80%?冗談じゃない、この設定で100%メールは届きます。

俺:MXレコードはない。

SE:あんなの飾りです。MXレコードなんてなくても、www.example.comでAレコードさえ定義してあれば、 apache@www.example.com っていう Return-Path にも、メールは返ってくるんです。

2017-06-11

smtpd_xxxxx_restrictions

HELOコマンドの際に適用される制限リスト
smtpd_helo_restrictions


RCPTコマンドで宛先指定時に適用される制限リスト
smtpd_recipient_restrictions


DATAコマンドの受信段階に適用される制限リスト
smtpd_data_restrictions


DATAコマンドの終了段階に適用される制限リスト
smtpd_end_of_data_restrictions


ETRNコマンドの受信段階に適用される制限リスト
smtpd_etrn_restrictions


リレー時に適用される制御リスト
smtpd_relay_restrictions ( >= 2.10 )


CentOS 6.7 postfix 2.6 のデフォルト

smtpd_client_restrictions =
smtpd_data_restrictions =
smtpd_end_of_data_restrictions =
smtpd_etrn_restrictions =
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination
smtpd_restriction_classes =
smtpd_sender_restrictions =


CentOS 7 postfix 2.10 のデフォルト

smtpd_client_restrictions =
smtpd_data_restrictions =
smtpd_end_of_data_restrictions =
smtpd_etrn_restrictions =
smtpd_helo_restrictions =
smtpd_recipient_restrictions =
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
smtpd_restriction_classes =
smtpd_sender_restrictions =

また俺の名前間違えやがった

もう許さん。

俺の名前、全員出席の朝礼で間違えやがった。

しかも、これで3度目。

何が大家族主義だよ。

社員の名前ぐらい、しっかり覚えとけ、糞野郎。

2017-06-01

postfix の再送間隔

postfix 2.10.1 のデフォルト設定は以下。

送信失敗 -> deferredに入れる
queue_run_delay(300秒)毎にdeferredをチェック
minimal_backoff_time(300秒)を超えるメールがあれば送信
また失敗したらminimal_backoff_timeの倍(600秒)の時間後に再送
またまた失敗したらminimal_backoff_timeの倍の倍(1200秒)の時間後に再送
その後も失敗したら倍々しながら再送
maximal_backoff_time(4000秒)を超えるまでこれを繰り返し
maximal_backoff_timeを超えてしまったら、maximal_backoff_time間隔で再送
maximal_queue_lifetime(5日)を超えてしまったら再送をあきらめる
bounce_queue_lifetime(5日)を超えたら送信もとにエラーメール送信

2017-04-29

なんだろ?うちの社長

うちの社長が仲のいい社長連中と、お互い奥さん同伴で3年に1回の旅行していた。

自分とこの一番大事なお客さんへの納品日に。

しかも、社員は連休つぶしてるっていうのに、

一番大事なお客さんの納品日だぞ?

しかも、今期も一番の取引額のお客さんだぞ?

そんなにその3年に1回の旅行は大事か?



俺は仕事忙しくて、新婚旅行も行けなかったっていうのに・・・



2か月に1回の飲み会だった。

社長も一緒。

何の話の延長だったか、子供の話になって。

「俺、息子に言われて忘れられない言葉がある」

って俺が切り出して、一緒に飲んでいた女性が「何?」って感じで聞いてくれたので

「あ、お父さん久しぶり」

って。

そしたら、社長

「そんなになるまで会社にいるのもどうかしてるけど」

って半分呆れた感じ言いやがったから、ぶっちーんってキレた。


「某マスコミのあの仕事してたときなんですけど」


って言ってやったら、ほかの社員とオレ無視して違う話し始めやがった。



悪かったの一言もなしかよ。



だよね、あんたには、全部他人事だよね。




2017-04-26

apache 2.4 の ServerName

[root@sv00 ~]# cat /etc/httpd/conf/httpd.conf

~

#ServerName www.example.com:80

~

<VirtualHost *:80>
# Default VirtualHost
# Use Main Setting
</VirtualHost>

<VirtualHost *:80>
ServerName sv01.example.dom
DocumentRoot /var/www/html/sv01
</VirtualHost>


[root@sv00 ~]# hostname
sv00.example.com
[root@sv00 ~]# httpd -S
VirtualHost configuration:
*:80                   is a NameVirtualHost
default server sv00.example.com (/etc/httpd/conf/httpd.conf:357)
port 80 namevhost sv00.example.com (/etc/httpd/conf/httpd.conf:357)
port 80 namevhost sv01.example.dom (/etc/httpd/conf/httpd.conf:361)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"

~

こんな感じで、hostname が FQDN で設定されていると、default の ServerName は hostname が使用される。

hostname が 「sv00」だけだと

[root@sv00 ~]# apachectl configtest
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192:168:0:1. Set the 'ServerName' directive globally to suppress this message
Syntax OK

ってエラーになる。

このエラーが出たら、httpd.conf の ServerName を設定してあげる。

[root@sv00 ~]# vi /etc/httpd/conf/httpd.conf

~

ServerName www.example.com:80

~

<VirtualHost *:80>
# Default VirtualHost
# Use Main Setting
</VirtualHost>

<VirtualHost *:80> 
ServerName sv01.example.dom  
DocumentRoot /var/www/html/sv01  
</VirtualHost>


すると、default の ServerName は httpd.conf の設定が使われる。

[root@sv00 ~]# httpd -S
VirtualHost configuration:
*:80                   is a NameVirtualHost
default server www.example.com (/etc/httpd/conf/httpd.conf:357)
port 80 namevhost www.example.com (/etc/httpd/conf/httpd.conf:357)
port 80 namevhost sv01.example.dom (/etc/httpd/conf/httpd.conf:361)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"

~



先頭に定義してある VirtualHost に ServerName を定義すると、先頭の ServerName が使われる。

[root@sv00 ~]# vi /etc/httpd/conf/httpd.conf

~

ServerName www.example.com:80

~

<VirtualHost *:80>
ServerName sv99.example.com
</VirtualHost>

<VirtualHost *:80>
ServerName sv01.example.dom
DocumentRoot /var/www/html/sv01
</VirtualHost>


[root@sv00 ~]# httpd -S
VirtualHost configuration:
*:80                   is a NameVirtualHost
default server sv99.example.com (/etc/httpd/conf/httpd.conf:357)
port 80 namevhost sv99.example.com (/etc/httpd/conf/httpd.conf:357)
port 80 namevhost sv01.example.dom (/etc/httpd/conf/httpd.conf:361)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"

~


この状態で、

[root@sv00 ~]# hostname sv00.example.com
[root@sv00 ~]# apachectl restart

ってやっても、default の ServerName は sv99.example.com のまま。
main の ServerName をコメントにしても、sv99.example.com のまま。先頭の VirtualHost の ServerName が default になる。


メイン VirtualHost hostname default
#ServerName www.example.com - sv00 IPアドレス
#ServerName www.example.com - sv00.example.com hostname
#ServerName www.example.com ServerName sv99.example.com sv00 IPアドレス
#ServerName www.example.com ServerName sv99.example.com sv00.example.com hostname
ServerName www.example.com - sv00 メイン
ServerName www.example.com - sv00.example.com メイン
ServerName www.example.com ServerName sv99.example.com sv00 VirtualHost
ServerName www.example.com ServerName sv99.example.com sv00.example.com VirtualHost

2017-03-03

find でパーミッションとオーナー・グループを条件に検索して パーミッションを変更する

オーナー hoge に 644 与えてある /var/www/html 配下のファイルのパーミッションを 664 に変更する。
# find /var/www/html -perm 644 -type f -user hoge -print0 | xargs -0 chmod 664

グループ hoge に 644 与えてある /var/www/html 配下のファイルのパーミッションを 664 に変更する。
# find /var/www/html -perm 644 -type f -group hoge -print0 | xargs -0 chmod 664

オーナー hoge に 755 与えてある /var/www/html 配下のディレクトリのパーミッションを 775 に変更する。
# find /var/www/html -perm 755 -type f -user hoge -print0 | xargs -0 chmod 775

グループ hoge に 755 与えてある /var/www/html 配下のディレクトリのパーミッションを 775 に変更する。
# find /var/www/html -perm 755 -type f -group hoge -print0 | xargs -0 chmod 775

2017-03-02

Windows で ドットから始まるフォルダを作る

エクスプローラでフォルダの名前を変更するときに

.hoge.

と入れると

.hoge

というフォルダできる。

Chatの「メッセージは投稿者によって削除されました」を非表示にする方法

Chrome拡張機能を自作してやってみよう! ♪できるかな できるかな ・・・ 無理ぽ (´・ω・`) iframeの中に、実際のメッセージのやり取りが表示されるので、 $(function(){ $('iframe[name^="spa...