2004-01-01から1年間の記事一覧

なつかしい。

なつかしい。http://www.adachi.ne.jp/users/katz/primer/automata.html

mimeについて

httpのヘッダにファイル名を記述する方法 http://www.studyinghttp.net/headers.html#Content-Disposition http://tohoho.wakusei.ne.jp/lng/199903/99030058.htmダウンロード桙tァイル名の与え方 Content-Disposition: attachment; filename="fname.ext"

ruby版

ssh

#!/usr/bin/ruby -Ke #鍵登録 `ssh-agent` =~ /SSH_AUTH_SOCK=([^;]+);.*SSH_AGENT_PID=([^;]+);/m ENV["SSH_AUTH_SOCK"],ENV["SSH_AGENT_PID"]=$1,$2 `ssh-add ~/.ssh/id_rsa` #Signal.trap(2){`ssh-agent -k`} #ruby1.7以上だったとほほ at_exit{`ssh-agen…

scpでパスフレーズを一度しか入れない方法

ssh

#!/bin/bash eval `ssh-agent ` ssh-add ~/.ssh/id_rsa scp filesv03:/etc/samba/smb.conf smb.conf.filesv03 scp filesv04:/etc/samba/smb.conf smb.conf.filesv04 eval `ssh-agent -k`

ssh-agent

ssh

下準備 $ ssh-keygen -t rsa $ chmod 755 ~/.ssh $ scp ~/.ssh/id_rsa.pub remote:.ssh/authorized_keyshttp://www.jp.freebsd.org/QandA/HTML/1578.html http://kotsuka.hp.infoseek.co.jp/security/

鍵の作成

ssh

n9d@apricot:~$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/n9d/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been sav…

もちょっと楽な設定

ssh

http://biz.letlive.jp/soho/linux/ssh-svr.html

利用者制限

ssh

http://www.zdnet.co.jp/help/tips/linux/l0315.html http://www.atmarkit.co.jp/flinux/rensai/linuxtips/447nonpassh.html

証明書認証のみにする

ssh

/etc/ssh/sshd_config ChallengeResponseAuthentication no PasswordAuthentication no

パンくずナビ用のクラス

ソース #!/usr/bin/ruby -Ke require 'cgi' class Navi def initialize(path="",size=10) # @path=path @size=size @cgi=CGI.new @navi=[] @navi=@cgi.cookies['NAVI'].join.split(':') end def unshift(page="") if @navi!=nil pre…

rubyでクッキーを管理する

連想配列を利用し cookie=Hash.new("") res['set-cookie'].gsub(' ','').split(',').map{|b|/^([^;]+)(;|$)/.match(b)[1].scan(/^([^=]+)=(.+)$/){|h,b|cookie[h]=b}} if res['set-cookie'] res,=http.post("ターゲ…

rubyでクッキーを送信する

res,=http.post("ターゲットURLの/以下","ゲットした引数","Cookie"=>"クッキー")とヘッダに連想配列の形式で入れる。

HTTPヘッダ内にクッキーがあるかどうかの判別

#!/usr/bin/ruby -Ke require "net/http" # http=Net::HTTP::Proxy('プロクシのアドレス',80).new('ターゲットのサーバ名') http=Net::HTTP.new('ターゲットのサーバ名') res,=http.post("ターゲットURLの/以下","ゲットした引数") …

参考

http://www.miraclelinux.com/technet/magazine/samba30/part3.html

sambaの設定

/etc/samba/smb.confの[global]セクションに以下を追加 #==================== PDC Definitions ===================== # http://www.miraclelinux.com/technet/magazine/samba30/table3_2.html ;domain logon = yes domain master = yes ;os lebel = 64 pre…

インストール

openldapを行った後 apt-get install smbldap-tools

関連URL

atmarkit http://www.atmarkit.co.jp/flinux/rensai/root02/root02b.html http://www.atmarkit.co.jp/flinux/samba/sambatips03/sambatips03.html debianで努力している人 http://www.softclub.co.jp/~zoro/woody/ クライアント http://www.sakata.org/ldap/…

コマンドの使い方

中身の確認 ldapsearch -h localhost -x -b 'dc=bike,dc=oa,dc=net' '(objectclass=*)'rootならば slapcat パスワードの作り方 # slappasswd -h '{CRYPT}' -c %s New password: Re-enter new password: {CRYPT}VyrUNOYqqmf5A 追加 f…

インストール

slapd apt-get install slapd lqqqqqqqqqqqqqqqqqqqqqqqqqqqu OpenLDAP configuration tqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x The LDAP directory can be initialized either via an existing LDIF datafile, or x x automatically using information you supply…

openldapについて

#contents

最適

システムのみを整理の対象とするのではなく、すべてのシステムをブラックボックス化し、人間の挙動を列挙するそれぞれの作業(定義が難しいな)の平均時間・最小最大時間をDDDより取得し、時間のかかる原因を考察し、制度を変更する。→定量的な理由付け

一段落ついたので…

久しぶりに自宅マシンを操作中。 2台程マシンが完全に遊んでいたのでちょっとチューニング。 すっかりsargeにも慣れてきたところだ。ところがnfsの使い方を完全に忘れていたのでちょいメモ/etc/exportに 被マウントフォルダ 許可マシン(rw,sync) 繰り返しと…

16台のシステムからsmbdのプロセス数を確認する

for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 ; do echo -n "filesv$i " ; ssh filesv$i.oa2004.jjj.co.jp 'ps ax | grep smbd | wc -l'; done

bashについて

shプログラムは苦手なんだけどviは使えないのでしょうがない。

参考URL

http://www.ipa.co.jp/security/rfc/RFC.html (日本語のRFC)http://cvs.cacanet.org/fsc/ldap/0601/index.html

ldif変換

utf8を含むフィールド中のldifはbase64エンコードされているのでそれを標準に直す #!/usr/bin/ruby -Ke require 'iconv' require 'base64' buf="" while line=gets line.gsub!(/\n|\r/,'') if line=~/^ (.+)$/ buf+=$1 else if buf=…

LDAP ブラウザ

http://www.iit.edu/~gawojar/ldap/ javaベースで結構よさげ 会社でも動いた。 http://solaris.bluecoara.net/servers/ldap/openldap5.phtmlすげー、ちゃんと DNはUTF8で登録できるんだ。 cat foo_cn_japanese.ldif| iconv -f euc-jp -t utf8 > a.ldif ; lda…

フィルタの使い方

検索フィルタ 一致 uid=hoge 部分一致 uid=*o* 存在の確認 uid=* 類似 uid~=hoge 順序比較 uidNumber>=3000 否定 (!(uidNumber>=3000)) 論理積 (&(cn=*hoge*)(uidNumber>=3000)) 論理和 (|(cn=*hoge*)(uid~=hoge))

気になること

ヘルプデスク ヘルプデスクページを刷新することによりリアルタイムでコンテンツを掲載できる環境を手にいれたといえる。 利用者からの問い合わせがすぐさまマニュアル化できる環境である。 問い合わせ件数を仕事のノルマとして捕らえるだけでなく、コンテン…