We're GitHub, the company behind the npm Registry and npm CLI. We offer those to the community for free, but our day job is building and selling useful tools for developers like you.
インフラエンジニアの中西です。 最近プログラマーからこのような話を耳にします。 「ネットワークって難しい/よくわからない」 最近ではAWS,GCPをはじめとするクラウドサービスが充実しているのでWeb界隈のエンジニアはなおさら気にするシーンが少なくなったように思います。 今日は最低限これだけ覚えていたら有事の際にちょっとは役に立ちますよという話が出来たらなと思います。 書式統一のため sudo を省略しています。ご容赦下さい。 コマンド編 ping ping です。疎通確認を行う時のコマンドです。 さすがに分かると聞こえてきそうですね。 例えば、192.168.1.1 というサーバに通信を確認したい場合はこうです。 $ ping 192.168.1.1 繋がる場合はこうなります。 $ ping 192.168.1.1 PING 192.168.1.1 (192.168.1.1): 56 d
パフォーマンスなどの調査をする時に利用する便利コマンドメモ。 これないぞ、あれないぞなどあると思いますがとりあえず本などを参考にまとめたものをピックアップしています。 参考 [24時間365日] サーバ/インフラを支える技術 ‾スケーラビリティ、ハイパフォーマンス、省力運用 (WEB+DB PRESS plusシリーズ) 絵で見てわかるシステムパフォーマンスの仕組み CPU使用率やメモリなど全体の概要把握 top デフォルトでは3秒ごとにOSで利用しているプロセスの数や状態、またOS全体のシステムリソース状況が分かります。 パフォーマンスが悪い場合にOS全体としてどのリソースの利用が多いのか(CPU負荷なのかメモリ利用率が高いのか)などの判断に有用だと思われます。 top - 22:36:56 up 28 min, 2 users, load average: 0.00, 0.02, 0.
初めまして、新卒入社の桑折(@2k0ri)と申します。 入社から今日まで約3ヶ月間、研修およびOJTを受けさせて頂いておりました。 その初OJTのステージング環境で、デプロイ先ディレクトリのシンボリックリンクを消すつもりが デプロイディレクトリを中身ごとrm -rfする という重度のやらかしをしでかしました。 30秒うちひしがれた後、ググって extundeleteというコマンドを見つけてからの 自分が行ったリカバリーの手順を残します。 なお、このコマンドはext3/ext4フォーマット専用になります。 1. サーバーへのアクセスを出来る限り抑えるように周知 最近のLinuxのデファクトFSであるext4フォーマットは、rmされたデータの跡地に 待ったなしで容赦なく新しいデータが書き込まれていきます。 そのため、何よりもまず失われたデータが上書きされないように、 該当サーバーでやらかしたこ
コマンドラインで作業をしていると、タイプミスや誤入力でエラーが表示されて「イラッ」とした経験を持つ方もいるかと思います。 こんな時、海外ならば「Fuck!(クソッ)」という汚い言葉使いになってしまうでしょう…。 ところが、それを逆手にとって「fuck」とそのまま入力するだけで、誤ったコマンドを自動修正して再実行してくれる便利ツール「The Fuck」が公開されていたのでご紹介! 使い方!一体どのように使うのか、いくつか事例が掲載されているので見ていきましょう。 例えば、何らかのツールをインストールしようとして、管理者権限「sudo」を付け忘れてエラー…、みたいなよくあるパターン。 $ apt-get install vim E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Una
Unityエディタでオブジェクトを操作する上で、知っておくと少しだけ幸せになれるTipsを幾つか紹介します。 個人的に重要と思うものには★を設定しました。 目次 目次 オブジェクトの操作に関するTips コライダーの上に載せる感じで配置する Vキー&移動で他モデルの頂点にくっつく Ctrl(Command)押しながら動かすとスナップ移動★ Inspectorの数値を動かす Inspectorの値を足す モデルをスナップに合わせて整列させる モデルを平面に動かす★ オブジェクトを伸ばす ResetでTransformの値を初期化する★ 矢印のグローバル・ローカル切替 操作モードをキー操作で切り替える 複数のオブジェクトを一括で拡大縮小・回転する Ctrl + Dでオブジェクトを複製する★ シーンビューの操作 シーンビューを一発で平行投影かつ上から視点にする★ シーンビューを前後上下左右に移動
B! 82 0 0 0 JavaScriptは主にこのブログのために使ったりするくらいですが、 ちょっとしたテストをターミナル上でちゃっちゃとテストしたい時に 使えるものについて。 jsc SpiderMonkey Rhino Node.js 出力コマンド切り替え まとめ jsc Mac限定ですが、Macにはjscというコマンドが入っています。 /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc ここへはパスが通ってないので、以下の様な 設定を.bashrcを書いておくとjscコマンドが使えるようになります。 if [[ "$OSTYPE" =~ darwin ]];then jscpath="/System/Library/Frameworks/JavaScriptCore.framew
Stop using tail -f (mostly) 12 Mar 2015 I still see a lot of people using tail -f to monitor files that are changing, mostly log files. If you are one of them, let me show you a better alternative: less +F The less documentation explains well what this +F is all about: Scroll forward, and keep trying to read when the end of file is reached. Normally this command would be used when already at the e
ここ数年でUbuntuの知名度もあがり、Web上にはさまざまなUbuntuの情報やノウハウが蓄積されてきました。検索エンジンを使えば、Web上の膨大な情報から手軽に情報を集めることができるため、わからないことがあるとついググってしまいがちです。しかし、Web上にある記事が、自分のシステムについて正しく解説をしているという保証はどこにもありません。それよりも自分のシステムに用意されたマニュアルの方が信用できるというものです。伝統的なUnixシステムにはmanpageと呼ばれるオンラインマニュアルが用意されています。システムにインストールされているコマンドの使い方や設定ファイルの記述方法は、このマニュアルページを参照することでだいたい解決ができるようになっています。 そこで今週のレシピは、伝統的なUNIXマニュアルのさまざまな読み方を紹介します。ググる前に一度manに目を通してみると、幸せにな
Home Subscribe Unixデーモンの仕組み 12 March 2015 おはこんばんちは!! 尾藤 a.k.a. BTO です。 みなさん、Unixデーモンよく使ってますよね。 Webエンジニアなら、Webサーバ、メールサーバ、DBサーバ、cronなどがよく使われるのではないでしょうか。 24時間365日黙々と働き続けるUnixデーモン達。 身近な存在だと思いますが、実はどういう仕組みで動いているのかご存じない方も多いのではないでしょうか。 先日、オトバンクでUnixデーモンの仕組みについて勉強会をやったので、その内容をまとめます。 デーモンとは では、デーモンとはいったい何なのでしょうか。 Unixライクシステムにおいて、バックグランドで動作して様々な処理を実行してくれるプロセスがデーモンです。 デーモンには明確な定義はありませんが、だいたい次のような条件を満たすプロセスが
LinuxやUNIXを使っていると、あるパーティションの容量(たとえば、/var/logなど)がいっぱいになってしまうことがある。 そういった時は、dfコマンドなどで各パーティションの容量を確認し、そのパーティション内で容量が大きくていらないファイルやディレクトリを削除したり、別のパーティションに移動させる対処が必要になる。 今回は、そんな容量の大きいファイルやディレクトリを確認する方法について記述する。 1.容量の大きいファイルを調べる Linuxの場合、「-S」オプションを付与することでファイル容量の大きい順に出力する。 Linuxの場合 ls -lhS 調べたいディレクトリ なお、HP-UXなどの古いOSでは「-S」オプションが存在しない。 そのため、sortコマンドと組み合わせる事で同様の出力を求める。 HP-UXなどの場合 $ ls -l 調べたいディレクトリ | sort -n
対象OS:Windows 7/Windows 8/Windows 8.1/Windows 10/Windows Server 2008 R2/Windows Server 2012/Windows Server 2012 R2/Windows Server 2016 GUIが主流のこの時代でも、CUIの「コマンドプロンプト」が活躍する場面は多い。例えば、システム管理などでは各種の設定ファイルの内容をチェックしたり、簡単な編集作業を行ったりする必要がある。その際、いちいちエクスプローラーやメモ帳などを使って編集するよりは、コマンドプロンプト上で操作した方が手っ取り早い。 またネットワーク関連のトラブルシューティングでは、コマンドプロンプト上でネットワークツールを使う場面が多いので、コマンドプロンプトを避けて通るわけにはいかない。 そこで本TIPSでは、コマンドプロンプトに慣れていないユーザー
知ってる人には今更と思いますが、今まで知らなかったのでメモメモ。 AppleScriptの代わりにJavaScriptを使えるようになってました。 Yosemiteからの新機能だそうです。 JXAとも呼ばれています。宇宙航空研究開発機構とは無関係です。 (追記:JXAは公式の略称です →Introduction to JavaScript for Automation Release Notes) 詳しくは Appleの公式ドキュメント か、「参考」にあるリンクへどうぞ。 もう一つ記事を書いたのでこちらもよかったらどぞ。 Macのキーボード入力、マウスクリックをJavaScriptで (JXA) Script Editorで使う方法 まずScript Editorを使う方法を説明します。 好きなテキストエディタを使いたい場合は飛ばしてください。 (でも「用語説明」の表示の仕方は覚えておいて
findコマンドは、-type f や -name ‘hoge’ などの様々な条件を使うことが出来ますが 加えて AND や OR や NOT の論理演算子も使うことができます 今までテキトーに使ってたので復習しました AND文は評価式を -and または -a で結合します まず、動作確認用に以下のようにファイルを配置します $ tree . |-- dark-chaos |-- dark-neutral |-- dark-row |-- light-chaos |-- light-neutral |-- light-row |-- neutral-chaos |-- neutral-neutral `-- neutral-row 動作確認してみましょう $ find . -name '*light*' -and -name '*row*' ./light-row ファイル名に ‘lig
今回は、コマンドラインから画像加工を行えるImageMagickを取り上げます。画像加工ならGIMPやF-Spotを使えばいいのに、“なぜコマンドラインから?”と思われるかもしれませんが、コマンドラインならではの利点もあります。 例えば、数百枚の画像に同じ処理を施す場合、GIMPで1枚1枚手作業で処理するのに比べて、コマンドラインやスクリプトから一括で処理した方が、時間も労力もかかりません。 ImageMagickは数多くの機能を備えていますが、その中からデジカメで撮影後の写真を加工する用途を中心に紹介していきます。 ImageMagickのインストール インストールは、[アプリケーション]-[アクセサリ]-[端末]を開いて以下のコマンドを実行します。 $ sudo apt-get install imagemagick ImageMagickのドキュメントをインストールする場合は、以
はじめに 去年ぐらいからPython製のコマンドラインのツールをいくつか作っていて、構成もだいぶ固まってきたので、まとめてみる。規模としては1ファイルでは終わらないぐらいで、関数の数も数十になってユーティリティを作ったり、クラスをいくつか作らないと、保守がしにくいような規模のものを想定しています。工数としては1日では終わらないけど、2週間はかからない程度の規模を想定。 構成 ということで、まず構成をさらしてみます。 こんな感じ。 SAMPLE_PROJECTレポジトリがあったとして、その具体的な構成が以下。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 . ├── README.md ├── RELEASE.md ├── TODO ├── bin │ ├── command1 │ ├── comm
Hello, I’m Kristof, a human being like you, and an easy to work with, friendly guy. I've been a programmer, a consultant, CIO in startups, head of software development in government, and built two software companies. Some days I’m coding Golang in the guts of a system and other days I'm wearing a suit to help clients with their DevOps practices. A little collection of cool unix terminal/console/cu
OS Xの画面をイメージファイルとして保存したいときには、スクリーンキャプチャと呼ばれる機能を使う。この機能は標準でOS Xに用意されている。[command]+[shift]+[3]キーを押せば全画面イメージがデスクトップに保存される。また、[command]+[shift]+[4]キーを押し、[shift]キーや[option]キー、[space]キーを押しながらドラッグすると、選択した領域を保存できる。
LinuxやUnixを使っていく上で、どんなに経験が浅くても一度は利用するgrepコマンド。 今回は、このgrepコマンドで覚えておきたい使い方について紹介する。 なお、ここで扱うgrepコマンドはLinuxのものをベースに記述している。商用UNIXやBSD等の場合、オプションなどが異なる事があるので注意。 1.基本の使い方 まずは基本的な使い方から。 テキストファイルから特定の文字列を含む行のみ出力する。 grep 検索したい文字列 検索したいテキストファイル ワイルドカードを用いる事で、複数のファイルを指定してgrepを行う事も出来る。 コマンドの出力結果から検索する場合は、「|(パイプ)」を利用する。 コマンド | grep 検索したい文字列 2.複数の条件でor検索する 複数の条件で検索を行う場合、eオプションを付与する。 grep -e 検索したい文字列1 -e 検索したい文字列
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く