zoukankan      html  css  js  c++  java
  • Fedora Core 4下的一些小问题

    转自:http://zjmaslow.blog.163.com/blog/static/203163062200762052725807/

    查看文件夹总是打开新窗口:
    编辑->首选项->行为->选中 总是在浏览器窗口中打开
    这样就不会每次都打开个新窗口了

    SSH远程登录中文乱码:
    File->Properties->Terminal->Translation 选UTF-8
    sh# vi /etc/sysconfig/i18n
    (改其内容为:
    LANG="zh_CN.UTF-8"
    SYSFONT="none"
    LANG="zh_CN.GB18030"
    )
    :wq
    重新登录,OK

    Linux访问Windows共享:
    sh# mount -t smbfs -o username=administrator,passwd='' //192.168.0.xx/work /mnt/smb/

    忘记了ROOT密码后:
    启动GRUB,选择Red Hat Linux的选项,然后键入 e 来编辑;
    选择以kernel开头的一行,再按 e 键,在此行的末尾,按空格键后输入 single,以回车键来退出编辑模式;
    回到了 GRUB 屏幕后,键入 b 来引导进入单用户模式.
    sh# passwd root   (设置新密码)
    sh# reboot

    网卡配置文件:
    /etc/sysconfig/network-scripts
    改本机名字:
    sh# gedit /etc/hosts
    sh# gedit /etc/sysconfig/network

    挂载windows分区(非NTFS)

    sh# mkdir /mnt/study
    sh# mount -t auto -o rw -o codepage=936 -o iocharset=cp936 /dev/hda8 /mnt/study
    sh# umount /dev/hda8

    系统启动时挂载:
    sh# gedit /etc/fstab
    (加入:
    /dev/hda8 /mnt/other vfat defaults,codepage=936,iocharset=cp936 0 0
    )
    sh# shutdown -r now

    挂载windows共享目录:
    sh# mount -t smbfs -o username=administrator,passwd='' //192.168.0.102/Share /user/local/share/

    挂载CD-ROM:
    sh# mount /dev/cdrom /mnt/

    webmin配置文件
    /etc/webmin/

    权限的设置
    rwx
    421

    退出终端运行:
    CTRL + C

    磁盘空间
    df

    文件大小
    du -sh ./

    压缩
    zip -r zhou *

    系统自动启动执行命令放入
    /etc/init.d

    对数据库查询有乱码:
    header ("Content-Type: text/html; charset=gb2312");

    数据库存储路径
    /var/lib/mysql

    WinDos下
    ping 219.76.196.133 -t
    ipconfig /all

    系统版本
    uname -a

    文件更名/复制:
    mv mm gg
    cp -R mm gg

    远程下载
    wget

    启动服务
    service mysqld start/stop/restart

    卸载SENDMAIL:
    rpm -e --nodeps sendmail
    杀进程:
    killall sendmail

    updatedb配置和保存<->locate:
    /var/lib/slocate/slocate.db
    /etc/updatedb.conf

    linux下看samba共享:
    smb://hostname
    权限为555 (系统的目录权限永远大于samba设定的权限)

    grep使用
    grep -r mm > gg.txt

    查看用户和用户组
    cat /etc/passwd
    cat /etc/group
    id postfix

    mysql密码文件
    /var/lib/mysql/mysql/下的user三个文件覆盖

    gedit默认编码/自动保存
    gconf-editor-->app-->gedit2-->preferences-->encodings
    gconf-editor-->app-->gedit2-->editor-->save


    系统配置工具
    #setup

    PHP命令行
    /usr/local/php/bin

    查找文件:
    find / -name my.ini

    修改webmin密码:
    At the command prompt type in: cd /usr/libexec/webmin

    To change the password looks similar to: ./changepass.pl <config-dir> <login> <password>

    For example to reset the username to admin, and the password to password type in the

    following:
    ./changepass.pl /etc/webmin admin password

    文件浏览器
    sh# nautilus --no-desktop --browser

    服务列表
    ntsysv

    perl -MCPAN -e 'install "DBD::mysql"'             单独安装mysql包

    网卡查看
    ifconfig eth0
    netconfig
    arp(获取MAC地址)

    linux下的软件
    Procmail(邮件过滤)
    ProFTPD(FTP服务器)
    SpamAssassin(反垃圾邮件)
    Kerberos(网络身份鉴别)
    NIS(网络信息服务,域服务)
    Squid(代理服务器)
    Security Sentries(防火墙?)
    Webalizer Logfile Analysis(ftp,http统计报表)

    系统计划任务
    /var/spool/at

    安装perl包
    cpan(perl的包下载)
    perl -MCPAN -e shell
    gunzip -c /tmp/.webmin/DBD-mysql-4.005.tar.gz | tar xvf -..
    /usr/bin/perl Makefile.PL             && make..
    make test..


    查看MYSQL的SOCKET,登录后:
    show variables like 'socket';
    show variables;

    Samba共享:
    权限由文件夹权限+Samba配置的权限组合


    传邮件到本地:
    zj@mail.linux.com
    zj@mail
    zj@localhost
    zj

    改MYSQL的密码:
    sh# killall -TERM mysqld         (如果是windows,直接调出进程管理器,结束之)
    sh# /usr/bin/mysqld_safe --skip-grant-tables &         (windows下mysql安装目录/mysql/bin/safe_mysqld --skip-grant-tables 就可以不需要密码就进入 MySQL 了)
    sh# mysql
    >use mysql
    >update user set password=password("new_pass") where user="root";
    >flush privileges;
    重新杀 MySQL ,用正常方法启动MySql

    Mysql乱码:
    在my.cnf中加入

    sql_mode=''
    character-set-server=utf8
    collation-server=utf8_general_ci
    init_connect="SET NAMES 'utf8'"

    并且连接数据库的用户只能是USER级的用户,这个设置才有效

    文件传输:
    rsync -avzP -e ssh root@192.168.0.5:/usr/src/ ./ #ssh登录,对应目录同步到当前目录
    rsync -avzP -e ssh ./ root@192.168.0.5:/usr/src/ #相反
    rsync -avzPR --exclude=.svn -e "sshpass -p 密码 ssh -p 22 -o StrictHostKeyChecking=no" root@192.168.0.5:/usr/src/ ./ #排除.svn目录.需安装sshpass包,-o StrictHostKeyChecking=no为跳过确认-R为自动创建目录应去掉

    RHEL6-64位机上加装C编译器:
    rpm -ivh kernel-headers-2.6.32-71.el6.x86_64.rpm
    rpm -ivh glibc-headers-2.12-1.7.el6.x86_64.rpm
    rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm
    rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
    rpm -ivh glibc-devel-2.12-1.7.el6.x86_64.rpm
    rpm -ivh libgomp-4.4.4-13.el6.x86_64.rpm
    rpm -ivh libstdc++-devel-4.4.4-13.el6.x86_64.rpm
    rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm
    rpm -ivh cpp-4.4.4-13.el6.x86_64.rpm
    rpm -ivh gcc-4.4.4-13.el6.x86_64.rpm
    rpm -ivh gcc-c++-4.4.4-13.el6.x86_64.rpm

    检查编译环境:
    sh# which gcc
    sh# which perl
    sh# which make ( rpm -ivh make-3.81-19.el6.x86_64.rpm)
    sh# which gmake

    安装C编译器:
    rpm -ivh libgomp-4.3.2-7.el5.i386.rpm
    rpm -ivh kernel-headers-2.6.18-128.el5.i386.rpm
    rpm -ivh glibc-headers-2.5-34.i386.rpm
    rpm -ivh glibc-devel-2.5-34.i386.rpm
    rpm -ivh cpp-4.1.2-44.el5.i386.rpm
    rpm -ivh gcc-4.1.2-44.el5.i386.rpm

    rpm -ivh libstdc++-devel-4.1.2-44.el5.i386.rpm
    rpm -ivh gcc-c++-4.1.2-44.el5.i386.rpm (sh# which c++ //查看是否安装成功)

    错误
    cpp: error trying to exec 'cc1plus': execvp: No such file or directory
    解决:
    rpm -ivh libstdc++-devel-4.1.2-44.el5.i386.rpm
    rpm -ivh gcc-c++-4.1.2-44.el5.i386.rpm
    或者
    yum install gcc-c++

    错误:
    configure: error: Couldn't find uuid/uuid.h
    解决:
    rpm -ivh e2fsprogs-devel-1.39-20.el5.i386.rpm

    不能正确找到路径,每次都要export.其实是把export写到$HOME/.bash_profile 中,如
    export PHP_AUTOHEADER=/usr/local/autoconf/bin/autoheader
    export PHP_AUTOCONF=/usr/local/autoconf/bin/autoconf
    export PKG_CONFIG=/usr/local/pkg-config/bin/pkg-config

    编译的时候提示:
    undefined reference to `dlsym'
    undefined reference to `dlerror'
    undefined reference to `dlopen'
    undefined reference to `dlclose'
    甚至是: checking for libssh2_banner_set in -lssh2... no等错误
    解决:
    在 configure 的时候为LDFLAGS加上 -ldl 如:
    ./configure LDFLAGS=-ldl

  • 相关阅读:
    xls10-Python3安装cx_Oracle连接oracle数据库实操总结list
    xls3-2-想要使用Python的xlwt设置单元格的背景色
    XLS9-PyCharm下打包*.py程序成.exe
    XLS8-python3+PyQt5+pycharm桌面GUI开发
    epoll模型中LT、ET模式分析
    lambda函数也叫匿名函数,即,函数没有具体的名称。先来看一个最简单例子:
    xls7-python读conf配置文件--ConfigParser
    xls6-python解析properties文件
    xls5-解析properties文件,在python中基本没有遇到
    xls2- 用Python读写Excel文件-乘法口诀
  • 原文地址:https://www.cnblogs.com/shanmao/p/2830814.html
Copyright © 2011-2022 走看看