5/31/2007

MySQL 계정추가 및 권한주기

1. 먼저 mysql 서버에 root 권한으로 접속하기
  
  ]$ mysql -uroot -p
  password ****
  루트 패스 치시고 mysql 접속
  
  * 권한 부여 할때에는 grant 명령어나 insert 문으로 직접 추가하시는 방법이 있습니다.
  Grant 문을 이용하면 flush privileges 를 할 필요가 없습니다.
  
2. test라는 사용자에게 MySQL 의 모든 DB 의 모든 테이블에 모든권한을 부여하기 - root 권한 주기
  
  mysql> grant all privileges on *.* to test@localhost identified by '패스워드' with grant option;
  
  -- localhost 의 test 에게 (test@localhost) 패스워드라는 암호로 MySQL 의 모든 권한을 부여 하고 있슴당
  
  만약, insert 문을 쓴다면,
  
 mysql> use mysql; 

mysql> insert into user values ('localhost', 'test', password('패스워드'), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
mysql> flush privileges;
  
3. test 라는 사용자에게 testDB 라는 DB에 모든 테이블에 모든 권한을 부여하기
  
  mysql> grant all privileges on testDB.* to test@localhost identified by '패스워드';
  
4. 3번의 경우에서 select, insert 권한만 준다고 할땐
  
  mysql> grant select, insert on testDB.* to test@localhost identified by '패스워드';
  
5. 4번의 경우에서 testTB 라는 테이블의 name,age,email 칼럼에만 update 권한을 부여하고 싶을때
  
  mysql> grant update(name,age,email) on testDB.testTB to test@localhost identified by '패스워드';
  
6. localhost 외의 여러 일반 호스트에서 로그인하는 사용자일 경우에는 호스트 부분을 %로 처리합니다.
  
  모든 호스트에서 로그인할 수 있고 select 권한만 갖는 사용자를 추가할 땐
  
  mysql> grant select on testDB.* to test@'%' identified by '패스워드';
  
7. ip 주소가 192.168.0 으로 시작하는 컴퓨터에서 로그인하는 사용자를 추가할때
  
  mysql> grant all privileges on *.* to test@'192.168.0.%' identified by '패스워드';
  
  7번의 경우 특정 ip 내에 사용자에 대해 권한을 부여함으로써 LAN 상에서 보안상 이득이 있습니다.

5/30/2007

Kernel/Compile

Disclaimer

Building and using a custom kernel will make it very difficult to get support for your system. You will not be allowed to file bugs on the custom-built kernel (if you do, they will be Rejected without explanation).

If you have a commercial support contract with Ubuntu/Canonical, this will void such support.

Also note that this page describes how to do things for the Edgy (2.6.17) kernel and newer! Until this kernel source, we did not have any mechanisms in place that would allow people to build their own kernels easily. This was intentional.

This page does NOT describe how to build stock kernels from kernel.org. This is how to rebuild the actual Ubuntu kernel source.

Reasons for compiling a custom kernel

  • You are a kernel developer.
  • You need the kernel compiled in a special way, that the official kernel is not compiled in (for example, with some experimental feature enabled).
  • You are attempting to debug a problem for which you have filed or will file a bug report on the stock Ubuntu kernel.
  • You have hardware for which the Ubuntu kernel doesn't include support

Reasons for NOT compiling a custom kernel

  • You merely need to compile a special driver. For this, you only need to install the linux-headers packages.
  • You have no idea what you are doing, and if you break something, you'll need help fixing it. If you hose your box, reinstall. Don't bother asking for help.
  • You got to this page by mistake, but checked it out because it looked interesting. Believe me, this isn't interesting at all :)

What you'll need

To start, you will need to install a few packages.

sudo apt-get install linux-kernel-devel fakeroot

This will install the compiler related packages and kernel packaging tools. It will also install the git-core package, which is the best way to interact with the Ubuntu kernel source.

samtygier: I think you also need the package m4

How to get the kernel source

There are a few ways to obtain the Ubuntu kernel source. Some prefer to use git. Detailed instructions for using git can be found in the [Ubuntu]Kernel Git Guide.

The simplest was, useful to those who want to rebuild the standard Ubuntu packages with additional patches is:

apt-get source linux-image-generic
apt-get build-dep linux-image-generic

Another way is to simply:

sudo apt-get install linux-source

However, that will almost always be out of date. Using git allows you to always stay in sync with the latest Ubuntu kernel source, and using the package source allows you to keep as close as possible to an official release with any private changes.

It seems that it is possible to use this information on 6.06 by running something similar to `apt-get source linux-image-2.6.15-26-386', which will give you kernel source along with the debian folder needed for this guide. However, I'm just a user, proceed with caution.
-- Simon80 2006-07-17 02:09:06

After testing it, I must warn you that this documentation doesn't work if you choose the sudo apt-get install linux-source-2.6.17 way.
-- OuattaraAziz 2007-02-17 21:02:06

Modifying the source for your needs

For most people, simply modifying the configs is enough. If you need to install a patch, read the instructions from the patch provider for how to apply.

The stock Ubuntu configs are located in debian/config/ARCH/ where ARCH is the architecture you are building for. In this directory are several files. The config file is the base for all targets in that architecture. Then there are several config.FLAVOUR files that contain options specific to that target. For example, here are the files for 2.6.17, i386:

$ ls -l debian/config/i386/
total 88
-rw-r--r-- 1 me me 62737 Jun 14 18:31 config
-rw-r--r-- 1 me me  1859 Jun 12 14:59 config.386
-rw-r--r-- 1 me me  1394 Jun 12 14:59 config.686
-rw-r--r-- 1 me me  1420 Jun 12 14:59 config.k7
-rw-r--r-- 1 me me  1519 Jun 12 14:59 config.server
-rw-r--r-- 1 me me  1867 Jun 12 14:59 config.server-bigiron

If you need to change a config option, simply modify the file that contains the option. If you modify just the config file, it will affect all targets for this architecture. If you modify one of the target files, it only affects that target.

After applying a patch, or adjusting the configs, it is always best to regenerate the config files to ensure they are consistent. There is a helper command for this. To regenerate all architectures run:

debian/rules updateconfigs

If you just want to update one architecture, run:

debian/bin/oldconfig ARCH

Building the kernel

To build the kernel(s) is very simple. Depending on your needs, you may want to build all the kernel targets, or just one specific to your system. However, you also want to make sure that you do not clash with the stock kernels.

Use this command to build all targets for the architecture you are buidling on:

AUTOBUILD=1 fakeroot debian/rules binary-debs

The AUTOBUILD environment variable triggers special features in the kernel build. First, it skips normal ABI checks (ABI is the binary compatibility). It can do this because it also creates a unique ABI ID. If you used a git repo, this unique ID is generated from the git HEAD SHA. If not, it is generated from the uuidgen program (which means every time you execute the debian/rules build, the UUID will be different!). Your packages will be named using this ID.

To build a specific target, use this command:

AUTOBUILD=1 fakeroot debian/rules binary-debs flavours=k7

This will only build the AMD k7 variant of the i386 architecture.

The debs are placed in ubuntu-2.6/debian/build.

When it's done

Now that the build is complete, you can install the generated debs using dpkg:

sudo dpkg -i linux-image-2.6.17-2-ef427c-k7_2.6.17-2.2_i386.deb
sudo dpkg -i linux-headers--2.6.17-2-ef427c-k7_2.6.17-2.2_i386.deb

If you use modules from linux-restricted-modules, you will need to recompile this against your new linux-headers package.

Rebuilding ''linux-restricted-modules''

(These instruction are taken from an example using a different kernel to that used in the previous examples))

You will need to install all the linux-headers packages that you build in the previous stage.

Then, download the source to linux-restricted-modules

sudo apt-get source linux-restricted-modules-2.6.20-15-lowlatency

and satisfy it's build dependencies

sudo apt-get build-dep linux-restricted-modules-2.6.20-15-lowlatency

and unpack it

dpkg-source -x linux-restricted-modules-2.6.20_2.6.20.5-15.20.dsc

Then you need to edit the debian/rules file, to add the abi-suffix generated when you built your kernel package. Look for the lines

Old text

New Text

# kernel

# kernel

abi_version = 15

abi_version = 15-2be

but where 2be is the abi suffix generated for your kernel packages.

Finally build your packages

cd linux-restricted-modules-2.6.20-2.6.20.5
debuild -rfakeroot

Other

How to compile a kernel module

External information

[WWW]http://www.howtoforge.com/kernel_compilation_ubuntu Compile a kernel from kernel.org source in Ubuntu

 

5/29/2007

'Shift+Space bar' to input Korean on MS Windows

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters 아래에서

이름

기본 데이터

수정한 데이터

LayerDriver KOR

kbd101a.dll

kbd101c.dll

OverrideKeyboardSubtype

dword:00000003

dword:00000005

위와같이 변경후 재부팅