Google Code Prettify - 輕量級的語法上色工具

顯示具有 Linux 標籤的文章。 顯示所有文章
顯示具有 Linux 標籤的文章。 顯示所有文章

星期二, 8月 18, 2015

How to create and extract zip, tar, tar.gz and tar.bz2 files in Linux

Quick Note: If you’re looking for the Windows version of this tutorial, you can find it at How to Open tar.gz Files in Windows.
I use the zip format for files that I might need to share with Windows users.
I like to use the tar.gz format for files that I would only use on my Mac and Linux machines.

ZIP

# zip -r archive_name.zip directory_to_compress
# unzip archive_name.zip

TAR

# tar -cvf archive_name.tar directory_to_compress
# tar -xvf archive_name.tar.gz
This will extract the files in the archive_name.tar archive in the current directory. Like with the tar format you can optionally extract the files to a different directory:
# tar -xvf archive_name.tar -C /tmp/extract_here/

TAR.GZ

# tar -zcvf archive_name.tar.gz directory_to_compress
# tar -zxvf archive_name.tar.gz

This will extract the files in the archive_name.tar.gz archive in the current directory. Like with the tar format you can optionally extract the files to a different directory:
# tar -zxvf archive_name.tar.gz -C /tmp/extract_here/

TAR.BZ2

# tar -jcvf archive_name.tar.bz2 directory_to_compress
# tar -jxvf archive_name.tar.bz2 -C /tmp/extract_here/
http://www.simplehelp.net/2008/12/15/how-to-create-and-extract-zip-tar-targz-and-tarbz2-files-in-linux/

星期四, 8月 06, 2015

Linux的網路芳鄰smbclient

查目錄
[administrator@dns2 ~]$ smbclient -L //file.universe.com.tw/ -U leon_chen
Enter leon_chen's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.18]

        Sharename       Type      Comment
        ---------       ----      -------
        10_整合_企劃資源 Disk
        11_整合_進行中專案 Disk
        12_整合_結束專案 Disk
        20_設計部    Disk
        30_編輯部    Disk
        40_離職員工資料 Disk
        50_分享       Disk
        homes           Disk      user home
        photo           Disk      System default shared folder
        IPC$            IPC       IPC Service ()

沒輸入目路名稱是進不去的
[administrator@dns2 ~]$ smbclient  //file.universe.com.tw/ -U leon_chen
Enter leon_chen's password:

進入目錄
[administrator@dns2 ~]$ smbclient  //file.universe.com.tw/50_分享/ -U leon_chen
Enter leon_chen's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.18]
smb: \>

星期四, 10月 10, 2013

centos 使用yum 安裝 webmin

1. 需要先建立 webmin 的下載說明及位置
   指令:  vim /etc/yum.repos.d/webmin.repo

[Webmin]
name=Webmin Distribution Neutral
baseurl=http://download.webmin.com/download/yum
enabled=1
   存檔即可

2. 使用yum 下載安裝
指令1: yum install webmin
指令2: yum install gcc openssl openssl-devel

3.連上控制網址 http://localhost(ip):10000  port 預設10000 或是 https://localhost(ip):10000
  若連不上 請先打
  指令: netstat -ntl 看一下 有沒有 0.0.0.0:10000 的PORT 開啟,沒有代表webmin 沒有啟動在打
  指令: service webmin restart
  若是有開啟時,卻連不上,應該是iptables 開啟來的關係...可以先service iptables stop 來測試是不是防火牆的關係

4.設定 webmin 的語系(有BIG5及UTF8) 在 webmin/webmin configration /language 改成中文檔
   在更改 監聽的 PORT 如 9999  請大於 1024 避開常用的PORT 如 3389 8080 等

5.新增防火牆規則 開啟 對 port 9999 的連線即可~
指令: vi /etc/sysconfig/iptables
新增內容
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport  9999 -j ACCEPT
存檔離開即可

http://lifetype.phc.edu.tw/post/2/616

星期四, 10月 03, 2013

Ubuntu 10.04 在更換網卡後如何刪除系統中隱藏的設備資訊

http://blog.miniasp.com/post/2011/01/22/How-to-rename-Network-Interface-using-udev-in-Ubuntu.aspx

CentOS setup static Network

手動
ifconfig eth0 210.244.49.163 netmask 255.255.255.128
route del default
route add default gw 210.244.49.253
echo "nameserver 210.244.49.170" > /etc/resolv.conf

啟動 eth0
ifconfig eth0 up

開機自動
#設定ip及mask
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:15:5D:31:A0:00
TYPE=Ethernet
UUID=6a5c6654-6e7e-4fd0-98aa-d71d28d5ecf1
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=210.244.49.162
'PREFIX=25
NETMASK=255.255.255.128
DEFROUTE=yes

#'IPV4_FAILURE_FATAL=yes
#'IPV6INIT=no
#'NAME=eth0
#'USERCTL=no

#設定Gateway(default route)
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=cewb
GATEWAY=210.244.49.253

#設定 DNS ((nameserver )
vi /etc/resolv.conf
search nidify.com
nameserver 210.244.49.170 #第一個 nameserver (primary DNS)
nameserver 8.8.8.8 #第二個 nameserver (secondary DNS)

reboot

http://blog.miniasp.com/post/2012/07/30/CentOS-63-Minimal-Installation-and-Configuration-Notes.aspx
http://xmodulo.com/2013/02/how-to-set-a-default-gateway-on-centos.html

星期三, 10月 02, 2013

Install CentOS by Network Image

CentOS Install by Network
Download
http://centos.arcticnetwork.ca/6.4/isos/x86_64/CentOS-6.4-x86_64-netinstall.iso

Boot it and Choose "install Device from URL" and input link as below:
http://centos.arcticnetwork.ca/6.4/os/x86_64