"Linux"의 두 판 사이의 차이

ph
이동: 둘러보기, 검색
75번째 줄: 75번째 줄:
  
 
===network configuration examples (ubuntu)===
 
===network configuration examples (ubuntu)===
https://help.ubuntu.com/community/NetworkConfigurationCommandLine/Automatic
+
[https://help.ubuntu.com/community/NetworkConfigurationCommandLine/Automatic help.ubuntu.com]
 
* Setting/changing the hostname
 
* Setting/changing the hostname
 
* Finding your network interface
 
* Finding your network interface

2017년 9월 12일 (화) 15:43 판

한글 나오게 하기

.bashrcexport LANG=ko_KR.UTF-8

X에 한글글꼴이 없을 수 있음. 그러면 윈도우에 글꼴 몇개 가져다가/usr/share/fonts/ms/에 넣고

# cd /usr/share/fonts/ms
# mkfontscale
# ttmkfdir
# fc-cache
# chmod -R a+r /usr/share/fonts/msfont

이렇게 하면 됨. 글꼴파일 이름이 한글이어도 정상동작했고 firefox에서 자동으로 인식했음. 터미널에는 글꼴 없어도 export LANG만 가지고도 됨.여기참고했음. 나는 fonts.dir, fonts.cache-1같은것이 생기지 않았기 때문에 저 중에 무언가를 빼도 될것같기도 함.


gcc설치

yum groupinstall 'Development Tools'


selinux

  • see /etc/sysconfig/iptables (if you cannot access port 80 at remote place)
    1. Modify that file or
    2. Use the system-config-firewall command
    3. if this is not a problem, see this CentOS wiki page
      • semanage port -a -t http_port_t -p tcp 81
  • Use setenforce command instead of echo 0 > /selinux/enforce (Because just simple. no other reasons)
  • ls -Z
  • ps -ZC httpd
    • or ps -eZ


Base64 decode to file

perl -MMIME::Base64 -ne 'print decode_base64($_)' < file.txt > out

http://wvarner.blogspot.com/2008/06/base64-decode-to-file.html

core file

cat /proc/sys/kernel/core_pattern

https://superuser.com/questions/849099/where-does-ubuntu-14-04-drop-core-files

network issues

gateway ip

 $ route -n
 $ netstat -r -n
 $ ip route show 

gateway가 아예 안나올 때(via ~가 보이지 않는다거나 route에서 gateway가 *.*.*.*)가 있던데 이건 어떤 경우인지 모르겠다.
www.cyberciti.biz

ip route examples

 ip route add 192.168.1.0/24 dev eth0
 ip route add default via 192.168.1.254
 ip route delete 192.168.1.0/24 dev eth0

www.cyberciti.biz

ip collision detect : arp-scan

$ sudo apt-get install arp-scan
$ arp-scan -I eth0 -l | grep 192.168.1.42
 192.168.1.42 d4:eb:9a:f2:11:a1 (Unknown)
 192.168.1.42 f4:23:a4:38:b5:76 (Unknown) (DUP: 2)

askubuntu.com

When ifdown is not working

$ sudo ifconfig eth0 down

http://unix.stackexchange.com/a/50604/31363

flushing interface

ip addr flush dev enp2s0

http://askubuntu.com/a/875180/400331

Set DNS manually

/etc/resolvconf/resolv.conf.d/base
nameserver 8.8.8.8
nameserver 8.8.4.4
sudo resolvconf -u

askubuntu.com

network configuration examples (ubuntu)

help.ubuntu.com

  • Setting/changing the hostname
  • Finding your network interface
  • Disable network managers and/or wicd
  • Configuring an interface
  • Setting up a second IP address or Virtual IP address
  • Howto set MTU for a connection
  • Setting up DNS
  • Wireless

etc

ssh

ssh alias

edit ~/.ssh/config

Host myremote             # any name for the host
HostName 192.168.178.05   # IP, .local, or hostname if defined
User username             # your username
Port 22                   # port to listen

and then, ssh myremote
http://askubuntu.com/questions/257472/host-alias-for-ssh askubuntu.com

sshd restart

# sudo service ssh restart

or

# /etc/init.d/ssh restart

https://www.cyberciti.biz/faq/howto-restart-ssh/

centos 7 sshd service not found

systemctl enable sshd.service
systemctl start sshd.service
systemctl status sshd.service

https://www.digitalocean.com/community/questions/centos-7-sshd-service-not-found

kill x-server (stop lightdm)

ctrl + alt + F1 : to switch terminal. cf) ctrl+alt+F7 to switch x-window

sudo service lightdm stop

or

sudo /etc/init.d/lightdm stop 
# or 
sudo service lightdm stop
# lightdm can be known by this.
cat /etc/X11/default-display-manager

askubuntu.com askubuntu.comaskubuntu.com

“Required key not available” when install 3rd party kernel modules

or after a kernel upgrade.
To resolve this, disable Secure Boot in UEFI(BIOS) settings.
askubuntu.com

my Ubuntu version

lsb_release -a

help.ubuntu.com

symbolic link의 chown

-h 옵션을 같이 쓸 것. no dereference option.

https://superuser.com/a/68688

sudo without password

sudo visudo

In the bottom of the file, type the follow:

username ALL=(ALL) NOPASSWD: ALL

https://askubuntu.com/a/147265/400331

network

add static routes in Ubuntu

# vi /etc/network/interfaces
...
up ip route add 192.168.0.0/24 

https://askubuntu.com/a/168037/400331

Flushing dhcp

dhclient -r

https://askubuntu.com/q/151958/400331

Upgrade single package

apt-get install --only-upgrade <packagename>

https://askubuntu.com/a/44124/400331

discussion

blog comments powered by Disqus