[Raspbian] Can’t locate Gtk3.pm in @INC

Synaptic 깔고 패키지 설치해보면 아래와 같은 에러가 뜬다.

해결방법은 libgtk3-perl 패키지를 설치해주면 된다.

 

debconf: unable to initialize frontend: Gnome
debconf: (Can’t locate Gtk3.pm in @INC (you may need to install the Gtk3 module) (@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabihf/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/arm-linux-gnueabihf/perl5/5.28 /usr/share/perl5 /usr/lib/arm-linux-gnueabihf/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/arm-linux-gnueabihf/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Gnome.pm line 151, <> line 3.)

 

참고: https://www.linuxquestions.org/questions/bodhi-92/can%27t-locate-gtk3-pm-4175657312/

[Raspbian] 기본 사용자인 ‘pi’ 지우기

Raspbian 설치 후에 기본 사용자인 pi를 지우고, 내 아이디를 쓰고 싶어서 지워봤다.

ssh 같은거 열면 pi로 막 들어올까봐…

모든 작업은 root로 진행했다.

 

  1. 내 ID 추가

adduser dasomoli

  1. 내 ID를 sudo 그룹으로 넣기

usermod -aG sudo dasomoli

  1. pi 사용자와 같은 그룹으로 만들기
    cat /etc/group | grep pi
    usermod -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,netdev,spi,i2c,gpio dasomoli

  2. polkit local authority 설정

vi /etc/polkit-1/localauthority.conf.d/60-desktop-policy.conf

AdminIdentities=unix-group:sudo;unix-user:0

  1. lightdm 설정

vi /etc/lightdm/lightdm.conf

autologin-user=dasomoli

  1. systemd 설정

vi /etc/systemd/system/autologin@.service

ExecStart=-/sbin/agetty –autologin dasomoli –noclear %I $TERM

vi /etc/systemd/system/getty@tty1.service.d/autologin.conf

ExecStart=-/sbin/agetty –autologin dasomoli –noclear %I $TERM

  1. 재부팅 후 내 ID로 로그인

  2. pi 지우기

deluser –remove-home –remove-all-files pi

delgroup pi

 

참고: https://www.raspberrypi.org/forums/viewtopic.php?t=202618

[ffmpeg] 여러 개의 동영상 한꺼번에 합치기

  1. ffmpeg를 https://ffmpeg.org/download.html 에서 받아서 압축을 푼 후, PATH 환경 변수에 해당 경로를 추가해서 커맨드 프롬프트에서 실행 가능하도록 만든다.

  2. 여러 동영상 파일명을 적은 Text file을 하나 만든다.

[code]
file ‘StepByStep/01_1-3/1-3-2.m4v’
file ‘StepByStep/01_1-3/1-3-3.m4v’
file ‘StepByStep/01_1-3/1-3-4.m4v’
file ‘StepByStep/01_1-3/1-3-5.m4v’
file ‘StepByStep/01_1-3/1-3-6.m4v’
file ‘StepByStep/01_1-3/1-3-7.m4v’
file ‘StepByStep/01_1-3/1-3-8.m4v’
file ‘StepByStep/01_1-3/1-3-9.m4v’
file ‘StepByStep/01_1-3/1-3-10.m4v’
file ‘StepByStep/01_1-3/1-3-11.m4v’
file ‘StepByStep/01_1-3/1-3-12.m4v’
file ‘StepByStep/01_1-3/1-3-13.m4v’
file ‘StepByStep/01_1-3/1-3-14.m4v’
file ‘StepByStep/01_1-3/1-3-15.m4v’
file ‘StepByStep/01_1-3/1-3-16.m4v’
file ‘StepByStep/01_1-3/1-3-17.m4v’
file ‘StepByStep/01_1-3/1-3-18.m4v’
file ‘StepByStep/01_1-3/1-3-19.m4v’
file ‘StepByStep/01_1-3/1-3-20.m4v’
file ‘StepByStep/01_1-3/1-3-21.m4v’
file ‘StepByStep/01_1-3/1-3-22.m4v’
file ‘StepByStep/01_1-3/1-3-23.m4v’
file ‘StepByStep/01_1-3/1-3-24.m4v’
file ‘StepByStep/01_1-3/1-3-25.m4v’
file ‘StepByStep/01_1-3/1-3-26.m4v’
file ‘StepByStep/01_1-3/1-3-27.m4v’
file ‘StepByStep/01_1-3/1-3-28.m4v’
file ‘StepByStep/01_1-3/1-3-29.m4v’
file ‘StepByStep/01_1-3/1-3-30.m4v’
file ‘StepByStep/01_1-3/1-3-31.m4v’
file ‘StepByStep/01_1-3/1-3-32.m4v’
file ‘StepByStep/01_1-3/1-3-33.m4v’
file ‘StepByStep/01_1-3/1-3-34.m4v’
file ‘StepByStep/01_1-3/1-3-35.m4v’
file ‘StepByStep/01_1-3/1-3-36.m4v’
[/code]

만드는데 쓴 bash shell 명령은 다음과 같다.

[code]
for DIR in `ls`; do pushd $DIR; for FILE in `ls -tr`; do echo "file ‘StepByStep/`basename \`pwd\“/$FILE’"; done > ../../`basename \`pwd\`.txt`; popd; done
[/code]

3.  다음 명령어를 커맨드 프롬프트에서 실행한다.

[code]
ffmpeg -f concat -i filename.txt -c copy -fflags +genpts output.mp4
[/code]

이걸 디렉토리 별로 돌린 bash shell 명령은 다음과  같다

[code]
for TXT in `ls *.txt`; do ffmpeg -f concat -i $TXT -c copy -fflags +genpts `echo $TXT | cut -d. -f1`.mp4; done;
[/code]

 

참고: https://superuser.com/questions/1039678/merge-multiple-video-with-ffmpeg-single-command-line-in-specific-time-without-cu

 

moniwiki 설치

글 정리할 때 익숙한 건 역시 moniwiki다. 다시 설치하려니 github로 옮겨가고, wikiseed 심는 것도 따로 프로젝트를 따로 뒀던데 다시 설치하는 절차를 정리한다.

설치하려는 디렉토리 아래(난 /var/www/)에서 git clone

[code]
git clone https://github.com/wkpark/moniwiki.git
chown -R www-data:www-data moniwiki
cd moniwiki/
git clone https://github.com/wkpark/moniwiki-wikiseed.git wikiseed
cd theme/
git clone https://github.com/wkpark/moniwiki-theme-paper.git paper
git clone https://github.com/wkpark/moniwiki-theme-bootstrap3.git bootstrap3
git clone https://github.com/wkpark/moniwiki-theme-publish.git publish
[/code]

브라우저에서 monisetup.php 접속

  1.  $sitename 설정
  2.  $admin_passwd 설정
  3.  $use_sectionedit 설정
  4.  “Sow wikiseed” 로 wiki seed 심기

추가로 config.php 에서 고치기

http://blog.dasomoli.org/240 참고

쉘에서 secure.sh 실행

[code]
sh secure.sh
[/code]

apache2 설정

/etc/apache2/sites-available/moniwiki.dasomoli.org.conf

[code]
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request’s Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName moniwiki.dasomoli.org

<Directory /var/www/moniwiki>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>

ServerAdmin dasomoli@gmail.com
DocumentRoot /var/www/moniwiki

# Available loglevels: trace8, …, trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/moniwiki_error.log
CustomLog ${APACHE_LOG_DIR}/moniwiki.access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with “a2disconf”.
Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
[/code]

moniwiki 디렉토리에 index.html 생성

/var/www/moniwiki/index.html

[code]
<html>
<head>
<meta http-equiv=”refresh” content=”0; url=./wiki.php”>
</head>
<body onload=”javascript:window.location=’./wiki.php'”>
Please follow <a href=”wiki.php”>this link</a>
</body>
</html>
[/code]

[vi] .vimrc

.vimrc 같은건 대충 필요한 것만 그때 그때 써서 썼는데 새 환경에서 하나하나 쓰려니 귀찮다. 복사해서 쓸 수 있게 여기다 하나 써두고 업데이트하자.

syntax on

set autoindent
set cindent
:set smartindent
set noexpandtab

set nu

set hlsearch

set ts=4
set shiftwidth=4

set laststatus=2
set statusline=\ %<%l:%v\ [%P]%=%a\ %h%m%r\ %F\
set incsearch

colorscheme elflord

set tags=./tags,tags
set tags+=/usr/src/linux/tags
set tags+=../tags
set tags+=../../tags
set tags+=../../../tags

highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/

https://medium.com/sunhyoups-story/vim-%EC%97%90%EB%94%94%ED%84%B0-%EC%9D%B4%EC%81%98%EA%B2%8C-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-5b6b8d546017

[Windows] Command Prompt의 Current Code page 변경

Windows에서 명령줄을 띄워서 작업할 때, 어떤 에러 메시지 등을 google에서 찾아보고 싶은 경우 같은 때, 나오는 메시지의 언어를 바꾸고 싶을 때가 있다. 이럴 때 “LANG” 환경 변수 등을 바꾸어도 그대로 에러 메시지 등이 우리말로 나온다. 요건 mingw 같은 환경에서 shell을 써도 마찬가지. 한국판 Windows를 깔면 기본이 CP949로 설정되어 에러 메시지 등이 우리말로 나오는 것인데, 다음과 같이 CHCP 명령을 이용하면 된다. 65001은 UTF-8이다.

CHCP 65001

참고: https://superuser.com/questions/269818/change-default-code-page-of-windows-console-to-utf-8