Skip to content

Instantly share code, notes, and snippets.

@ytez
ytez / fpat_test.awk
Last active June 2, 2019 15:10
FPATを用いたAWKスクリプトサンプル (for @callmekohei)
#!/usr/bin/gawk -f
# for @callmekohei
BEGIN{
# コンマ以外の1文字以上の連続
# ないし、"以外の1文字以上の連続が""で囲われている
FPAT = "([^,]+|\"[^\"]+\")"
}
{
@ytez
ytez / getarr_current_line.awk
Last active June 2, 2019 15:12
AWKで、$1, $2, ... $(NF) を配列に入れてみる (for @callmekohei)
#!/usr/bin/gawk -f
# for @callmekohei
BEGIN{
# コンマ以外の1文字以上の連続
# ないし、"以外の1文字以上の連続が""で囲われている
FPAT = "([^,]+|\"[^\"]+\")";
}
{
# 配列消去 (前の行の処理が残っているため)
@ytez
ytez / linebreak_in_fields.awk
Last active October 15, 2022 02:41
AWK: フィールド内に改行(LF)を含むCSVをパースしてみる (for @callmekohei)
#!/usr/bin/gawk -f
BEGIN{
RS="\r\n"
FPAT="[^,]+|\"[^\"]+\""
OFS= " --> "
}
{
gsub(/\n/, "<LF>", $0);
print $1, $2, $3
@ytez
ytez / ascii_0-127_sample.txt
Last active June 4, 2019 15:06
PowerShell で簡単なAsciiダンパをつくる

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
@ytez
ytez / I00_perl_hash_ordered.md
Last active October 9, 2019 06:13
[Perlメモ] Hash::Ordered 使ってみる

※作成中 [ 2019-10-08 ]

参考

概要

  • Perl で順序つきハッシュを使いたい
  • Hash::Ordered というものがあったので試してみた
@ytez
ytez / I00_win7_get_logon_datetime.md
Last active April 12, 2021 05:41
[Win7] ログオン時間をコマンドで調べる

概要

  • Windows 7 でログイン日時をコマンドで取得する
  • net user および WMIC を使用

環境

  • Windows 7 Enterprise 32bit
  • Active Directory ユーザ (非管理者)
@ytez
ytez / I00_visio_tips.md
Last active February 8, 2021 08:47
[Visio] 初心者 Tips

Visio 初心者 Tips

手のひらツールでドラッグする

Ctrl + Shift + マウス右ドラッグ

印刷プレビューを表示

Ctrl + F2

@ytez
ytez / open_hosts.bat
Last active April 17, 2020 05:06
[Win10] hosts ファイルを管理者権限で開くショートカット
@echo off
notepad %windir%\system32\drivers\etc\hosts
rem 右クリック → 管理者権限で起動すれば編集できる
@ytez
ytez / I00_parse_paloalto_xml.md
Last active April 17, 2020 05:56
[Perl] PaloAlto named snapshot XML をパースする
  • Perl 5.30.1

XML::Simple で 読み込んだら普通に hash, array の操作でOK

@ytez
ytez / configuration-Office365-x64.xml
Created May 7, 2020 06:57
Office Deployment Tool で Offic 365 Excel だけ入れる
<!-- Office 365 client configuration file sample. To be used for Office 365 ProPlus apps,
Office 365 Business apps, Project Pro for Office 365 and Visio Pro for Office 365.
For detailed information regarding configuration options visit: http://aka.ms/ODT.
To use the configuration file be sure to remove the comments
The following sample allows you to download and install the 64 bit version of the Office 365 ProPlus apps
and Visio Pro for Office 365 directly from the Office CDN using the Monthly Channel
settings -->