pv import.sql | mysql -p -uxxx xxxxx_db
pipe viewer
Fedora / archive url
http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/
Fedora / fail2ban - sshd
fail2ban 설치
# dnf install fail2ban
설정하기
# /etc/fail2ban/jail.d/custom.conf [DEFAULT] bantime = 600 banaction = firewallcmd-ipset backend = systemd ignoreip = 127.0.0.1 # 여러개 등록시 공백으로 구분 findtime = 600 maxretry = 3 [sshd] enabled = true
fail2ban 활성화 및 시작
# systemctl enable fail2ban.service
# systemctl start fail2ban.service
fail2ban 상태 확인
# fail2ban-client status sshd
참고사이트
fail2ban.org
https://www.fail2ban.org
landoflinux.com
http://landoflinux.com/linux_fail2ban_install_configuration.html
Fedora 20 / Masquerading
DHCPD 설치 및 설정
yum install dhcp
/etc/dhcp/dhcp.conf
ddns-update-style interim; ignore client-updates; subnet 192.168.10.0 netmask 255.255.255.0 { # --- default gateway option routers 192.168.10.1; option subnet-mask 255.255.255.0; option domain-name-servers 168.126.63.1, 168.126.63.2; option time-offset -18000; # Eastern Standard Time range dynamic-bootp 192.168.10.2 192.168.10.254; default-lease-time 21600; max-lease-time 43200; }
systemctl
systemctl enable dhcpd.service
systemctl start dhcpd.service
firewall-cmd
firewall-cmd --zone=external --add-masquerade
firewall-cmd --zone=external --add-masquerade --permanent
local network ntpd 서버 구축하기 in fedora 17
아래 두 줄을 /etc/ntp.conf 파일에 추가 한다.
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
server 127.127.1.0
# systemctl restart ntpd.service
- ntpd,
- time server,
- linux,
-
?
근데 왜왜 부팅시는 데몬이 수행이 안되노~?-0-
Fedora / GUI 설치 using yum
『GNOME 설치』
# yum groupinstall "GNOME Desktop Environment"
『GNOME 설치』
# yum groupinstall "KDE (K Desktop Environment)"
『패키지 그룹 확인』
# yum grouplist
참고)
1) # 은 쉘 프롬프트 입니다.
2) root 권한에서 수행합니다.
Fedora / Time Zone 변경하기
# cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime
# date
2012. 01. 02. (월) 12:48:05 KST
man strcpy - No manual entry for strcpy ? in fedora
페도라 설치 후 man strcpy 했더니 없다네..
무슨 패키지가 설치되지 않았을까?
위 패키지 man-pages 와 man-pages-ko 를 yum 을 이용하여 설치하면 끝~
리눅스 /bin/date 를 이용하여 시스템 시간 동기화 하기
아래 예제 코드를 SystemDateTimeSyncTest.java 파일로 작성한다.
실행시 반드시 루트 권한으로 실행하여야
public class SystemDateTimeSyncTest { public static void main(String[] args) { this.updateSystemDateTime("20100217161550"); // 2010-02-17 16:15:50 } private boolean updateSystemDateTime(String recvMsg) { String strDate = null; String[] cmds = null; BufferedReader br = null; Process proc = null; boolean result = false; try { strDate = recvMsg.substring(0, 4) + "-" + recvMsg.substring(4, 6) + "-" + recvMsg.substring(6, 8) + " " + recvMsg.substring(8, 10) + ":" + recvMsg.substring(10, 12) + ":" + recvMsg.substring(12, 14); cmds = new String[] { "/bin/date", "-s", strDate }; System.out.println("user.name: " + System.getProperty("user.name")); Runtime runtime = Runtime.getRuntime(); runtime.traceInstructions(true); runtime.traceMethodCalls(true); proc = runtime.exec(cmds); br = new BufferedReader(new InputStreamReader(proc.getInputStream())); String execLine = null; while( (execLine = br.readLine()) != null) { System.out.println("----------> " + execLine); } br.close(); br = null; br = new BufferedReader(new InputStreamReader(proc.getErrorStream())); while( (execLine = br.readLine()) != null) { System.out.println("----------> " + execLine); } proc.waitFor(); System.out.println("Exit value: " + proc.exitValue()); result = true; } catch(Exception e) { e.printStackTrace(); result = false; } finally { try { br.close(); } catch(Exception e2) {} br = null; cmds = null; strDate = null; proc = null; } return result; } }
/etc/vsftpd/vsftpd.conf
anonymous_enable=NO
익명 FTP 허용 여부
local_enable=YES
로컬 사용자 로그인 허용 여부
write_enable=YES
FTP write 명령 활성화 여부
chroot_local_user=YES
로컬 사용자 홈 디렉토리가 루트되는 여부
SUSE
- SUSE Linux Users Group
http://www.suse.or.kr/
Ubuntu
- 우분투 한국 사용자 모임
http://www.ubuntu.or.kr/
Fedora
- Fedora Project
http://fedoraproject.org/
- KAIST
http://ftp.kaist.ac.kr/fedora/linux/
Etc.
http://www.linux.co.kr/
http://kldp.org/
Embedded Linux
- http://free-opensource.qvantel.net/mediawiki//index.php/LN2440_-_Single_Board_Computer
- http://littlechips.com/resource.htm
- http://arm-linux-anirudh2.blogspot.com/
- http://www.kegel.com/crosstool/
- python ARM cross compiling : http://www.ailis.de/~k/archives/19-ARM-cross-compiling-howto.html
이때는 /etc/security/limits.conf 파일을 조정하여 하나의 프로세스가 최대 열 수 있는 파일 개수를 늘려주면 해결된다. (조정하지 않으면 Fedora 9에서 1024개임)
아래는 Fedora 9의 /etc/security/limits.conf 파일을 내용을 보여준다.
주석을 읽어보면 설정하는 방법이 자세히 나온다.
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> can be:
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#<item> can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit (KB)
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to values: [-20, 19]
# - rtprio - max realtime priority
#
#<domain> <type> <item> <value>
#
#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
#
wittgens soft nofile 8192
wittgens hard nofile 8192
root soft nofile 8192
root hard nofile 8192
# End of file
로그인을 다시하여 ulimit -a 명령을 사용하여 변경된 내용을 확인할 수 있다.
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 16255
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 8192
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
특정 프로세스가 열고 있는 파일을 알고 싶으면 아래 명령으로 확인 가능하다
Fedora Core yum 저장소
다행히도 아래에 저장되어 있으니, 현재 core를 사용중이라면 /etc/yum.repo.d/ 안의 저장소 주소를 아래의 것으로 변경해서 사용하면 될 듯..

http://archives.fedoraproject.org/pub/archive/fedora/linux/
부팅하는 동안에 task와 service의 시작을 처리하던 /sbin/init가 event 기반으로하는 upstart로 대치되었네요.
upstart는 시스템이 실행(run)하는 동안에 서비스들을 stop, start 할 수 있네요.
첨엔 Ubuntu 용으로 개발되었으나 모든 리눅스에 탑재될 것 같다고 나오네요.
사용예)
#
description "service test daemon"
author "Jeong-soo, Kim <wittgens@gmail.com>"
# runlevel 3에서 시작
start on runlevel 3
# 출력되는 곳 지정
console output
# 서비스 프로그램
exec /sbin/testd
# 죽으면 다시 살아남.
respawn
위와 같이 같단히 만들어서 /etc/event.d/testd 라는 파일로 생성하면 됩니다. 물론 /sbin/testd는 본인이 만든 서비스 프로그램입니다.
서비스 시작과 중지는 아래와 같이 합니다.
# initctl stop testd 또는 stop testd
더 자세한 정보는 http://upstart.ubuntu.com 에서 찾아볼 수 있습니다.
-
?
왠 높임말? ㅋ
페도라 아직 안 죽었나~ ㅋㅋ -
?
걍 써봤다. 걍 반말로 해야긋다. ㅋㅋ
페도라 아직 안죽었는것 같은데.ㅋㅋ
find 명령 요약
Ex) find . -name '*.jpg' -ctime -12 -print
Option |
Description |
-name filename |
filename 파일 이름으로 찾는다. |
-user username |
user이름으로 찾는다. |
-group groupname |
group 이름으로 찾는다. |
-perm nnn |
파일 권한이 nnn인 파일을 찾는다.
(ex. -perm 755) |
-type x |
파일 타입이 x인 파일들을 찾는다. |
-atime +n |
access
time 이 n일 이전인 파일을 찾는다. |
-atime ?n |
access time 이
n일 이내인 파일을 찾는다. |
-mtime +n |
n일 이전에 변경된 파일을 찾는다. |
-mtime ?n |
n일 이내에 변경된 파일을 찾는다. |
-size n |
사이즈가 n이상인 파일들을 찾는다. |
-links n |
링크된 개수가 n인 파일들을 찾는다. |
-print |
표준출력 |
-exec command |
command 실행. |
-operator |
-a
and 연산, -o or 연산, ! not 연산,
\(
expression \) |
JK - Quick Start HowTo
- workers.properties is a mandatory file used by the web server and which is the same for all JK implementations (Apache/IIS/NES)
- WebServers add-ons to be set on the webserver side
Minimum workers.properties
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
httpd.conf에 추가
LoadModule jk_module libexec/mod_jk.so
AddModule mod_jk.c
JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /examples/* worker1
JK2 - Overview
2. 모듈화와 프로토콜과 물리 계층을 더욱더 구분하였습니다.
...
작성중...

Bourne Shell Scripting - Variables
변수에 문자열 저장하기
echo $name
변수에 숫자 저장하기
연산하기
Bourne Shell 종료하기
/etc/my.cnf Example
이를 변경하고자 할 경우 아래와 같이 default-character-set 부분을 추가해 주면 됩니다.
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
default-character-set=euckr
[mysql]
default-character-set=euckr
[mysql.server]
user=mysql
basedir=/var/lib/mysql
default-character-set=euckr
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
mysql 서버 재시작
/etc/init.d/mysqld restart
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | euckr |
| character_set_connection | euckr |
| character_set_database | euckr |
| character_set_filesystem | binary |
| character_set_results | euckr |
| character_set_server | euckr |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
-
?
데이터베이스 생성시에 옵션 주는게 더 좋더라.
create database default charset=euckr; -
?
어 옵션은 줘야제~