火曜日, 3月 31, 2009

Howto: Upstart on

Though it is old , Howto: Upstart on and This page contains information about using Upstart on Fedora
/etc/event.d/rcS-sulogin → inittab
/etc/event.d/rcS → inittab

Linux From Scratch

Linux From Scratch



Excerpt from the front page of the Linux From Scratch

Linux From Scratch (LFS) is a project that provides you with step-by-step instructions for building your own custom Linux system, entirely from source code.

Currently, the Linux From Scratch organization consists of the following subprojects:

  • LFS :: Linux From Scratch is the main book, the base from which all other projects are derived.
  • BLFS :: Beyond Linux From Scratch helps you extend your finished LFS installation into a more customized and usable system.
  • ALFS :: Automated Linux From Scratch provides tools for automating and managing LFS and BLFS builds.
  • CLFS :: Cross Linux From Scratch provides the means to cross-compile an LFS system on many types of systems.
  • HLFS :: Hardened Linux From Scratch focuses on building an LFS system with heightened security.
  • Hints :: The Hints project is a collection of documents that explain how to enhance your LFS system in ways that are not included in the LFS or BLFS books.
  • LiveCD :: The LiveCD project provides a CD that is useful as an LFS build host or as a general rescue CD.
  • Patches :: The Patches project serves as a central repository for all patches useful to an LFS user.

Combine multiple PDFs into one file in Ubuntu Linux

Combine multiple PDFs into one file in Ubuntu Linux
  • The formal way
    1. sudo apt-get install gs pdftk
    2. gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combinedpdf.pdf -dBATCH 1.pdf 2.pdf 3.pdf

  • The simpler way
    pdftk 1.pdf 2.pdf cat output combined.pdf

PM based equivalent of Remastersys

RPM-Based equivalent of Remastersys?


  • Debian, and Debian based Linux distributions ⇒ Remastersys
  • Fedora based Linux distributions ⇒ Revisor

Fedora equivalent of Debian's/Ubuntu's build-essential?

Fedora equivalent of Debian's/Ubuntu's build-essential?

  • Meta-package for Debian based system:build-essential

  • Fedora:
    Full-fledged style

    su -
    yum groupinstall "Development Tools" "Development Libraries"

    Or:
    yum install yumex
    then open YUMEX, and search Groups tab.

    closer to Ubuntu's build-essential

    yum install make automake gcc gcc-c++ kernel-devel

    Install the KDE Development Group

    yum groupinstall "KDE Software Development"

日曜日, 3月 29, 2009

"SendKeys" equivalent in Linux(シリーズⅡ)

Good article title Position active window using xwininfo and wmctrl


  • send a named key combination to X using strings
    xsendkeys(Source)
  • get a LIST of all windows needed
    xprop -root grep "_NET_CLIENT_LIST(WINDOW)"
  • Get specified window information
    xwininfo -id {{{Just_previously_aquired_Window-ID}}}
  • raise a window and give it focus
    wmctrl -a


Code Sample

import time
import subprocess
time.sleep(5)
subprocess.Popen(["gksudo", "nautilus"]); #could be more interesting
time.sleep(5)
subprocess.Popen(["xsendkeys", '"p+p+a+s+s+w+o+r+d+Return+Return"'])

Spy++ - like tools on linux

How to get the list of open windows from xserver
From the CLI you can use
xwininfo -tree -root
When coding, use the XQueryTree function from the Xlib library.


See also Does anyone know something like WinSpy on Xwin?
  • xwininfo - For getting some window parameters(part of xorg install)
  • wininfo - A small gtk gui application which shows the hierarchical
    information
  • editres - Examine application configuration aka resources(also part of x)
  • xmon - monitors the x protocol
    xev - X event viewer)
  • xlsclients - list the clients of the X server
  • lsof - List open files on the system (including non regular files such as sockets and open shared libraries)
  • strace - system trace, traces system calls made by your program

Named pipes

Named pipes are created via mkfifo or mknod:

$ mkfifo /tmp/testpipe
$ mknod /tmp/testpipe p

土曜日, 3月 28, 2009

Nano編集コマンド

Nanoの基本ガイド

ALT-6Copy
Ctrl+KCut
CTRL-UPaste
Ctrl+WFind
Alt+WFind Next

金曜日, 3月 27, 2009

SabayonのEquoの使い方


>> Repository sabayonlinux.org hasn't been downloaded yet.
>> Repository sabayonlinux.org is not available. Cannot validate
>> !!! Please update your repositories now in order to remove this message!
>> @@ Repositories synchronization ...
>> # (1/1) Sabayon Linux Official Repository
>> # Database URL: http://svn.sabayonlinux.org/entropy/standard/sabayonlinux.org/database/x86/4
>> # Database local path: /var/lib/entropy/client/database/x86/sabayonlinux.org/standard/x86/4
>> # Database EAPI: 2
>> Downloading repository database ...

When this kind of error occurs, download all files in "http://svn.sabayonlinux.org/entropy/standard/sabayonlinux.org/database/x86/4" to "/var/lib/entropy/client/database/x86/sabayonlinux.org/standard/x86/4", then
#equo update
#equo install equo entropy spritz

The old momery, SabayoのEquoの使い方, also refer to Entropy Problem and Entropy
  1. emerge --sync && layman -S
  2. emerge equo entropy spritz

全文検索エンジン「Lucene.Net」を使う

全文検索エンジン「Lucene.Net」を使う

"SendKeys" equivalent in Linux

"SendKeys" equivalent in Linux, also the old discussion about How can I modify a keyboard event before it reaches an app?

  1. xmacroplay
    The XMacro package contains two simple, C++ programs (xmacrorec and xmacroplay) for recording and replaying keyboard and mouse events on an X server.
  2. xremote
    xremote is a simple tool that lets you grab the mouse and keyboard of another machine and control them with your local mouse and keyboard. It creates a form of remote control of other machines.

  1. wmctrl
    The wmctrl program is a UNIX/Linux command line tool to interact with an EWMH/NetWM compatible X Window Manager.
  2. GKrellM
    GKrellM is a single process stack of system monitors which supports applying themes to match its appearance to your window manager, Gtk, or any other theme.

水曜日, 3月 25, 2009

straceの使い方

  1. 一般のプログラムの監視
    Linux: # strace -o xxx.txt -e trace=open,close プログラム名
  2. 実行中のプログラム
    Linux: # strace -f -e execve -p pid
    Solaris: # truss -fa -t execve -p pid

xfce4.2の設定

xfce4.2の設定ファイルは~/.config/xfce4にあります。

遅延バインディングによりアンマネージDLL関数を呼び出す



N/Direct - The .NET Interoperability Resource Center
pinvoke.net: the interop wiki!

SharpDevelop

F#、IronPython、Booまで使えるフリーの統合開発環境「SharpDevelop

火曜日, 3月 17, 2009

Driving win32 GUIs with Python

Driving win32 GUIs with Python, part 1, Driving win32 GUIs with Python, part 2, Driving win32 GUIs with Python, part 3, Driving win32 GUIs with Python, part 4

Writing udev rules

This is a great article.

Writing udev rules

. To Local Download

In the /dev/disk directory, oo view the persistent names:

# ls -lR /dev/disk


use udevinfo to look up the device path:

# udevinfo -a -p $(udevinfo -q path -n /dev/sda)

月曜日, 3月 16, 2009

PCLinuxOS 2009.1中のSCIM

$HOMEディレクトリ下の.i18ファイル:

LANGUAGE=ja_JP.UTF-8:ja
GTK_IM_MODULE=scim
LC_ADDRESS=ja_JP.UTF-8
LC_COLLATE=ja_JP.UTF-8
QT_IM_MODULE=scim
LC_NAME=ja_JP.UTF-8
LC_NUMERIC=ja_JP.UTF-8
LC_MEASUREMENT=ja_JP.UTF-8
LC_TIME=ja_JP.UTF-8
LANG=ja_JP.UTF-8
LC_IDENTIFICATION=ja_JP.UTF-8
LC_MESSAGES=ja_JP.UTF-8
LC_CTYPE=ja_JP.UTF-8
LC_TELEPHONE=ja_JP.UTF-8
CONSOLE_NOT_LOCALIZED=yes
ENC=utf8
LC_MONETARY=ja_JP.UTF-8
XIM_PROGRAM="scim -d"
LC_PAPER=ja_JP.UTF-8
XMODIFIERS=@im=SCIM


$HOME/.scim/configの内容:

/FrontEnd/ChangeFactoryGlobally = false
/FrontEnd/OnTheSpot = true
/FrontEnd/Socket/ConfigReadOnly = false
/FrontEnd/Socket/MaxClients = 512
/FrontEnd/X11/BrokenWchar = true
/FrontEnd/X11/Dynamic = false
/FrontEnd/X11/OnTheSpot = true
/FrontEnd/X11/ServerName = SCIM
/Hotkeys/FrontEnd/NextFactory =
/Hotkeys/FrontEnd/NextFactory/ja_JP =
/Hotkeys/FrontEnd/NextFactory/ko_KR =
/Hotkeys/FrontEnd/Off =
/Hotkeys/FrontEnd/On =
/Hotkeys/FrontEnd/PreviousFactory =
/Hotkeys/FrontEnd/PreviousFactory/ja_JP =
/Hotkeys/FrontEnd/PreviousFactory/ko_KR =
/Hotkeys/FrontEnd/ShowFactoryMenu = Control+Alt+Right
/Hotkeys/FrontEnd/Trigger = Zenkaku_Hankaku,Alt+grave,Control+space
/Hotkeys/FrontEnd/Trigger/ja_JP = Zenkaku_Hankaku,Alt+grave,Control+space
/Hotkeys/FrontEnd/Trigger/ko_KR = Alt+Alt_L+KeyRelease,Shift+space,F9,Control+space
/Hotkeys/FrontEnd/ValidKeyMask = Shift+Control+Alt+CapsLock+Meta
/IMEngine/RawCode/Locales = default
/Panel/Gtk/Color/ActiveBackground = light sky blue
/Panel/Gtk/Color/ActiveText = black
/Panel/Gtk/Color/NormalBackground = #F7F3F7
/Panel/Gtk/Color/NormalText = black
/Panel/Gtk/DefaultSticked = false
/Panel/Gtk/Font = default
/Panel/Gtk/LookupTableEmbedded = true
/Panel/Gtk/LookupTableVertical = false
/Panel/Gtk/ShowStatusBox = false
/Panel/Gtk/ShowTrayIcon = true
/Panel/Gtk/ToolBar/AlwaysShow = false
/Panel/Gtk/ToolBar/AutoSnap = true
/Panel/Gtk/ToolBar/HideTimeout = 2
/Panel/Gtk/ToolBar/POS_X = -1
/Panel/Gtk/ToolBar/POS_Y = -1
/Panel/Gtk/ToolBar/ShowFactoryIcon = true
/Panel/Gtk/ToolBar/ShowFactoryName = true
/Panel/Gtk/ToolBar/ShowHelpIcon = true
/Panel/Gtk/ToolBar/ShowMenuIcon = true
/Panel/Gtk/ToolBar/ShowSetupIcon = true
/Panel/Gtk/ToolBar/ShowStickIcon = false
/UpdateTimeStamp = 1237193470:170151


$HOME/.bash_profileの内容

# .bash_profile

# Initialize keychain if needed
if [ -r $HOME/.ssh/identity -o -r $HOME/.ssh/id_dsa -o -r $HOME/.ssh/id_rsa ]; then
if [ ! -d $HOME/.keychain ]; then
keychain
fi
fi

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME


$HOME/.bashrcの内容

# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi



.bashrc .bash_profile .profile の読み込み順




InputMethods/SCIM/Setup
A simple method to set up SCIM in each release of Ubuntu is detailed at UbuntuのSCIMとKubuntuのSCIM

日曜日, 3月 15, 2009

GPGを使う時のプロキシの設定

この概要は表示できません。投稿を閲覧するには ここをクリック してください。

水曜日, 3月 04, 2009

Converting PDF to Flash for web page flipping

Converting PDF to Flash for web page flipping

NMAP Mindmap

NMAP Mindmap

ここにもダウンロードできます。

NMAP - A Stealth Port Scanner

Nmap Network Scanning

己を知り、敵を知る——Nmapで見つめ直す自分の姿
nmap -sS -P0 -T4 -p 1-65535 -oN result.txt -r -v -A 管理しているサーバのアドレス 
  • -P0:ホストの発見を省略する
  • -oN:通常の出力結果で保存する
  • -r:ポートのランダムを禁止
  • -v:冗長オプション
  • -sV:サービス検出
  • -O:OS検出
  • -A:-sV + -O


Nmapを利用したポートスキャンへの対策

Free Chinese Calendar

Free Chinese Calendar

Free Chinese Calendar 2009 - Year of the Ox


Chinese Calendar 2009 - Printable HTML format in Simplified Chinese (简体)

Siduxのマルチメディアツール(シリーズⅣ)

Sidux試用記:じわじわと良さが伝わるディストリビューションを参照できます

Siduxのデスクトップが反応しなくなったら(シリーズⅢ)

デスクトップが反応しなくなったら

Alt-Ctrl-F1 テキストコンソール
Alt-Ctrl-backspace Xを再スタート


SYSRQキー(キーボード右上のprintキー)を使って反応しなくなったシステムをクリーンに再起動できます。

次のコンビネーションがあります:
* ALT+SYSRQ+R (キーボードの入力待ちにもどす)
* ALT+SYSRQ+S (syncメッセージを発行)
* ALT+SYSRQ+E (init以外のすべてのプロセスに終了メッセージを送る)
* ALT+SYSRQ+I (init以外のすべてのプロセスにkillメッセージを送る)
* ALT+SYSRQ+U (ファイルシステムをリードオンリーにして、再起動後のfsckを避ける)
* ALT+SYSRQ+B (コンピュータを再起動する。上のステップなしにいきなり実行したらハードリセットと同じ)。

たとえばすべてのプロセスを終了するのにはしばらく時間がかかりますから、上のステップごとに何秒か待って作業を完了する余裕を与えましょう。 タイプする文字と順番は: "Reboot System Even If Utterly Broken" (訳注:「かなり壊れていたとしてもシステムを再起動する」の意)

fedora10如何卸载kde

fedora10如何卸载kde

yum groupremove kde-desktop

火曜日, 3月 03, 2009

Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

ここもダウンロードできます。

SiduxへのLXDEインストール(シリーズⅡ)

Sidux Linux with LXDE - First Impressions

sidux Quick Start Guide
ようこそsidux™ OS マニュアルへ

SiduxのRepositories List(シリーズⅠ)

Sidux Repositories

debian.list:
  • deb http://ftp.br.debian.org/debian/ unstable main contrib non-free


sidux.list:
  • deb http://sidux.com/debian/ sid main contrib non-free fix.main fix.contrib fix.non-free
  • deb-src http://sidux.com/debian/ sid main contrib non-free fix.main fix.contrib fix.non-free

月曜日, 3月 02, 2009

Installation of Graphical Bootloader (GFXBoot/GFXMenu ) on a Ubuntu / Debian Box

Installation of Graphical Bootloader (GFXBoot/GFXMenu ) on a Ubuntu / Debian Box

GRUBのFloppy disk image の作成

GRUBのFloppy disk image の作成
  1. Floppy disk image の作成
      qemu-img create -f vmdk floppy0.bin 1440

  2. FAT Formatする。
      mkdosfs /dev/fd0

  3. GRUBのインストール
      まずは Floppy diskをマウント。

      cd ~
      mkdir ./floppy
      sudo mount -t vfat /dev/fd0 ./floppy


      次に、Ubuntu等の GRUB をそのまま使っちゃおう。

      mkdir ./floppy/boot
      mkdir ./floppy/boot/grub
      cp /boot/grub/stage1 /boot/grub/stage2 /boot/grub/menu.lst \\
        ./floppy/boot/grub/.
      /usr/sbin/grub

      grub> root (fd0)
      grub> setup (fd0)
      grub> quit

      


Multiboot Specification version 0.6.95

GRUBの起動CDや起動FDDを作成、grubをHDDへインストール(Vine4)