반응형

리눅스(우분투) 서버 같은 콘솔 환경에서도 Ogg, MP3, WAV 등의 음악 파일을 재생 할 수 있다.


cmus(C* Music Player)를 설치한다.


설치가 완료되면 cmus를 실행한다.


cmus가 실행되고 아무것도 표시되지 않는다. 방향키, 엔터등을 눌러도 아무런 반응이 없지만 당황하지 말고 숫자 5를 누른다.


Browser가 표시된다. 음악 파일이 있는 디렉토리로 이동한다.



원하는 파일에서 엔터키를 누르면 플레이 된다. 하지만 선택한 1개의 파일만 플레이 되므로 간단한 사용방법을 알아 보자.


각 파일에서 a키(add to library)를 눌러 준다. (y키를 누르면 playlist로 추가된다)


숫자 1을 누른다. Library 화면이 표시되고 위에서 add한 파일이 모두 추가 되었다. 원하는 곡에서 엔터키를 눌러 플레이 할 수 있다. (Artist/Album과 Track은 Tab키로 이동한다)


숫자 2를 누르면 Sorted 화면이 표시된다.



숫자 3을 누르면 Playlist 화면이 표시된다.


숫자 4를 누르면 Queue 화면이 표시된다. Queue에 추가(e)되는 노래는 순서를 무시하고 지금 재생되는 노래 다음에 재생된다. 재생 후 queue에서 자동 삭제된다.


숫자 5를 누르면 Browser 화면이 표시된다.


숫자 6을 누르면 Filters 화면이 표시된다.



숫자 7을 누르면 Settings 화면이 표시된다. 각 단축키를 확인할 수 있다. 아래는 주요 단축키 목록이다.

  • x: play

  • v: stop

  • c: pause

  • b: next

  • z: prev

  • right: seek +5

  • left: seek -5

  • -: vol -10%

  • +/=: vol +10%

  • C(대문자): toggle continue

  • r: toggle repeat

  • s: toggle shuffle

  • t: toggle show_remaining_time

  • a: add(to library)

  • e: add(to queue)

  • y: add(to playlist)

  • delete: remove

  • q: quit


WAV 파일은 aplay로 간단히 재생할 수 있다.


반응형
Posted by J-sean
:
반응형

리눅스(우분투)에서 CD-ROM/USB를 마운트하고 사용해 보자.


ls -l /dev | less 명령어로 확인해 보면 /dev/cdrom은 /dev/sr0를 가리키는 symbolic link 이다. (l)


/dev/sr0는 block device 이다. (b)


CD-ROM을 마운트할 디렉토리를 만들고 mount 한다. 마운트가 되며 쓸 수 없는(read-only) 장치라는 경고가 나온다.


mount 명령을 실행해 보면 /dev/sr0가 /home/sean/cdrom에 마운트 되어 있다.



CD의 내용을 확인할 수 있다.


다시 홈 디렉토리로 이동하고 unmount 한다.


mount 명령어로 확인해 보면 CD-ROM 마운트 정보가 없어졌다.


USB도 마찬가지 방법으로 진행한다. USB는 보통 /dev/sdb? 의 이름을 가진다.


mkdir usb

sudo mount /dev/sdb1 usb


반응형
Posted by J-sean
:
반응형

보통 이미지 뷰어는 투명 영역을 체크무늬나 검정색으로 표시한다. 이미지의 투명한 영역이 투과되어 보이는 이미지 뷰어를 사용해 보자.


투명 배경에 흰색 글자가 표시되어 있다. 흰색 배경의 브라우저를 사용한다면 위 이미지가 보이지 않는다.


pqiv를 설치한다.


pqiv -c -i -P '50, 50' sean.png 명령을 실행한다. '&' 옵션을 주지 않아도 백그라운드로 실행된다.


-c, --transparent-background

Draw pqiv's window borderless and transparent. In window mode, a mouse click activates and deactivates window decorations.


-i, --hide-info-box

Initially hide the infobox. Whether the box is visible can be toggled by pressing 'i' at runtime by default.


-P, --window-position=POSITION

Set the initial window position. POSITION may either be 'x,y'  screen coordinates or 'off' to not position the window at all.


그 외 옵션은 Ubuntu Manpage를 참고하자.


반응형
Posted by J-sean
:
반응형

리눅스(우분투) 서버에 X Window(GUI)를 설치해 보자.


sudo apt update를 실행해서 package list를 업데이트한다.


업데이트가 완료되면 sudo apt upgrade를 실행해서 package를 upgrade/install/remove한다.


sudo apt install ubuntu-desktop-minimal 명령으로 X Window 설치를 진행한다.


sudo apt install ubuntu-desktop-minimal: 최소 설치

sudo apt install ubuntu-desktop: 전체 설치


1,695 MB의 디스크 공간이 필요하다. 설치는 꽤 오랫동안 진행된다.



설치가 완료되면 startx 명령어로 X Window를 실행한다.


Welcome! 이라고 한다.


키보드를 선택한다.


내 위치정보를 공개할지 선택한다.



간단한 설정이 완료되었다.


재부팅이 필요하다.


재부팅하면 바로 X Window가 실행된다. 로그인 하자.


X Window 화면이 나타난다.



부팅시 X Window가 자동 실행되지 않도록 하려면 아래 명령어를 입력한다.


sudo systemctl set-default multi-user


부팅시 다시 X Window가 자동 실행되게 하려면 아래 명령어를 입력한다.


sudo systemctl set-default graphical


직접 Run Level을 변경해 X Window 자동 실행 여부를 결정할 수 도 있다. 현재 default.target은 graphical.target을 가리키고 있다.


multi-user.target을 가리키도록 변경한다.



재부팅하면 X Window가 아닌 Console로 부팅된다.


startx를 실행하면 약간 다른 모양의 X Window가 실행된다.


Log Out 해 보자.


다시 콘솔 화면으로 돌아간다.


X Window로 부팅하려면 아래 명령어를 입력한다.

sudo ln -sf /lib/systemd/system/graphical.target /lib/sytemd/system/default.target


반응형
Posted by J-sean
:
반응형

Samba is the standard Windows interoperability suite of programs for Linux and Unix.

Since 1992, Samba has provided secure, stable and fast file and print services for all clients using the SMB/CIFS protocol, such as all versions of DOS and Windows, OS/2, Linux and many others.


This post describes how to create a public share on Samba in Fedora Linux.


Samba를 이용해 윈도우에서도 접속 가능한 리눅스 공유 폴더를 간단히 만들 수 있다. 사용자 이름이나 암호 없이 접속 가능한 간단한 공유 폴더를 만들어 보자.


Download and install Samba package.


Edit '/etc/samba/smb.conf'


Add the following in [global].

netbios name = sean

map to guest = Bad User


Make [share] at the end and add the following in it.

path = /share

public = yes

writable = yes


Run 'testparm' and check 'smb.conf'.


Move to the root directory and make a directory you want to share.

The name of the sharing directory has to be the same as the name you assigned to 'path' in 'smb.conf' [share].


※ 'share' has read and execute permissions only for 'other'. So if you access it as an 'other', you can't write to it unless you give write permission to 'other'. (chmod 777 share)



Add Samba service to the firewall and reload it.


Start and enable Samba. To start services automatically at boot, you must enable them.


Run 'File Explorer' in Windows and access to the sharing directory in Linux by its IP address.


You can also access the directory by the name you assigned to 'netbios name' in 'smb.conf' [global]


반응형
Posted by J-sean
:
반응형

Python comes preinstalled on most Linux distributions and is available as a package on all others. However, there are certain features you might want to use that are not available on your distro’s package. You can easily compile the latest version of Python from the source.


대부분의 리눅스에는 파이썬이 포함되어 있어 바로 사용할 수 있지만 최신 버전의 파이썬 소스를 직접 컴파일해 사용할 수 도 있다.


파이썬 홈페이지에서 소스 파일 링크 주소를 확인 한다.


wget으로 소스코드를 다운 받는다.


다운 받은 소스 코드 확인.


--enable-optimizations 옵션과 함께 configure를 실행 한다.


make가 없다면 설치 한다.



make로 컴파일 한다. 지정된 디렉토리에 설치 하고 싶다면 make 실행 후 make altinstall 까지 진행 한다.


Warning: make install can overwrite or masquerade the python3 binary. make altinstall is therefore recommended instead of make install since it only installs exec_prefix/bin/pythonversion.


exec_prefix (${exec_prefix}) is installation-dependent and should be interpreted as for GNU software. For example, on most Linux systems, the default is /usr.


./python을 실행하면 컴파일된 파이썬이 실행 된다.


간단히 python명령어로 실행하기 위해 /usr/bin에 소프트 링크를 만들어 준다.


파이썬 홈페이지에서 다운 받았던 압축 파일은 삭제 한다.


dnf로 최신 버전 파이썬을 간단히 설치 할 수 도 있다.



설치가 완료되면 파이썬[버전] 형식으로 실행 할 수 있다.


Python package installer인 pip도 설치 한다. 


pip3 --version 명령으로 pip버전을 확인할 수 있다.


반응형
Posted by J-sean
:
반응형

구글 클라우드 플랫폼으로 간단한 무료 웹 서버를 만들 수 있다.

 

2021.09.04 - [Linux] - GCP Compute Engine - 구글 클라우드 컴퓨트 엔진

 

 

 

구글 클라우드 플렛폼에 가입한다.

 

왼쪽 메뉴에서 Compute Engine - VM 인스턴스를 클릭한다.

 

만들기를 클릭한다.

 

무료로 만들 수 있는 Compute Engine은 위와 같은 조건이 있지만 간단한 웹서버를 만들기에는 충분한 조건이다.

 

 

 

원하는 이름을 지정한다. 지역은 오리건, 머신 유형은 f1-micro, 부팅 디스크는 30GB 표준 영구 디스크에 CentOS 8 로 설정 했다.

방화벽에 HTTP 트래픽 허용, HTTPS 트래픽 허용을 체크하고 만들기 버튼을 클릭한다.

 

VM 인스턴스에 sean-server가 생성 되었다. 연결 - SSH를 클릭한다.

 

CentOS Linux에 SSH로 연결 되었다. Apache등을 설치하고 서버로 만들어 준다.

 

2019/10/08 - [Software/Linux] - Build your own web server with Fedora linux - 페도라 리눅스로 간단한 웹서버 만들기

 

 

반응형
Posted by J-sean
: