RSS

日々のメモ書き

Debian Developerが綴るメモ

Cリーグのリザルト

Cリーグのリザルトがなくなってしまった。

総合3位の結果が消えた。写真も消えた。えー、消すなよー。保管しておくべきだった。

libapache2-mod-geoip

早速GeoIPをApacheで試しに使ってみる。

READMEに使い方は書いてある。

GeoIPEnable On
SetEnvIf GEOIP_COUNTRY_CODE CN BlockCountry
SetEnvIf GEOIP_Country_CODE KR BlockCountry
Deny from env=BlockCountry

こうすれば中国と韓国からうざいことやられているサイトは対策になります。とは言うもの自分のプロバイダのIPがなぜかAUになっていたけど。どうなんだろ。

 

GeoIP

IPから国・地域を調べるサービス。

MaxMindが提供しているサービスでIPから国・地域を調べるサービス。Debianにはコマンドラインツールや各種言語のバインディングが用意されている。Apacheの拡張ライブラリもある。

valgrind

A memory debugger and profiler

適当にメモリリークを起こすコードを書く。

#include <stdlib.h>

int
main(void)
{
malloc(100);
return 0;
}

次に -g 付きでコンパイルしてからvalgrindを通して実行する。

$ valgrind --leak-check=full ./a.out 
==28368== Memcheck, a memory error detector.
==28368== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==28368== Using LibVEX rev 1732, a library for dynamic binary translation.
==28368== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==28368== Using valgrind-3.2.3-Debian, a dynamic binary instrumentation framework.
==28368== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==28368== For more details, rerun with: -v
==28368==
==28368==
==28368== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 13 from 1)
==28368== malloc/free: in use at exit: 100 bytes in 1 blocks.
==28368== malloc/free: 1 allocs, 0 frees, 100 bytes allocated.
==28368== For counts of detected errors, rerun with: -v
==28368== searching for pointers to 1 not-freed blocks.
==28368== checked 59,080 bytes.
==28368==
==28368== 100 bytes in 1 blocks are definitely lost in loss record 1 of 1
==28368== at 0x40244B0: malloc (vg_replace_malloc.c:149)
==28368== by 0x8048370: main (leak.c:6)
==28368==
==28368== LEAK SUMMARY:
==28368== definitely lost: 100 bytes in 1 blocks.
==28368== possibly lost: 0 bytes in 0 blocks.
==28368== still reachable: 0 bytes in 0 blocks.
==28368== suppressed: 0 bytes in 0 blocks.

てな具合です。

   - Accesses memory it shouldn't (areas not yet allocated, areas that have
been freed, areas past the end of heap blocks, inaccessible areas of
the stack).

- Uses uninitialised values in dangerous ways.

- Leaks memory.

- Does bad frees of heap blocks (double frees, mismatched frees).

- Passes overlapping source and destination memory blocks to memcpy() and
related functions.

 などができるとのこと。

teTeX is gone

DebianのTeXはteTeXだったが、廃止されることに。

替わりにTeX Liveが入ることになる。teTeXがupstreamで開発やめちゃったのが理由。いやあ、また大きな変化ですね。

sidの状況

etchがリリースされてlennyがスタートしたんですが。

experimentalからsidへ次から次へと降りてくる。いきなりglibc-2.5が来ますか。おそろしいなあ。

他にもgnome-2.18・linux-2.6.20・xorg-7.2などが待ち構えているようだ。

webalizer変更

webalizerの設定をちょっと変更。サーチに関する集計のところ。

SearchEngine google.co.jp q=

を追加しただけですが、いろいろ入るようになった。単純な話でした。解析結果が結構増えた。

FreeBSD 6.2-RELEASE install

FreeBSD 6.2をインストール。

  • sliceはUse Entire Disk
  • partitionもAuto Defaultでおまかせ
  • HTTP経由でダウンロード。deviceがre0なのか。
  • DHCPにしておく。
  • 勝手にダウンロードされてインストールされる。
  • あと適当にネットワークの設定を答える。
  • とくに困る場面もなく終了
  • 結構できがいいですね。
  • あれ?あとからパッケージを追加する方法は?マニュアルを読んだら pkg_add -r bash ということらしい。
  • bashじゃないと落ち着かないです。

interfaceの名前が変わる

Linuxを使っていてなぜかeth0がなくてeth1から割り当てられるという謎な現象が発生。

udevが問題らしい。/etc/udev/rules.d/z25_persistent-net.rules にMACアドレスとインターフェイス名の対応が書いてあって、何かが起こって変な登録が行われたようだ。どのタイミングで何が起こったのかという話はおいといて、書き直せばいいようだ。

DHCPでNTPサーバー通知

DCHPサーバーからNTPサーバーを通知する。

option ntp-server 192.168.0.1;
とdhcpd.confに追加。

dhcpクライアント側では /etc/dhcp3/dhclient.confのrequest の行に ntp-servers を加える。

< 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 >