#!/bin/sh
SHMID=`ipcs -m | grep $USER | cut -d " " -f2`
SEMID=`ipcs -s | grep $USER | cut -d " " -f2`
MSQID=`ipcs -q | grep $USER | cut -d " " -f2`
for shm in $SHMID
do
ipcrm -m $shm
done
for sem in $SEMID
do
ipcrm -s $sem
done
for msq in $MSQID
do
ipcrm -q $msq
done
2017년 12월 18일 월요일
2017년 4월 4일 화요일
[리눅스,유닉스] 공백이나 특수문자 등으로 시작하는 파일 지우기
종종 시스템에 웃지 못할 파일이 있는 경우
즉, 공백이나 특수문자, 혹은 - 문자로 시작하는 파일도 지울 수 없을 때 사용
$ ls -ltri
702887 -rw-r--r-- 1 perf users 566 Apr 5 08:06 perftest.sh
630368 -rw-r--r-- 1 perf users 2252 Apr 5 08:07 compare.sh
702892 drwxrwxrwx 8 perf users 1024 Apr 5 08:07 work
5486485 -rw-rw-rw- 1 perf users 566 Apr 5 08
5486498 -rw-r--r-- 1 perf users 35200 Apr 5 09:31 perf.tar
$ find . -inum 5486485 -exec rm -f {} \;
$ ls -ltri
702887 -rw-r--r-- 1 perf users 566 Apr 5 08:06 perftest.sh
630368 -rw-r--r-- 1 perf users 2252 Apr 5 08:07 compare.sh
702892 drwxrwxrwx 8 perf users 1024 Apr 5 08:07 work
5486498 -rw-r--r-- 1 perf users 35200 Apr 5 09:31 perf.tar
즉, 공백이나 특수문자, 혹은 - 문자로 시작하는 파일도 지울 수 없을 때 사용
$ ls -ltri
702887 -rw-r--r-- 1 perf users 566 Apr 5 08:06 perftest.sh
630368 -rw-r--r-- 1 perf users 2252 Apr 5 08:07 compare.sh
702892 drwxrwxrwx 8 perf users 1024 Apr 5 08:07 work
5486485 -rw-rw-rw- 1 perf users 566 Apr 5 08
5486498 -rw-r--r-- 1 perf users 35200 Apr 5 09:31 perf.tar
$ find . -inum 5486485 -exec rm -f {} \;
$ ls -ltri
702887 -rw-r--r-- 1 perf users 566 Apr 5 08:06 perftest.sh
630368 -rw-r--r-- 1 perf users 2252 Apr 5 08:07 compare.sh
702892 drwxrwxrwx 8 perf users 1024 Apr 5 08:07 work
5486498 -rw-r--r-- 1 perf users 35200 Apr 5 09:31 perf.tar
2017년 3월 20일 월요일
Query exercise
직업별 컬럼을 생성하여 정리하되 doctor, professor, singer, actor순서로 정렬하며
각 컬럼은 alpabet 오름 차순으로 정렬
Data
iSQL> select * from occupations;
NAME OCCUPATION
-----------------------------------------------
Ashley Professor
Samantha Actor
Julia Doctor
Britney Professor
Maria Professor
Meera Professor
Priya Doctor
Priyanka Professor
Jennifer Actor
Ketty Actor
Belvet Professor
Naomi Professor
Jane Singer
Jenny Singer
Kristeen Singer
Christeen Singer
Eve Actor
Aamina Doctor
18 rows selected.
Output
DOCTOR PROFESSOR SINGER ACTOR
---------------------------------------------------------------------------------------------
Aamina Ashley Christeen Eve
Julia Belvet Jane Jennifer
Priya Britney Jenny Ketty
Maria Kristeen Samantha
Meera
Naomi
Priyanka
7 rows selected.
문제 출처: hackerrank
My Answer
select doctor, professor, singer, actor from
(
select rownum rown from (select name as doctor from occupations where occupation = 'Doctor' order by name)
union
select rownum rown from (select name as professor from occupations where occupation = 'Professor' order by name)
union
select rownum rown from (select name as singer from occupations where occupation = 'Singer' order by name)
union
select rownum rown from (select name as actor from occupations where occupation = 'Actor' order by name)
) main,
(select rownum rown, doctor from (select name as doctor from occupations where occupation = 'Doctor' order by name)) a,
(select rownum rown, professor from (select name as professor from occupations where occupation = 'Professor' order by name)) b,
(select rownum rown, singer from (select name as singer from occupations where occupation = 'Singer' order by name)) c,
(select rownum rown, actor from (select name as actor from occupations where occupation = 'Actor' order by name)) d
where main.rown=a.rown(+)
and main.rown=b.rown(+)
and main.rown=c.rown(+)
and main.rown=d.rown(+);
각 컬럼은 alpabet 오름 차순으로 정렬
Data
iSQL> select * from occupations;
NAME OCCUPATION
-----------------------------------------------
Ashley Professor
Samantha Actor
Julia Doctor
Britney Professor
Maria Professor
Meera Professor
Priya Doctor
Priyanka Professor
Jennifer Actor
Ketty Actor
Belvet Professor
Naomi Professor
Jane Singer
Jenny Singer
Kristeen Singer
Christeen Singer
Eve Actor
Aamina Doctor
18 rows selected.
Output
DOCTOR PROFESSOR SINGER ACTOR
---------------------------------------------------------------------------------------------
Aamina Ashley Christeen Eve
Julia Belvet Jane Jennifer
Priya Britney Jenny Ketty
Maria Kristeen Samantha
Meera
Naomi
Priyanka
7 rows selected.
문제 출처: hackerrank
My Answer
select doctor, professor, singer, actor from
(
select rownum rown from (select name as doctor from occupations where occupation = 'Doctor' order by name)
union
select rownum rown from (select name as professor from occupations where occupation = 'Professor' order by name)
union
select rownum rown from (select name as singer from occupations where occupation = 'Singer' order by name)
union
select rownum rown from (select name as actor from occupations where occupation = 'Actor' order by name)
) main,
(select rownum rown, doctor from (select name as doctor from occupations where occupation = 'Doctor' order by name)) a,
(select rownum rown, professor from (select name as professor from occupations where occupation = 'Professor' order by name)) b,
(select rownum rown, singer from (select name as singer from occupations where occupation = 'Singer' order by name)) c,
(select rownum rown, actor from (select name as actor from occupations where occupation = 'Actor' order by name)) d
where main.rown=a.rown(+)
and main.rown=b.rown(+)
and main.rown=c.rown(+)
and main.rown=d.rown(+);
2016년 11월 14일 월요일
Linux 시간 설정 (rdate, date, hwclock )
1. 하드웨어 시간 확인
#> hwclock -r
2. 소프트웨어 시간 확인
$, #> date
3. 자동 설정
#> rdate -s time.bora.net
4.수동 설정
#> date -s "2016-11-15 09:40:05"
5.하드웨어 시간 설정
#> hwclock --localtime --systohc
권한 설명
---------------------------
# 루트 권한만 가능
$ 일반 유저도 가능
#> hwclock -r
2. 소프트웨어 시간 확인
$, #> date
3. 자동 설정
#> rdate -s time.bora.net
4.수동 설정
#> date -s "2016-11-15 09:40:05"
5.하드웨어 시간 설정
#> hwclock --localtime --systohc
권한 설명
---------------------------
# 루트 권한만 가능
$ 일반 유저도 가능
2016년 11월 9일 수요일
linux파일 ip_address에서 select distinct(ip_address) from table명 효과내기
[codehexa@codehexa logs]$ cat ip_address | sort | uniq
192.168.11.103
192.168.11.5
192.168.12.12
192.168.12.14
192.168.12.16
192.168.12.23
192.168.12.7
192.168.15.10
192.168.16.16
192.168.16.17
192.168.16.250
192.168.16.8
192.168.3.107
192.168.3.109
192.168.3.13
192.168.3.141
192.168.3.145
192.168.3.177
192.168.3.20
192.168.3.21
192.168.3.28
192.168.3.30
192.168.3.50
192.168.3.6
192.168.6.120
192.168.6.121
192.168.6.122
192.168.6.124
192.168.6.126
192.168.6.127
192.168.6.128
192.168.6.130
192.168.6.131
192.168.6.135
192.168.11.103
192.168.11.5
192.168.12.12
192.168.12.14
192.168.12.16
192.168.12.23
192.168.12.7
192.168.15.10
192.168.16.16
192.168.16.17
192.168.16.250
192.168.16.8
192.168.3.107
192.168.3.109
192.168.3.13
192.168.3.141
192.168.3.145
192.168.3.177
192.168.3.20
192.168.3.21
192.168.3.28
192.168.3.30
192.168.3.50
192.168.3.6
192.168.6.120
192.168.6.121
192.168.6.122
192.168.6.124
192.168.6.126
192.168.6.127
192.168.6.128
192.168.6.130
192.168.6.131
192.168.6.135
2014년 4월 8일 화요일
Orange tool에서 Autocommit mode설정하기
피드 구독하기:
글 (Atom)
리눅스 문자와숫자 조합의 파일이름 정렬( Sort alphanumeric filenames in Linux )
아래 처럼 문자와 숫자가 섞여 있는 파일에 대해서 정렬이 제대로 되지 않을 때 When sorting is not done properly for files with mixed letters and numbers as shown below [codeh...
-
우선 메뉴에서 Tools아래 Orange Options를 선택 후 Common의 Session에서 Commit automatically after every statement를 체크하면 Autocommit is On으로 변경됨 ...
-
아래 내용으로 demobld.sql 파일을 생성한다. -- -- Copyright (c) Oracle Corporation 1988, 1999. All Rights Reserved. -- -- NAME -- demobld.sql -- ...
-
Install Python certificates! (A common issue on macOS.) Open these files: Install Certificates.command Update Shell Profile.command ...

