LINUX 小技巧備忘錄

1.普通用戶添加sudo權限及sudo 無密碼配置

    1.1 添加sudo權限,在root ALL=(ALL) ALL 行下面增加一行

    $sudo vi  /etc/sudoers
    username ALL =(ALL) ALL

    1.2 sudo 無密碼設置

   jun  ALL=NOPASSWD: ALL   
  #用戶名 空格 ALL=NOPASSWD 空格:ALL;下次普通用戶jun sudo su 則無需輸入密碼設定

    

2. Mysql 密碼忘記的修復方法

    2.1 停止mysql 服務

#/etc/init.d/mysqld stop   或 killall -TERM mysqld

    2.2 繞開安全權限啓動mysqld

    #/usr/bin/mysqld_safe --skip-grant-tables &

    2.3 修改mysql庫中的user表,重新賦予新的權限

    >use mysql 
    >update user set password=password("new_pass") where user="root"; 
    >flush privileges;


3.Ubuntu,RHEL與SUSE系統語言配置文件路徑

    3.1 ubuntu 路徑:

    #cat /etc/default/locale

LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

    3.2 RHEL 路徑

    #cat /etc/sysconfig/i18n

   3.3 SUSE 路徑

   #cat /etc/sysconfig/language

4.修改Centos6.5 YUM 源

通常在安裝完CentOS後一般需要修改yum源,才能夠在安裝更新rpm包。同時爲了獲得比較理想的速度,這裏採用了國內比較快的有163源、sohu源;這裏以163源爲例子。

# cd /etc/yum.repos.d
# mv CentOS-Base.repo CentOS-Base.repo.bak
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
# mv CentOS6-Base-163.repo CentOS-Base.repo
# yum clean all


5.Linux 網址雜燴

國外
 

 http://lwn.net/
  http://www.tldp.org/
  https://rhn.redhat.com
  http://www.justlinux.com/
  http://www.linuxtoday.com/
  http://www.linuxquestions.org/
  http://www.fokus.gmd.de/linux/
  http://www.linux-tutorial.info/
  http://public.www.planetmirror.com/
  http://www.freebsdforums.org/forums/
  http://www.netfilter.org/documentation/
  http://www-106.ibm.com/developerworks/linux/
  http://www.redhat.com/docs/ redhat官方文檔,

國內

http://www.fanqiang.com/
  http://www.linuxsir.com/
  http://www.chinaunix.net/
  http://www.linuxfans.org/
  http://www.linuxeden.com/
  http://www.linuxforum.net/
  http://www.linuxaid.com.cn/
  http://freesoft.online.sh.cn/
  http://www-900.ibm.com/developerWorks/cn/linux/index.shtml

redhat linux下載地址

 ftp://ftp.redhat.com/pub/redhat/linux
  http://redhat.com/download/mirror.html

linux 常用軟件搜索

 http://bingle.pku.edu.cn 
  http://www.linuxforum.net/
  http://rpmfind.net
  http://freshmeat.net
  http://sourceforge.net
  http://www.linuxgazette.com/ linux在線雜誌
  http://linux.tcpip.com.cn/download/ linux中文版文檔和軟件下載
  http://cosoft.org.cn/html/documents/ 很多中文版手冊


linux 桌面主站一覽表

  GNOME: http://www.gnome.org
  KDE: http://www.kde.org
  XFce: http://www.xfce.org/
  Window Maker: http://www.windowmaker.org/
  BlackBox: http://sourceforge.net/projects/blackboxwm
  XPde: http://www.xpde.com
  ROX: http://sourceforge.net/projects/rox
  5dwm: http://5dwm.org/
  foXdesktop: http://sourceforge.net/projects/foxdesktop
  EDE: http://sourceforge.net/projects/ede
  UDE: http://sourceforge.net/projects/udeproject

其它OS:

  Mandrake linux http://www.mandrakelinux.com
  debian linux http://www.debian.org
  slackware linux http://www.slackware.com
  suse linux http://www.suse.com
  FreeBSD http://www.freebsd.org
  netbsd http://www.netbsd.org
  openbsd http://www.openbsd.org
  Solaris http://www.sun.com/solaris
  linux Kernel內核: http://www.kernel.org

主要服務器軟件主站

1. WWW server:
  Apache http://www.apache.org Apache
  SSL模塊Mod_ssl http://www.modssl.org
  aol server http://www.aolserver.com
2. Servlets/JSP引擎:
  Tomcat: http://jakarta.apache.org
  Resin: http://www.caucho.com
  開源應用服務器AS--Jboss: http://www.jboss.org
3. 服務器語言:
  PHP http://www.php.net
  Zend http://www.zend.com
  Java http://www.javasoft.com
  Python http://www.python.org
  Zope http://www.zope.org
  Perl http://www.perl.org
  Ruby http://www.ruby-lang.org/en
4. 數據庫:
  MySQL http://www.mysql.com
  PostgreSQL http://www.postgresql.org
  Oracle http://www.oracle.com
  sap db http://www.sapdb.org
  PHPMyAdmin -- http://www.phpmyadmin.org
  PHPPgAdmin: http://sourceforge.net/projects/phppgadmin
5. FTP服務器
  wu-ftpd http://www.wu-ftpd.org
  Proftpd http://www.proftpd.org
  Pure-ftpd http://www.pureftpd.org
  ncftpd http://www.ncftpd.com
  vsftpd http://vsftpd.beasts.org
6. SMTP服務器
  Sendmail http://www.sendmail.org
  qmail http://www.qmail.org
  Postfix http://www.postfix.org
  Exim http://www.exim.org
  POP3--qpopper http://www.qpopper.org
7. IMAP服務器
  Cyrus-IMAPD http://asg.web.cmu.edu/cyrus/imapd
  UW IMAP http://www.washington.edu/imap
  courierimap http://www.inter7.com/courierimap
8. 基本安全工具
  firewall Iptables: http://www.iptables.org
  shorewall: http://www.shorewall.net
  inetd Xinetd: http://www.xinetd.org
  Openssl: http://www.openssl.org
  OpenSSH: http://www.openssh.org
  nmap: http://http://www.insecure.org/nmap
  Tripwire: http://www.tripwire.org
  snort: http://www.snort.org
  nessus: http://www.nessus.org
  GnuPG: http://www.gnupg.org
  chkrootkit: http://www.chkrootkit.org
  安全顧問: http://www.cert.org

9. 其它服務器軟件

  CVS--CVS http://www.cvshome.org
  DNS域名解析BIND http://www.isc.org/products/BIND/
  DHCP--DHCP http://www.isc.org/products/DHCP/
  INN新聞組INN: http://www.isc.org/products/INN/
  Proxy代理緩存: Squid http://www.squid-cache.org
  Socks代理:http://www.socks.nec.com/
  Samba Server: http://www.samba.org
  Print CUPS: http://www.cups.org
  LDAP OpenLDAP: http://www.openldap.org
  流量分析 MRTG http://www.mrtg.org
  日誌分析 webalizer http://www.mrunix.net/webalizer/
  Ipsec/*** http://www.freeswan.org
  路由 Zebra http://www.zebra.org
  集羣 LVS http://www.linuxvirtualserver.org
  MPICH http://www-unix.mcs.anl.gov/mpi/mpich/
  PVM:http://www.netlib.org/pvm3/
  Rsync: http://rsync.samba.org
  linuxconf: http://www.solucorp.qc.ca/linuxconf/
  Webmin: http://www.webmin.com

6.Cygwin 設置ls 帶顏色顯示文件及目錄

$ vi .bashrc
alias ls='ls -hF --color=tty'  #開啓
$ source .bashrc

7. CentOS 支持 中文輸入法

#yum install "@Chinese Support"

安裝完成之後在圖形界面點擊System 》Preferences》中會出現 Input Method 選項,點擊進入;

彈出框後,選擇 USE  IBUS (recommended),點擊 Input Method Preferences  選項進入

再選擇General 選項包含 快捷鍵等設置,Input Method 中選擇常用輸入法,在Select an  input method中選擇Chinese,會出現右邊的中文輸入法列表,這裏選擇Pinyin,然後點擊add,關閉窗口,即設置成功。如果不生效的情況下則註銷用戶重新登錄。


8. Ubuntu 怎麼在右鍵添加打開終端

$sudo apt-get install nautilus-open-terminal 
$nautilus -q     #重新加載文件管理器或註銷再登錄即要使用


9.Ubuntu 更換桌面

換成lxde桌面
$sudo apt-get install lubuntu-desktop
這是換成xfce4的桌面
$sudo apt-get install xubuntu-desktop


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章