apt-get install samba
smbpasswd -a sinfo
vim /etc/samba/smb.conf

[homes] [homes]를 표기하는 경우, 각 사용자의 home directory (~/아이디)를 검색하여 그리로 연결해 줍니다.
comment 이 section (여기서는 homes)을 나타내는 주석입니다.
valid users 이 서비스에 로그인 가능한 사용자를 할당합니다.

%S는 서비스의 이름을 나타내는데 곧 samba를 사용할 권한이 있는 사용자가 됩니다.
browseable 네트워크 상에서 사용 가능한 공유 목록에 표시되게 할지 말지 정합니다.
read only guest 계정이 접근할 경우 등 필요 시 read only를 yes 해주시면 됩니다.


service smbd restart
ps -ef | grep samba

 

root@sinfo:~# ps -ef | grep samba
root        4027    4022  0 23:23 ?        00:00:00 /usr/lib/x86_64-linux-gnu/samba/samba-bgqd --ready-signal-fd=45 --parent-watch-fd=11 --debuglevel=0 -F
root        4186    2350  0 23:30 pts/0    00:00:00 grep --color=auto samba
root@sinfo:~#

 

<윈도우연결>

samba service를 체크한다.

탐색기에서 samba설치되어진 ip address를 입력 \\192.168.49.489후
samba설치시에 등록한 sinfo아이디 + password를 입력한다.
나타나는 화면은 다음과 같다.

위의 모습을 윈도우형식으로 보여준다. 윈도우처럼 복사 & 붙여넣기 사용가능

sed -i 's/\r//g' cron_batch.sh(엑셀에 의해서 일괄로 만들어진 파일)

-rw-r--r-- 1 release release  4305 2023-01-12 08:56 send_to_be_mst_kse.c?
-rw-r--r-- 1 release release  4808 2023-01-12 08:56 send_to_be_detail_data_p.c?
-rw-r--r-- 1 release release  3350 2023-01-12 08:56 send_to_be_mst_kosdaq.c?
-rw-r--r-- 1 release release  3828 2023-01-12 08:56 send_to_be_detail_data_cnt.c?
-rw-r--r-- 1 release release  2873 2023-01-12 08:56 send_to_be_data_kse.c?
-rw-r--r-- 1 release release 26977 2023-01-12 08:56 send_to_be_kse_jisu.c?
-rw-r--r-- 1 release release  3450 2023-01-12 08:56 send_to_be_trade.c?
-rw-r--r-- 1 release release  3386 2023-01-12 08:56 send_to_be_trade_for_master.c?
-rw-r--r-- 1 release release 11134 2023-01-12 08:56 send_to_be_kse_file.c?
-rw-r--r-- 1 release release 27946 2023-01-12 08:56 send_to_be_kosdaq_jisu.c?
-rw-r--r-- 1 release release 11769 2023-01-12 08:56 send_to_be_elw_file.c?
-rw-r--r-- 1 release release  4305 2023-01-12 09:22 send_to_be_mst_kse.c
-rw-r--r-- 1 release release  4808 2023-01-12 09:22 send_to_be_detail_data_p.c
-rw-r--r-- 1 release release  3350 2023-01-12 09:22 send_to_be_mst_kosdaq.c
-rw-r--r-- 1 release release  3828 2023-01-12 09:22 send_to_be_detail_data_cnt.c
-rw-r--r-- 1 release release  2873 2023-01-12 09:22 send_to_be_data_kse.c
-rw-r--r-- 1 release release 26977 2023-01-12 09:22 send_to_be_kse_jisu.c
-rw-r--r-- 1 release release  3450 2023-01-12 09:22 send_to_be_trade.c
-rw-r--r-- 1 release release  3386 2023-01-12 09:22 send_to_be_trade_for_master.c
-rw-r--r-- 1 release release 11134 2023-01-12 09:22 send_to_be_kse_file.c
-rw-r--r-- 1 release release 27946 2023-01-12 09:22 send_to_be_kosdaq_jisu.c
-rw-r--r-- 1 release release 11769 2023-01-12 09:22 send_to_be_elw_file.c
[release@nticker1 test_port_to_be]$

그리고 지우는 방법

1. 현재 디렉토리
find . -name "*.c?" -print -exec rm {} \;
find . -name "*.cpp?" -print -exec rm {} \;

find ./ -maxdepth 1 -name "*.c?" -print -exec rm {} \;
find ./ -maxdepth 1 -name "*.cpp?" -print -exec rm {} \;

2. 하위디렉토리
find ./ -name "*.c?" -print -exec rm {} \;
find ./ -name "*.cpp?" -print -exec rm {} \;

단 .cs .cc 같은 파일도 동시에 지워지므로, 아주 조심해서 사용해야 한다.
단 .cs .cc 같은 파일도 동시에 지워지므로, 아주 조심해서 사용해야 한다.
단 .cs .cc 같은 파일도 동시에 지워지므로, 아주 조심해서 사용해야 한다.
단 .cs .cc 같은 파일도 동시에 지워지므로, 아주 조심해서 사용해야 한다.

sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_OPTION/tickerplant.conf.internet.real.standby.x64.groupe
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_OPTION/tickerplant.conf.internet.real.standby.x64.groupe.relay
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_OPTION/tickerplant.conf.internet.real.standby.x64.groupe.koscom
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_FUTURE/tickerplant.conf.internet.real.standby.x64.groupd.relay
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_FUTURE/tickerplant.conf.internet.real.standby.x64.groupd
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_FUTURE/tickerplant.conf.internet.real.standby.x64.groupd.koscom
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_KSE/tickerplant.conf.internet.real.standby.x64.groupa
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_KSE/tickerplant.conf.internet.real.standby.x64.groupa.koscom
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_KSE/tickerplant.conf.internet.real.standby.x64.groupa.relay
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_KOSDAQ/tickerplant.conf.internet.real.standby.x64.groupb.koscom
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_KOSDAQ/tickerplant.conf.internet.real.standby.x64.groupb.relay
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_KOSDAQ/tickerplant.conf.internet.real.standby.x64.groupb
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_ELW/tickerplant.conf.internet.real.standby.x64.groupc.koscom
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_ELW/tickerplant.conf.internet.real.standby.x64.groupc
sed -i 's/STANDBY/ACTIVE/gi' ./INTERNET_ELW/tickerplant.conf.internet.real.standby.x64.groupc.relay



우분투 NTP 시간 동기화 설정/우분투 NTP 시간 동기화 설정/우분투 NTP 시간 동기화 설정
우분투 NTP 시간 동기화 설정/우분투 NTP 시간 동기화 설정/우분투 NTP 시간 동기화 설정
우분투 NTP 시간 동기화 설정/우분투 NTP 시간 동기화 설정/우분투 NTP 시간 동기화 설정

0.
apt-get install -y ntp

1.
root@sinfo:~# vi /etc/ntp.conf

>>주석처리
#pool 0.ubuntu.pool.ntp.org iburst
#pool 1.ubuntu.pool.ntp.org iburst
#pool 2.ubuntu.pool.ntp.org iburst
#pool 3.ubuntu.pool.ntp.org iburst
>>추가
server 1.kr.pool.ntp.org
server 1.asia.pool.ntp.org
server time.bora.net
server 203.248.240.140 iburst


2.
>>ntp 서비스 실행
root@sinfo:~#systemctl start ntp (서비스 실행)
root@sinfo:~#systemctl status ntp (서비스 상태 확인)

root@sinfo:~#
root@sinfo:~#
root@sinfo:~# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 0.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 1.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 2.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 3.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 ntp.ubuntu.com  .POOL.          16 p    -   64    0    0.000    0.000   0.000
 ap-northeast-2. 10.84.87.146     2 u   24   64    5    3.934   -1.094   8.041
 x.ns.gin.ntt.ne 129.250.35.222   2 u   31   64    7   35.498   -4.566   0.861
 time.bora.net   101.55.81.10     3 u   96   64    2    4.299   -3.241   0.000
-106.247.248.106 216.239.35.0     2 u   25   64    7    2.822    2.408   0.928
+121.174.142.81  220.73.142.66    3 u   23   64    7    9.265   -0.952   1.292
*193.123.243.2   125.185.190.74   2 u   25   64    7    2.322   -0.115   1.223
+send.mx.cdnetwo 125.185.190.74   2 u   23   64    7    2.355   -0.387   1.212
-ntp1.torix.ca   .PTP0.           1 u   21   64    7  177.186   -4.221   1.216
-ns2.tdc.akl.tel 202.46.178.18    2 u   18   64    7  189.169    0.644   1.666
 185.125.190.58  167.28.20.25     2 u   21   64    7  237.671   -8.107   0.991
-ntp4.flashdance 192.36.143.150   2 u   20   64    7  243.052   -4.914   1.725
 185.125.190.57  167.28.20.25     2 u   20   64    7  239.424   -7.351   0.919
-magnat.ip-conne 31.28.161.68     2 u   21   64    7  268.196  -10.977   1.606
 alphyn.canonica 142.3.100.2      2 u   24   64    7  206.479   11.904   0.847
 pugot.canonical 17.253.108.125   2 u   17   64    7  255.509    1.233   1.575
 185.125.190.56  179.208.94.190   2 u   21   64    7  232.582   -6.133   1.044



4.
UTC(협정 세계시)로 설정됨

root@sinfo:~# date
Sat 31 Dec 2022 06:19:36 AM UTC
root@sinfo:~#
root@sinfo:~#
root@sinfo:~#



5. 
서울 시간(KST)로 변경 해 됨겠습니다.
root@sinfo:~# timedatectl set-timezone Asia/Seoul
root@sinfo:~# date
Sat 31 Dec 2022 03:20:11 PM KST
root@sinfo:~#
root@sinfo:~#

Linux sinfo 5.4.0-135-generic #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

1.1
1.  swap(2,048)  -> 10,000
2.  /boot(100)   ->  2,000
3.  /(3,072)     -> 12,000
4.  /usr(8,192)  -> 70,000
5.  /usr2(90,000)-> 90,000
6.  /var(4,096)  -> 12,000
7.  /tmp(4,096)  -> 12,000
8.  /data(70,000)-> 70,000
9.  /home(2,000) ->  2,000
10. /web(나머지 부분을 할당, 체크)

2.1
sudo passwd root

3.2
userdel sinfo

groupadd other
useradd -d /usr2/sinfo -s /bin/bash -g other -m sinfo
passwd sinfo

4.1
$apt install telnetd -y
$systemctl status inetd

5.1
$apt-get install vsftpd
$systemctl restart vsftpd
$vi /etc/vsftpd.conf
/*------------------------------------
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES
local_root=/data/ftp/files
write_enable=YES
local_umask=022
dirmessage_enable=YES
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
------------------------------------*/
/*------------------------------------
write_enable=YES
write_enable=YES
write_enable=YES
write_enable=YES
------------------------------------*/
$systemctl restart vsftpd

6.1
$gcc --version
$apt update
$apt install build-essential

7. 원하는 버전의 gcc 설치
$apt -y install gcc-7 g++-7 gcc-8 g++-8 gcc-9 g++-9

8. gcc default 설정 (명령어 뒤 700, 800, 900은 임의 숫자 적용)

$update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700
$update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 700 
$update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800
$update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 800
$update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 900
$update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 900

9. default 설정 확인 및 변경
$update-alternatives --config gcc
$update-alternatives --config g++

root@sinfo:~# update-alternatives --config gcc
There are 3 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path            Priority   Status
------------------------------------------------------------
* 0            /usr/bin/gcc-9   900       auto mode
  1            /usr/bin/gcc-7   700       manual mode
  2            /usr/bin/gcc-8   800       manual mode
  3            /usr/bin/gcc-9   900       manual mode

Press <enter> to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/bin/gcc-7 to provide /usr/bin/gcc (gcc) in manual mode


root@sinfo:~# update-alternatives --config g++
There are 3 choices for the alternative g++ (providing /usr/bin/g++).

  Selection    Path            Priority   Status
------------------------------------------------------------
* 0            /usr/bin/g++-9   900       auto mode
  1            /usr/bin/g++-7   700       manual mode
  2            /usr/bin/g++-8   800       manual mode
  3            /usr/bin/g++-9   900       manual mode

Press <enter> to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/bin/g++-7 to provide /usr/bin/g++ (g++) in manual mode

10.
source ~/.bash_profile
source ~/.bashrc

>등록
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-3.3
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9

>선택
update-alternatives --config g++ 

nohup 명령어는 리눅스에서 프로세스를 실행한 터미널의 세션 연결이 끊어지더라도 지속적으로 동작 할 수 있게 해주는 명령어입니다.

#create
alias exe='cd /usr2/sinfo/exe/'
alias shell='cd /usr2/sinfo/exe/shell'
alias src='cd /usr2/sinfo/src/'
alias log='cd /usr2/sweb/logs/receive/'
alias manage='cd /usr2/sweb/data/manage/'

source ~/.bashrc

etc>
-bash-3.00$ source .bashrc_backup
-bash: .bashrc_backup: line 7: syntax error: unexpected end of file


-bash-3.00$ file /home/www/work/.bashrc
/home/www/work/.bashrc: ASCII text, with CRLF line terminators



-bash-3.00$ perl -pi -e "s/\r//g" .bashrc
-bash-3.00$ file .bashrc
.bashrc: ASCII text
-bash-3.00$ source .bashrc


#delete
unalias exe
unalias shell
unalias src
unalias log
unalias manage

+ Recent posts