JSON を行単位にわかりやすく展開してくれるコマンド gron がピンポイントでとても便利 2022-06-13-1 [Programming] コマンドラインでの JSON の操作には jq (軽量JSONパーサ)[2017-10-24-1] を使っています。万能で便利なんですが、奥まったところにある値だけを取りたいときとかちょっと面倒なんですよね。ちらっと値を見たいだけなのにおおげさになっちゃいがち。 ということで、 gron というのを使ってみました。 GitHub - tomnomnom/gron: Make JSON greppable!JSONをgrepしやすくするコマンドラインツールgronの紹介 - Qiitagronでjsonの扱いが楽になった話 – Tower of Engineers あ、これでいいや。 いわゆる「顧客(=私)が本当に必要だったもの」だわ。 例えば、
column textql csvkit xsv visidata csvtotable daff tabview CSV(またはTSV)を処理するときにはcut, sort, awk, paste, joinといったコマンドを使うことが多いが、CSVの処理で使えそうなコマンドラインツールを簡単に試してみる。 テスト用のCSVデータは下記ページで作成した。 Mockaroo - Random Data Generator and API Mocking Tool | JSON / CSV / SQL / Excel column以外はGitHubのスター順で紹介している。 column stackoverflow.com columnはLinuxコマンドだが検索で結構ひっかかったので紹介。 以下のように見やすいように揃えて出力してくれる。 $ head -n5 test.csv id,fi
trdsqlというコマンドラインツールを作りました。 Goで作ってます。 githubの trdsqlからダウンロード出来ます。 またLinux/Windows/macOSのバイナリもあります。 以下は、古くなっている内容もいくつかあります。 最新版に対応した、より詳細な内容は trdsql 目次 | Noboru Saito's page を参照して下さい。 これは何? 簡単に言えばCSV(TSV含む)やLTSVに対してSQLを実行できるツールです。 同様のツールが q や textql 等いくつかあります。 trdsqlはPostgreSQLドライバとMySQLドライバを含んでいて実際にDBに接続することでSQLite以上の機能を使用できるようにしています。 PostgreSQLやMySQLの構文が使えるだけではなく、CSVファイルと実テーブルでJOINしたり、CSVファイルからテーブ
とりあえず mycli と aws-shell のスクリーンキャストを見てください。 prompt_toolkit はこのようなリッチコンソールアプリを作るためのライブラリです。 Windows でも動きます。 Jupyter (ipython notebook) を切り離した、コンソール版の ipython も次のメジャーバージョンでは readline ベースから prompt_toolkit ベースに作りなおされています。 ipython 以外にも ptpython というシェルもあり、 ipython の各種 magic が不要な場合はこちらで十分でしょう。 https://github.com/jonathanslenders/python-prompt-toolkit#projects-using-prompt-toolkit には、他にも prompt_toolkit を採用
yumやapt-getからインストールしたり、rpmやdebパッケージを利用してインストールした場合、アンインストールやアップグレードを行うのは簡単だ。 しかし、ソースファイルからコンパイルしたパッケージの場合、makeファイルにuninstallが用意されているならまだしも、もし用意されてないと、パッケージをアンインストールしたりするのは非常に大変だ。 そんなソースからコンパイルしmake installしたパッケージを管理してくれるのが、『porg』だ。pacoという、同じくソースからインストールしたパッケージの管理ツールが前身。 今回は、この『porg』をCentOS 7に実際にインストールし、ソースからインストールしたパッケージを管理してみることにする。 1.『porg』のインストール まずは『porg』のインストールから。 以下のコマンドを実行し、パッケージのソースコードをダウン
Mac大流行なのでCygwinに需要ないかもしれないけど。一年間のCygwin体験をまとめてみた。今年1年で一番使ったツールで感謝してる。 CygwinはWindows環境にそのままLinuxのCUIツールを導入できる。もう「コマンドプロンプト」に拘る必要は薄くなりました。 僕は今年1年の一番の収穫はCygwinを使ったこと。 Cygwinを使うことでターミナルを使いこなせるようになった。そしてMacに移行してもターミナルさえあるから困らないと思えるようになりました。 コマンドプロンプトを捨てるべき理由 ・SSHコマンドでリモートサーバにアクセスしても文字化けする。 ・色・フォントがダサくて使い物にならない。 ・コマンドが少ない。grep したい。findしたい cmd.exeをすててMinttyを使おう。 Cygwinを使うと、minttyというPuttyベースの素晴らしい。ターミナルが
Githubで画像の差分を見られるモードが話題を呼びましたが、このように2枚の画像の差分を調べたいときって時々ありますよね。 そんなときImageMagickのコマンドラインツールを使えば、たった1行で実現できます。 $ composite -compose difference A.jpg B.jpg diff.jpg とすれば、A.jpg と B.jpg の差分画像 diff.jpg が作られます。この差分画像は以下のようになります。 さらにこの差分画像(diff.jpg)が「真っ黒な画像」かどうかも、コマンドラインで調べることができます。 # 差分がなかった場合(=diff.jpgは黒一色の画像) $ identify -format "%[mean]" diff.jpg 0 # 差分があった場合 $ identify -format "%[mean]" diff.jpg 960.8
GowはWindows用のオープンソース・ソフトウェア。LinuxやMac OSXを使っていてWindowsに移ると非常に面倒に感じるのがコマンドラインでの操作だ。GUIが当たり前なので致し方ないのだが、それでもコマンドラインである程度の作業が出来ると利便性が高い。 130種類を越えるコマンド群 そのような時に使っていたのがCygwinだが、レジストリが色々変更されたり、そもそもcygdriveという書かれ方が好きではなかった。もっとシンプルにコマンドだけを使いたいならばGowを利用してみよう。 Gow(Gnu On Windows)はシンプルに使えるLinuxコマンド集で、lsやwc、wgetといったような一般的コマンドが136個ほど詰め合わせになっている。cvsやscp、puttyといったプログラムも用意されているので利便性が高い。vimもあるのが面白い。 パスにも追加されるのでコマン
ApacheなどのWebサーバを運用していると、たまにリアルタイムで今現在の利用状況や負荷などがどうなっているかを確認したくなるときがあります。 そこで、UNIX/Linuxの"top"ライクに、Apacheの使用状況を確認することができるのが「ApacheTop」と呼ばれるツールです。 インストール インストールはパッケージ管理されているものを使うので簡単です。 $ sudo apt-get install apachetopUbuntuやDebianなど、APTを使っているなら↑のような感じ。 $ sudo yum install apachetopFedoraなど、YUMを使っているなら↑のような感じです。 早速使ってみる 使い方は、"-f"オプションでApacheのログファイルを指定して使います。 $ apachetop -f /var/log/apache2/access_log
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く