2015年2月7日 大阪で開催されたJAWS-UG KANSAI 特別編でしゃべったときのスライドです。Read less
![S3をDB利用 ショッピングセンター向けポイントシステム概要](https://cdn-ak-scissors.b.st-hatena.com/image/square/8c55ddc460fb01a85d964013eb997a3f4943c045/height=288;version=1;width=512/https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fjawsup-150218014331-conversion-gate01-thumbnail.jpg%3Fwidth%3D640%26height%3D640%26fit%3Dbounds)
In bash, can I arrange for a function to be executed just before running a command? There is $PROMPT_COMMAND, which is executed before showing a prompt, i.e., just after running a command. Bash's $PROMPT_COMMAND is analogous to zsh's precmd function; so what I'm looking for is a bash equivalent to zsh's preexec. Example applications: set your terminal title to the command being executed; automatic
Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why: It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming. It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash off
環境変数に仕込まれたコードを実行してしまうBASHの脆弱性が CGIスクリプトに影響を与えるか試してみたら結果は悲惨な感じに Tweet 2014年9月25日 嶋田大貴 この記事は2014年のものです 朝から Bash specially-crafted environment variables code injection attack なるもので騒ぎになっていたので、さっそく手元の Apacheで試してみました。 /hoge.cgiというURIで実行されるように、一行のメッセージを出力するだけの CGIスクリプトを設置します。いっけん、なんの入力もクライアント側から受け付けていないため危険のありようもなく見えます。 #!/bin/sh echo "Content-type: text/plain" echo echo "Hi! I'm an ordinary CGI script w
[CentOS] Centos 7 + SystemD + Predictable Network Interface Names Jonathan Billings billings at negate.org Wed Sep 24 15:20:16 UTC 2014 Previous message: [CentOS] Centos 7 + SystemD + Predictable Network Interface Names Next message: [CentOS] Centos 7 + SystemD + Predictable Network Interface Names Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] On Wed, Sep 24, 2014 at 10:04:39AM -0
Red Hat has been made aware of a vulnerability affecting all versions of the bash package as shipped with Red Hat products. This vulnerability CVE-2014-6271 could allow for arbitrary code execution. Certain services and applications allow remote unauthenticated attackers to provide environment variables, allowing them to exploit this issue. Update: 2014-09-30 18:00 UTC Two new flaws have been repo
This article was originally published on the Red Hat Customer Portal. The information may no longer be current. Update 2014-09-30 19:30 UTC Questions have arisen around whether Red Hat products are vulnerable to CVE-2014-6277 and CVE-2014-6278. We have determined that RHSA-2014:1306, RHSA-2014:1311, and RHSA-2014:1312 successfully mitigate the vulnerability and no additional actions need to be ta
Dockerのコンテナーでアプリケーションを起動する場合、専用の起動スクリプトからアプリケーションを起動して、最後に(後からdocker attachできるように)bashを起動しておくことがあります。 次は、httpdサービスを起動するコンテナーを作成する簡単なDockerfileですが、コンテナー起動時にスクリプト「init.sh」を実行するようにしています。 Dockerfile FROM centos:centos6 MAINTAINER enakai RUN yum -y install httpd ADD src /var/www/html RUN chmod -R 644 /var/www/html/* ADD init.sh /usr/local/bin/init.sh RUN chmod u+x /usr/local/bin/init.sh CMD ["/usr/loca
test と [ と [[ コマンドの違い - 拡張 POSIX シェルスクリプト Advent Calendar 2013 - ダメ出し Blog 拡張 POSIX シェルスクリプト Advent Calendar 2013、15日目の記事です。 書くのが遅れ、ネタは尽きかけ、 マニアックさやニッチさが足りなくなってきているような気がします。 ふつうの内容ですみません。 今日は test, [, [[ コマンドの違いについてざっくり紹介します。 [[ がある bash, ksh, zsh ならば test と [ の使用は避け、 [[ を使用すべきです。 [ は慎重に使わないと様々な罠にかかるため危険です。 (翌日のネタも併わせてどうぞ) test と [ の違い どちらもシェルの組込みコマンドです。名前が違うのと [ は最後の引数を ] にしなければいけない縛りがある以外、 動作まった
POSIX sh 以上の機能を備えた bash, ksh, zsh によるシェルスクリプトの話題。 なるべく外部コマンドに依存しないピュアシェルスクリプトを目指します。 sed, awk などのスクリプトが 80% 以上含むものはシェルスクリプトと認めません(老害)。…いや、嘘です、使います。 一人でやる予定だが未定。ネタください。
Revision 1.25 Paul Armstrong Too many more to mention Bash is the only shell scripting language permitted for executables. Executables must start with #!/bin/bash and a minimum number of flags. Use set to set shell options so that calling your script as bash <script_name> does not break its functionality. Restricting all executable shell scripts to bash gives us a consistent shell language that'
追記: 解答編を下の方に書きました!!! 追記: お題に不備があったので変更しました>< あとgistに一式置いたので簡単にテストできます!! https://gist.github.com/hirose31/6232206 git clone https://gist.github.com/6232206.git oreno cd oreno ./test.sh source_me.sh ... シェルは GNU bash, version 4.1.5(1)-release です。 こんな source_me.sh と、 case $PATH in */oreno/bin*) : # do nothing ;; *) . orenorc LOADED_ORENO=1; export LOADED_ORENO ;; esac orenorc ってファイルがあって、 ORENO_HOME="
@hirose31 さんが「シェルスクリプトでハマった件→【募】ステキな回避方法」でお題を出されていて、それに回答してみました。 その内容はリンク先を見てもらうとして、回答の中で使ったbashのプロセス置換について書かれた記事をあまり見ないので、回答で使ったプロセス置換のことをエントリにしてみたいと思います。 最初に注意点ですが、プロセス置換の機能は、bashやzsh*1の機能でPOSIX互換の機能ではありません。そのため、使用時には、対応していないシェルでは使えませんし、bashで使う場合も /bin/sh ではなく /bin/bash を明示的に指定する必要があります。たとえば、プロセス置換を使ったスクリプト「script.sh」に対して"$ bash script.sh" というコマンドは成功しますが、"$ sh script.sh" というコマンドは失敗します。この辺りの違いは「/
This is the third part of the Bash One-Liners Explained article series. In this part I'll teach you all about input/output redirection. I'll use only the best bash practices, various bash idioms and tricks. I want to illustrate how to get various tasks done with just bash built-in commands and bash programming language constructs. See the first part of the series for introduction. After I'm done w
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く