日立 Inspire the Next
東芝 Leading Innovation
松下 idea for life
三菱電機 Changes for the Better
2009年1月4日日曜日
2009年1月2日金曜日
apache2 なんかのファイルをダウンロードさせたいとき
.htaccessにこう書けば良いんじゃないかな
↓はbatファイルをダウンロードさせる場合
当然ブラウザ依存ですハイ
↓はbatファイルをダウンロードさせる場合
当然ブラウザ依存ですハイ
AddType application/octet-stream .bat
このBlogのテンプレートを変更するには?
Blogger使って長いけどテンプレート(CSS(どこで編集すんだろなーってことでちょっと調べたら出来たのでメモ
そんで
1.上のバーからカスタマイズ
2.HTMLの編集
3.テンプレートを編集
4.中にある↓の辺を注目
/* Posts
-----------------------------------------------
*/
5..post blockquote {に下の2行を追加
background: #a2c2e6;
border: outset thin #d8e0d0;
おしまい
ほらね引用文の見た目が変わったよ↓
そんで
1.上のバーからカスタマイズ
2.HTMLの編集
3.テンプレートを編集
4.中にある↓の辺を注目
/* Posts
-----------------------------------------------
*/
5..post blockquote {に下の2行を追加
background: #a2c2e6;
border: outset thin #d8e0d0;
おしまい
ほらね引用文の見た目が変わったよ↓
てst
てst
あああああ
いいいいい
ubuntu8.10のsambaについて
なんか/etc/samba配下の設定漁ってもGUIで設定した箇所について書かれてないなーと思ったら
/var/lib/samba配下にあった
なんでだろうね まあそういうことです
/var/lib/samba配下にあった
なんでだろうね まあそういうことです
2008年12月31日水曜日
iptablesで設定したルールを再起動後も反映したい
どこに書けばいいのでしょうか? > Debian , Ubuntu
正解は/etc/network/if-pre-up.d
iptables-restoreコマンドをうまいこと駆使してやってください
まあ後はiptablesのメモ
最初に決めるルールINPUTは入ってくパケットOUTPUTは出て行くパケット
FORWARDは転送するパケット
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
全てのルールをクリア
iptables -F
すべてのユーザー定義もクリア
iptables -X
パケットカウンタもクリアしたいなら
iptables -Z
iptables -A INPUT -p tcp --dport 4000:4999 -s ! 192.168.0.0/24 -j DROP
↑の例だと192.168.0.0/24以外のネットワークから来たパケットで4000から4999ポートを指定
しているものを削除
※注意 --dportは-p tcpが指定されていない場合は使えない(udpでも良いけど)
現在のルールを表示
iptables -L
最終的にはこんな感じで
正解は/etc/network/if-pre-up.d
iptables-restoreコマンドをうまいこと駆使してやってください
まあ後はiptablesのメモ
最初に決めるルールINPUTは入ってくパケットOUTPUTは出て行くパケット
FORWARDは転送するパケット
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
全てのルールをクリア
iptables -F
すべてのユーザー定義もクリア
iptables -X
パケットカウンタもクリアしたいなら
iptables -Z
iptables -A INPUT -p tcp --dport 4000:4999 -s ! 192.168.0.0/24 -j DROP
↑の例だと192.168.0.0/24以外のネットワークから来たパケットで4000から4999ポートを指定
しているものを削除
※注意 --dportは-p tcpが指定されていない場合は使えない(udpでも良いけど)
現在のルールを表示
iptables -L
最終的にはこんな感じで
#!/bin/bash
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
#iptables -A INPUT -p tcp --dport 4000:4999 -s ! 192.168.0.0/24 -j DROP
#iptables -A INPUT -p tcp --dport 4000:4999 -j DROP
iptables -A INPUT -p tcp --dport 4000:4999 -s 127.0.0.1 -j ACCEPT
iptables -A INPUT -p tcp --dport 4000:4999 -s 192.168.0.4 -j ACCEPT
iptables -A INPUT -p tcp --dport 4000:4999 -s ! 192.168.0.2 -j DROP
iptables -L
2008年12月25日木曜日
Drupalをubuntu8.10にインストール
1.環境設定
LAMP入れとけばおk
2.mySQLでテーブル作成
# mysql -u root -p
mysql> create database drupal;
↑データベース名
mysql> grant select,insert,update,delete,create,drop,index,alter,create temporary tables,lock tables on drupal.* to root@localhost identified by 'drupal';
↑の例だとrootってユーザーでパスワードはdrupal
mysql> flush privileges;
3.webからごにょごにょ設定
http://drupal.jp/drupal6/quick_start
LAMP入れとけばおk
2.mySQLでテーブル作成
# mysql -u root -p
mysql> create database drupal;
↑データベース名
mysql> grant select,insert,update,delete,create,drop,index,alter,create temporary tables,lock tables on drupal.* to root@localhost identified by 'drupal';
↑の例だとrootってユーザーでパスワードはdrupal
mysql> flush privileges;
3.webからごにょごにょ設定
http://drupal.jp/drupal6/quick_start
2008年12月24日水曜日
WMP11でWindows Live Messengerに再生曲表示
なんか手順が変わってた
Windows Live Messenger は、現在、自分の聞いている曲をメンバーにお知らせできる機能があります。
しかし、Messenger の設定で表示するようにしたつもりなのですが、表示されていないのに気がつきました。
iTunesでは自動的に再生している曲を表示してくれますが、Windows XP のWindows Media Playerの場合は、Windows Live Messenger だけでなく、Windows Media Playerでも設定する必要があります。
まずは、Windows Live Messenger を下記のように設定します。
1. 「メニューを表示します」アイコンをクリックして表示されるメニューより「ツール」の 「オプション」をクリックします。
2. 「オプション」が表示されるので、左側の欄にある「個人設定」をクリックします。
3. 「表示名」の下にある「Windows Media Player の音楽情報を表示メッセージで公開する」にチェックをつけます。
4. 「OK」をクリックします。
Windows Live Messenger の設定が完了したら、Windows Media Player と Windows Live Messenger を連携させましょう。
Windows Media Player で下記のように設定します。なお、Windows Media Playerのバージョンによって、少し設定方法が違いますので、ご注意ください。
Windows Media Player 11の場合
1. Windows Media Player を起動します。
2. 「プレイビュー」の下の▼ボタンをクリックし、「プラグイン」から「オプション」をクリックします。
3. 左側の欄にある「バックグラウンド」をクリックします。
4. 右側に「Windows Live Messenger ミュージック プラグイン」が表示されますので、チェックをつけます。
5. 「OK」をクリックします。
参考リンク
http://mysterious-ramu.spaces.live.com/blog/cns!8F86F6CC5EC84012!310.entry
Windows Live Messenger は、現在、自分の聞いている曲をメンバーにお知らせできる機能があります。
しかし、Messenger の設定で表示するようにしたつもりなのですが、表示されていないのに気がつきました。
iTunesでは自動的に再生している曲を表示してくれますが、Windows XP のWindows Media Playerの場合は、Windows Live Messenger だけでなく、Windows Media Playerでも設定する必要があります。
まずは、Windows Live Messenger を下記のように設定します。
1. 「メニューを表示します」アイコンをクリックして表示されるメニューより「ツール」の 「オプション」をクリックします。
2. 「オプション」が表示されるので、左側の欄にある「個人設定」をクリックします。
3. 「表示名」の下にある「Windows Media Player の音楽情報を表示メッセージで公開する」にチェックをつけます。
4. 「OK」をクリックします。
Windows Live Messenger の設定が完了したら、Windows Media Player と Windows Live Messenger を連携させましょう。
Windows Media Player で下記のように設定します。なお、Windows Media Playerのバージョンによって、少し設定方法が違いますので、ご注意ください。
Windows Media Player 11の場合
1. Windows Media Player を起動します。
2. 「プレイビュー」の下の▼ボタンをクリックし、「プラグイン」から「オプション」をクリックします。
3. 左側の欄にある「バックグラウンド」をクリックします。
4. 右側に「Windows Live Messenger ミュージック プラグイン」が表示されますので、チェックをつけます。
5. 「OK」をクリックします。
参考リンク
http://mysterious-ramu.spaces.live.com/blog/cns!8F86F6CC5EC84012!310.entry
2008年12月23日火曜日
2008年12月21日日曜日
ここら辺でsquidのconfをまとめようか
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow localnet
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
icp_access allow localnet
icp_access deny all
http_port 8080
hierarchy_stoplist cgi-bin ?
cache_mem 32 MB
maximum_object_size_in_memory 300 KB
cache_dir ufs /var/spool/squid 1500 64 1024
maximum_object_size 12096 KB
access_log /var/log/squid/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
via off
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
dns_nameservers 210.130.1.1 210.130.0.1
hosts_file /etc/hosts
forwarded_for off
maximum_single_addr_tries 5
coredump_dir /var/spool/squid
細かい説明は・・・・いいよね多分わかるべさうん・・・
前書いたやつ1
前書いたやつ2
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow localnet
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
icp_access allow localnet
icp_access deny all
http_port 8080
hierarchy_stoplist cgi-bin ?
cache_mem 32 MB
maximum_object_size_in_memory 300 KB
cache_dir ufs /var/spool/squid 1500 64 1024
maximum_object_size 12096 KB
access_log /var/log/squid/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
via off
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
dns_nameservers 210.130.1.1 210.130.0.1
hosts_file /etc/hosts
forwarded_for off
maximum_single_addr_tries 5
coredump_dir /var/spool/squid
細かい説明は・・・・いいよね多分わかるべさうん・・・
前書いたやつ1
前書いたやつ2
ubuntu8.10にはgnump3dパッケージが無いんだ
やあ (´・ω・`) ようこそ、Ubuntu8.10へ。
うん、「また」なんだ。
つーわけでgnump3dを入れるとなると自分でソースからビルドするか、debパッケージを探すかになります。
http://packages.ubuntu.com/
しょうがないので↑から適当に選ぶ「Search package directories」にgnump3dを入れて、Distributionは一個前のhardyを選択
一個前だとあるんだね・・・なんでレポジトリから消えたかは知らないけど・・・・
http://packages.ubuntu.com/hardy/gnump3d
まあダウンロードしたらGUIからでもdebファイルをインストールすると良いよ。GUI無い人はこんな感じでインストールすると良いんじゃない?
# dpkg -i gnump3d_3.0-2_all.deb
参考リンク
debパッケージをインストールする
うん、「また」なんだ。
つーわけでgnump3dを入れるとなると自分でソースからビルドするか、debパッケージを探すかになります。
http://packages.ubuntu.com/
しょうがないので↑から適当に選ぶ「Search package directories」にgnump3dを入れて、Distributionは一個前のhardyを選択
一個前だとあるんだね・・・なんでレポジトリから消えたかは知らないけど・・・・
http://packages.ubuntu.com/hardy/gnump3d
まあダウンロードしたらGUIからでもdebファイルをインストールすると良いよ。GUI無い人はこんな感じでインストールすると良いんじゃない?
# dpkg -i gnump3d_3.0-2_all.deb
参考リンク
debパッケージをインストールする
.bashrcを作っても読み込まないよー><
そんなときは.profileを作ればいいのさ
こんな感じで・・・
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
※あと注意するところは.bash_loginがあってそっちを読みにいってる可能性があるので、そっちを削除してみるかそっから.bashrcを読ませるかやってみること
こんな感じで・・・
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
※あと注意するところは.bash_loginがあってそっちを読みにいってる可能性があるので、そっちを削除してみるかそっから.bashrcを読ませるかやってみること
登録:
投稿 (Atom)
