作者: admin

  • MySQL配置文件my.cnf优化详解(转)

    MySQL 5.5.13

    参数说明:

    [client]

    character-set-server = utf8

    port    = 3306

    socket  = /data/mysql/3306/mysql.sock

     

    [mysqld]

    character-set-server = utf8

     

    user    = mysql

    port    = 3306

    socket  = /data/mysql/3306/mysql.sock

    basedir = /usr/local/webserver/mysql

    datadir = /data/mysql/3306/data

    log-error = /data/mysql/3306/mysql_error.log

    pid-file = /data/mysql/3306/mysql.pid

     

    # table_cache 参数设置表高速缓存的数目。每个连接进来,都会至少打开一个表缓存。#因此, table_cache 的大小应与 max_connections 的设置有关。例如,对于 200 个#并行运行的连接,应该让表的缓存至少有 200 × N ,这里 N 是应用可以执行的查询#的一个联接中表的最大数量。此外,还需要为临时表和文件保留一些额外的文件描述符。

    #当 Mysql 访问一个表时,如果该表在缓存中已经被打开,则可以直接访问缓存;如果#还没有被缓存,但是在 Mysql 表缓冲区中还有空间,那么这个表就被打开并放入表缓#冲区;如果表缓存满了,则会按照一定的规则将当前未用的表释放,或者临时扩大表缓存来存放,使用表缓 存的好处是可以更快速地访问表中的内容。执行 flush tables 会#清空缓存的内容。一般来说,可以通过查看数据库运行峰值时间的状态值 Open_tables #和 Opened_tables ,判断是否需要增加 table_cache 的值(其中 open_tables 是当#前打开的表的数量, Opened_tables 则是已经打开的表的数量)。即如果open_tables接近table_cache的时候,并且Opened_tables这个值在逐步增加,那就要考 虑增加这个#值的大小了。还有就是Table_locks_waited比较高的时候,也需要增加table_cache。

    open_files_limit = 10240

    table_cache = 512

    #非动态变量,需要重启服务

    #指定MySQL可能的连接数量。当MySQL主线程在很短的时间内接收到非常多的连接请求,该参数生效,主线程花费很短的时间检查连接并且启动一个新线 程。back_log参数的值指出在MySQL暂时停止响应新请求之前的短时间内多少个请求可以被存在堆栈中。如果系统在一个短时间内有很多连接,则需要 增大该参数的值,该参数值指定到来的TCP/IP连接的侦听队列的大小。不同的操作系统在这个队列大小上有它自己的限制。试图设定back_log高于你 的操作系统的限制将是无效的。默认值为50。对于Linux系统推荐设置为小于512的整数。

    back_log = 600

    #MySQL允许最大连接数

    max_connections = 5000

    #可以允许多少个错误连接

    max_connect_errors = 6000

    #使用–skip-external-locking MySQL选项以避免外部锁定。该选项默认开启

    external-locking = FALSE

    #设置最大包,限制server接受的数据包大小,避免超长SQL的执行有问题 默认值为16M,当MySQL客户端或mysqld服务器收到大于max_allowed_packet字节的信息包时,将发出“信息包过大”错误,并关 闭连接。对于某些客户端,如果通信信息包过大,在执行查询期间,可能会遇到“丢失与MySQL服务器的连接”错误。默认值16M。

    #dev-doc: http://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html

    max_allowed_packet = 32M

    # Sort_Buffer_Size 是一个connection级参数,在每个connection(session)第一次需要使用这个buffer的时候,一次性分配设置的内存。

    #Sort_Buffer_Size 并不是越大越好,由于是connection级的参数,过大的设置+高并发可能会耗尽系统内存资源。例如:500个连接将会消耗 500*sort_buffer_size(8M)=4G内存

    #Sort_Buffer_Size 超过2KB的时候,就会使用mmap() 而不是 malloc() 来进行内存分配,导致效率降低。

    #技术导读 http://blog.webshuo.com/2011/02/16/mysql-sort_buffer_size/

    #dev-doc: http://dev.mysql.com/doc/refman/5.5/en/server-parameters.html

    #explain select*from table where order limit;出现filesort

    #属重点优化参数

    sort_buffer_size = 8M

    #用于表间关联缓存的大小

    join_buffer_size = 1M

    #服务器线程缓存这个值表示可以重新利用保存在缓存中线程的数量,当断开连接时如果缓存中还有空间,那么客户端的线程将被放到缓存中,如果线程重新被请 求,那么请求将从缓存中读取,如果缓存中是空的或者是新的请求,那么这个线程将被重新创建,如果有很多新的线程,增加这个值可以改善系统性能.通过比较 Connections 和 Threads_created 状态的变量,可以看到这个变量的作用

    thread_cache_size = 300

    #设置thread_concurrency的值的正确与否, 对mysql的性能影响很大, 在多个cpu(或多核)的情况下,错误设置了thread_concurrency的值, 会导致mysql不能充分利用多cpu(或多核), 出现同一时刻只能一个cpu(或核)在工作的情况。thread_concurrency应设为CPU核数的2倍. 比如有一个双核的CPU, 那么thread_concurrency的应该为4; 2个双核的cpu, thread_concurrency的值应为8

    #属重点优化参数

    thread_concurrency = 8

    #对于使用MySQL的用户,对于这个变量大家一定不会陌生。前几年的MyISAM引擎优化中,这个参数也是一个重要的优化参数。但随着发展,这个参数也 爆露出来一些问题。机器的内存越来越大,人们也都习惯性的把以前有用的参数分配的值越来越大。这个参数加大后也引发了一系列问题。我们首先分析一下 query_cache_size的工作原理:一个SELECT查询在DB中工作后,DB会把该语句缓存下来,当同样的一个SQL再次来到DB里调用 时,DB在该表没发生变化的情况下把结果从缓存中返回给Client。这里有一个关建点,就是DB在利用Query_cache工作时,要求该语句涉及的 表在这段时间内没有发生变更。那如果该表在发生变更时,Query_cache里的数据又怎么处理呢?首先要把Query_cache和该表相关的语句全 部置为失效,然后在写入更新。那么如果Query_cache非常大,该表的查询结构又比较多,查询语句失效也慢,一个更新或是Insert就会很慢,这 样看到的就是Update或是Insert怎么这么慢了。所以在数据库写入量或是更新量也比较大的系统,该参数不适合分配过大。而且在高并发,写入量大的 系统,建系把该功能禁掉。

    #重点优化参数(主库 增删改-MyISAM)

    query_cache_size = 512M

    #指定单个查询能够使用的缓冲区大小,缺省为1M

    query_cache_limit = 2M

    #默认是4KB,设置值大对大数据查询有好处,但如果你的查询都是小数据查询,就容易造成内存碎片和浪费

    #查询缓存碎片率 = Qcache_free_blocks / Qcache_total_blocks * 100%

    #如果查询缓存碎片率超过20%,可以用FLUSH QUERY CACHE整理缓存碎片,或者试试减小query_cache_min_res_unit,如果你的查询都是小数据量的话。

    #查询缓存利用率 = (query_cache_size – Qcache_free_memory) / query_cache_size * 100%

    #查询缓存利用率在25%以下的话说明query_cache_size设置的过大,可适当减小;查询缓存利用率在80%以上而且Qcache_lowmem_prunes > 50的话说明query_cache_size可能有点小,要不就是碎片太多。

    #查询缓存命中率 = (Qcache_hits – Qcache_inserts) / Qcache_hits * 100%

    query_cache_min_res_unit = 2k

    default-storage-engine = MyISAM

    #限定用于每个数据库线程的栈大小。默认设置足以满足大多数应用

    thread_stack = 192K

    # 设定默认的事务隔离级别.可用的级别如下:

    # READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE

    # 1.READ UNCOMMITTED-读未提交2.READ COMMITTE-读已提交3.REPEATABLE READ -可重复读4.SERIALIZABLE -串行

    transaction_isolation = READ-COMMITTED

    # tmp_table_size 的默认大小是 32M。如果一张临时表超出该大小,MySQL产生一个 The table tbl_name is full 形式的错误,如果你做很多高级 GROUP BY 查询,增加 tmp_table_size 值。

    tmp_table_size = 246M

    max_heap_table_size = 246M

    #索引缓存大小: 它决定了数据库索引处理的速度,尤其是索引读的速度

    key_buffer_size = 512M

    # MySql读入缓冲区大小。对表进行顺序扫描的请求将分配一个读入缓冲区,MySql会为它分配一段内存缓冲区。read_buffer_size变量控 制这一缓冲区的大小。如果对表的顺序扫描请求非常频繁,并且你认为频繁扫描进行得太慢,可以通过增加该变量值以及内存缓冲区大小提高其性能。

    read_buffer_size = 4M

    # MySql的随机读(查询操作)缓冲区大小。当按任意顺序读取行时(例如,按照排序顺序),将分配一个随机读缓存区。进行排序查询时,MySql会首先扫 描一遍该缓冲,以避免磁盘搜索,提高查询速度,如果需要排序大量数据,可适当调高该值。但MySql会为每个客户连接发放该缓冲空间,所以应尽量适当设置 该值,以避免内存开销过大。

    read_rnd_buffer_size = 16M

    #批量插入数据缓存大小,可以有效提高插入效率,默认为8M

    bulk_insert_buffer_size = 64M

    # MyISAM表发生变化时重新排序所需的缓冲

    myisam_sort_buffer_size = 128M

    # MySQL重建索引时所允许的最大临时文件的大小 (当 REPAIR, ALTER TABLE 或者 LOAD DATA INFILE).

    # 如果文件大小比此值更大,索引会通过键值缓冲创建(更慢)

    myisam_max_sort_file_size = 10G

    # 如果一个表拥有超过一个索引, MyISAM 可以通过并行排序使用超过一个线程去修复他们.

    # 这对于拥有多个CPU以及大量内存情况的用户,是一个很好的选择.

    myisam_repair_threads = 1

    #自动检查和修复没有适当关闭的 MyISAM 表

    myisam_recover

     

    interactive_timeout = 120

    wait_timeout = 120

     

    innodb_data_home_dir = /data/mysql/3306/data

    #表空间文件 重要数据

    innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend

    #这个参数用来设置 InnoDB 存储的数据目录信息和其它内部数据结构的内存池大小,类似于Oracle的library cache。这不是一个强制参数,可以被突破。

    innodb_additional_mem_pool_size = 16M

    #这对Innodb表来说非常重要。Innodb相比MyISAM表对缓冲更为敏感。MyISAM可以在默认的 key_buffer_size 设置下运行的可以,然而Innodb在默认的 innodb_buffer_pool_size 设置下却跟蜗牛似的。由于Innodb把数据和索引都缓存起来,无需留给操作系统太多的内存,因此如果只需要用Innodb的话则可以设置它高达 70-80% 的可用内存。一些应用于 key_buffer 的规则有 — 如果你的数据量不大,并且不会暴增,那么无需把 innodb_buffer_pool_size 设置的太大了

    innodb_buffer_pool_size = 512M

    #文件IO的线程数,一般为 4,但是在 Windows 下,可以设置得较大。

    innodb_file_io_threads = 4

    # 在InnoDb核心内的允许线程数量.

    # 最优值依赖于应用程序,硬件以及操作系统的调度方式.

    # 过高的值可能导致线程的互斥颠簸.

    innodb_thread_concurrency = 8

    #如果将此参数设置为1,将在每次提交事务后将日志写入磁盘。为提供性能,可以设置为0或2,但要承担在发生故障时丢失数据的风险。设置为0表示事务日志 写入日志文件,而日志文件每秒刷新到磁盘一次。设置为2表示事务日志将在提交时写入日志,但日志文件每次刷新到磁盘一次。

    innodb_flush_log_at_trx_commit = 2

    #此参数确定些日志文件所用的内存大小,以M为单位。缓冲区更大能提高性能,但意外的故障将会丢失数据.MySQL开发人员建议设置为1-8M之间

    innodb_log_buffer_size = 16M

    #此参数确定数据日志文件的大小,以M为单位,更大的设置可以提高性能,但也会增加恢复故障数据库所需的时间

    innodb_log_file_size = 128M

    #为提高性能,MySQL可以以循环方式将日志文件写到多个文件。推荐设置为3M

    innodb_log_files_in_group = 3

    #推荐阅读 http://www.taobaodba.com/html/221_innodb_max_dirty_pages_pct_checkpoint.html

    # Buffer_Pool中Dirty_Page所占的数量,直接影响InnoDB的关闭时间。参数innodb_max_dirty_pages_pct 可以直接控制了Dirty_Page在Buffer_Pool中所占的比率,而且幸运的是innodb_max_dirty_pages_pct是可以动 态改变的。所以,在关闭InnoDB之前先将innodb_max_dirty_pages_pct调小,强制数据块Flush一段时间,则能够大大缩短 MySQL关闭的时间。

    innodb_max_dirty_pages_pct = 90

    # InnoDB 有其内置的死锁检测机制,能导致未完成的事务回滚。但是,如果结合InnoDB使用MyISAM的lock tables 语句或第三方事务引擎,则InnoDB无法识别死锁。为消除这种可能性,可以将innodb_lock_wait_timeout设置为一个整数值,指示 MySQL在允许其他事务修改那些最终受事务回滚的数据之前要等待多长时间(秒数)

    innodb_lock_wait_timeout = 120

    #独享表空间(关闭)

    innodb_file_per_table = 0

     

    #start mysqld with –slow-query-log-file=/data/mysql/3306/slow.log

    slow_query_log

    long_query_time = 1

     

    replicate-ignore-db = mysql

    replicate-ignore-db = test

    replicate-ignore-db = information_schema

    #配置从库上的更新操作是否写二进制文件,如果这台从库,还要做其他从库的主库,那么就需要打这个参数,以便从库的从库能够进行日志同步这个参数要和—logs-bin一起使用

    log-slave-updates

    log-bin = /data/mysql/3306/binlog/binlog

    binlog_cache_size = 4M

    #STATEMENT,ROW,MIXED

    #基于SQL语句的复制(statement-based replication, SBR),基于行的复制(row-based replication, RBR),混合模式复制(mixed-based replication, MBR)。相应地,binlog的格式也有三种:STATEMENT,ROW,MIXED。

    binlog_format = MIXED

    max_binlog_cache_size = 64M

    max_binlog_size = 1G

    relay-log-index = /data/mysql/3306/relaylog/relaylog

    relay-log-info-file = /data/mysql/3306/relaylog/relaylog

    relay-log = /data/mysql/3306/relaylog/relaylog

    expire_logs_days = 30

     

     

    skip-name-resolve

    #master-connect-retry = 10

    slave-skip-errors = 1032,1062,126,1114,1146,1048,1396

    server-id = 1

     

    [mysqldump]

    quick

    max_allowed_packet = 32M

     

    [myisamchk]

    key_buffer_size = 256M

    sort_buffer_size = 256M

    read_buffer = 2M

    write_buffer = 2M

     

    [mysqlhotcopy]

    interactive-timeout

    设Slow Query Log

    http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html

    [mysqld]
    long_query_time=1
    log-slow-queries=/var/log/mysql/log-slow-queries.log

    You must create the file manually and change owners this way:

    mkdir /var/log/mysql
    touch /var/log/mysql/log-slow-queries.log
    chown mysql.mysql -R /var/log/mysql

     

    tmp_table_size=512M
    key_buffer_size = 1024M
    read_buffer_size = 32M
    max_connections = 5000
    query_cache_size = 512M

    query_cache_limit = 16M

    sort_buffer_size = 8M
    join_buffer_size = 1M

  • x2go在Centos6.4上的使用简单说明

    wget http://mirror.ancl.hawaii.edu/linux/epel/6/i386/epel-release-6-8.noarch.rpm
    yum install epel-release-6-8.noarch.rpm
    yum install fuse-sshfs
    yum install x2goserver

    yum groupinstall XFCE
    或者安装其他的图形桌面环境
    x2gostartagent
    提示 xauth: (argv):1: bad display name “xxxxx:1” in “add” command
    解决方法:
    cat /etc/hosts
    127.0.0.1 xxxxx localhost.localdomain localhost
    10.0.127.144 xxxxx

  • SSH-KeyGen 的用法

    假设 A 为客户机器,B为目标机;

    要达到的目的:
    A机器ssh登录B机器无需输入密码;
    加密方式选 rsa|dsa均可以,默认dsa

    做法:
    1、登录A机器
    2、ssh-keygen -t [rsa|dsa],将会生成密钥文件和私钥文件 id_rsa,id_rsa.pub或id_dsa,id_dsa.pub
    3、将 .pub 文件复制到B机器的 .ssh 目录, 并 cat id_dsa.pub >> ~/.ssh/authorized_keys
    4、大功告成,从A机器登录B机器的目标账户,不再需要密码了;

    ssh-keygen做密码验证可以使在向对方机器上ssh ,scp不用使用密码.
    具体方法如下:
    ssh-keygen -t rsa
    然后全部回车,采用默认值.

    这样生成了一对密钥,存放在用户目录的~/.ssh下。
    将公钥考到对方机器的用户目录下,并拷到~/.ssh/authorized_keys中。

    要保证.ssh和authorized_keys都只有用户自己有写权限。否则验证无效。(今天就是遇到这个问题,找了好久问题所在),其实仔细想想,这样做是为了不会出现系统漏洞。

  • 转linux系统下,11款常见远程桌面控制软件

    远程控制能够给人们带来很多便利,本文介绍了11款常见的Linux系统下的远程桌面控制工具,总有一款能适合您。

    一. Grdc
    它是一个用GTK+编写的,适用于gnome桌面环境的远程桌面访问软件。看图:
    常见功能:
    1.提供全屏,窗口化的远程控制。支持高分辨率下的窗口显示以及调整。
    2.可浮动的工具栏
    3.可抓取键盘
    4.支持建立一个“常用访问列表”
    5.连接快速,高效
    6.全屏模式下,当鼠标划过屏幕边缘时自动滚动
    7.全屏模式下工具栏同样支持浮动效果,可直接进行例如模式切换,键盘抓取最小化等常见操作。
    8. rdesktop 支持RDP协议,
    9. 支持 VNC 连入协议

    官方网站: http://grdc.sourceforge.net/
    下载地址:http://sourceforge.net/project/showfiles.php?group_id=248852

    二.TightVNC
    跨平台的开源远程桌面控制程序,使用可扩展的 VNC的RFB协议。主要功能:
    1. 程序高度优化,保证了在网络情况不好的时候,也能稳定的保持连接。
    2. 定制性高
    3. 支持 SSH 自动通道
    4. 全面支持 VNC下使用的RFB协议
    5. 增强的网页浏览模式
    6. 支持两种密码保护模式:全功能控制 和 只读访问模式

    官方网站: http://www.tightvnc.com/
    下载地址:(因支持跨平台系统,所以只提供下载页面共大家选择)
    http://www.tightvnc.com/download.html

    三.Terminal Server Client
    别名:tsclient,是一个用来访问Windows系统(包括常见的2000,NT,XP等)的GNOME桌面环境下的远程访问软件。支持协议: RDP,主要功能
    1. 可以通过gnome面板上的按钮来快速访问
    2. 支持 RDP v和 rdesktop 1.3
    3. 支持在win系统下以其解码方式读取  .rdp文件
    4. 支持以 ASCII方式写入 .rdp 文件
    5. 同样支持:
    * VNC clients (*vncviewer)
    * Citrix ICA client
    * X via Xnest
    6. 功能,界面布局倾向于windows软件,因此易用性更高
    7. 软件内置20种以上的不同语言

    软件网址:http://sourceforge.net/projects/tsclient/

    四. rdesktop
    一个主要用于访问windows服务器系统(命令行模式)的开源客户端软件。支持的Windows系统有:Windows 2000 Server, Windows Server 2003, Windows Server 2008, Windows XP, Windows Vista and Windows NT Server 4.0.
    这个软件一度被加入到了很多“微型”的linux发行版,如 Thinstataion中。
    1.支持8/15/16/24位色彩模式的连接
    2.支持抓取BMP格式图片
    3.支持文件系统,音频,串行端口和打印机端口的重定向
    4.自动认证
    5.支持智能卡
    6.支持大多数符合国际标准的键盘布局

    网站: http://www.rdesktop.org/

    五.RealVNC
    VNC是:Virtual Network Computing(虚拟网络计算)的简称,它是一个图形化的,使用RFB协议的远程桌面访问控制系统。它可以通过网络,让一台电脑上的鼠标操作,键盘操 作同时在另外一台电脑上实现。VNC的操作,既可以看成是一个服务端,也是当作是客户端来对待。
    VNC是一个独立的平台,运行在各种操作系统下的VNC查看器,都能连接到装有VNC服务端的操作系统上,多个客户端也可以在同一时间连接上同一个服务端。
    VNC技术最受欢迎的用途包括:借助这种方式,管理员可以远程的对电脑进行故障检测和修复。而不需要实地的去接触需要维护的电脑设备。VNC在各个 行业领域应用都很广泛,它的免费版本更是被很多主流linux发行版”收入囊中“ ,除了免费版,VNC还提供个人版和企业版.
    RealVNC是由VNC的原班AT&T团队发布。并且已经衍生出了很多诸如 UltraVNC和TightVNC的同功能版本。主要功能:
    1. 使用TCP/IP 协议来进行远程控制服务
    2. 支持简易应答协议。(企业版和个人版包括如 2048位的RSA 服务端认证加密,128位的 AES 会话加密模式)
    3. 支持 SSH 或者VPN连接通道
    4. 兼容VNC 4 免费版本和 VNC 3

    网站: http://www.realvnc.com/

    六.Vinagre
    Vinagre是GNOME下的一个VNC客户端 Vinagre允许用户同时查看多台机器,通过Avahi发现网络上的VNC服务器,并自动保存最近的连接和列出使用最常使用的连接。现 在,Vinagre已经取代了xvnc4viewer成为Ubuntu里默认的VNC客户端。 Vinagre现在已经支持四十多种语言了,它具体有以下的特点:
    可以同时连接多台机器
    自动列出最常使用的连接
    保存最近使用过的连接
    搜索你网络中的VNC服务器
    无需在每一个连接里都填写密码(前提是你使用了GNOME Keyring)

    网站: http://www.gnome.org/projects/vinagre/
    七.LTSP
    它是一个基于 linux 终端服务器的项目, 它为全球学校,商业和其他组织提供了一个易用的,低成本的,安装简单的桌面工作站。
    LTSP是一个允许用户连接很多性能偏低的linux 服务器内置的客户端终端。对于运行在linux服务器上面的应用程序,都能”投影“到一个简易终端里面。LTSP(Linux Terminal Server Project),简单来说,它就是一个Linux下的终端服务器项目,让你的老式机器,能够通过远程启动,变为一台无盘终端,享受与服务器硬件性能相当 的服务
    LTSP可以是一套可以安装在任何linux操作系统上的软件包集合,同样也可以作为一些发行版,如:K12Ltsp,SkoleLinux和EDUlinux的一部分。
    一个简易的LTSP客户端网络触手可及,并且不需要太强大的性能的服务器,就能在上面运行几个客户端。如果你想额外再添加客户端,你就应该考虑下现有服务器的性能了,或者添加些服务器。
    1.给服务器添加建议的客户端支持
    2.提升通过使用ssh-X图形化交互界面的用户的安全。
    3.领先的安全策略
    4.NBD,网络仿真区块设备
    5.无需内置客户端的软件,LTSP仅仅需要一个兼容的,并且很多PC都已经内置的PXE网络界面。
    6.免费且专业的技术支持。

    网站:http://www.ltsp.org/
    八.x2go
    x2go 是基于NX运行库的一个快速的终端服务套装。它是几个集合了不同的已知问题解决方案优势的,以服务器环境为基础的软件。
    它能够实现由单独PC的安装到企业级多服务器和LDAP树的网络的不同环境下的定制安装。
    x2go具有快速,安全且方便的特征,能够让你快速的在局域网中连接到其他电脑上,甚至,对于带宽很窄的手机网络,都能提供快速连接。功能:
    x2go是一个支持多种不同CPU架构的开源软件
    1. 与windows系统无缝连接
    2. 无需桌面环境即可独立运行应用程序
    3. 支持现代的认证技术,如:读卡器,USB设备
    4. 支持把认证信息存储在USB闪存或者智能卡上
    5. 集成到KDE控制中心的设置模块包括:用户,组,设备管理和会话控制子功能
    6. 为samba管理提供的前端界面
    7. 管理桌面共享的前端界面
    8. 客户端: 可集成到gnome桌面内的GTK客户端,QT客户端,为开源的Maemo平台提供移动客户端。

    网站:http://www.x2go.org/

    九. NoMachine NX
    它是一个基于企业级对比套装的开源的终端服务器。它允许用户在连接速度缓慢或者窄带宽的情况下,对X11会话进行远程访问。
    NX项目提供一整套的运行库文件以及优化的来自X11,SMB,IPP,HTTP及其网络上的其他音视频协议的传输
    NX使用SHH协议来发送数据并使用公匙密码系统作为认证手段。当客户端连接到服务端的时候,通常是以 nx,这个用户名并以SHH的公匙方法认证来登陆的。
    NX提供很多版本,包括:NX服务器免费版,NX企业级桌面服务器,NX小型商业服务器,NX企业服务器和NX高级服务器。只有第一种才能在GPL协议下使用,剩下的都需要商业授权才行。
    1. 可连接到 XDMCP服务器,Windows 命令行服务器以及 Citrix MetaFrame
    2. 为 X11, RDP 和VNC桌面环境提供安全保障
    3. 在本地客户端桌面上整合单一的X11应用程序
    4. Windows 文件共享的支持模式允许你共享linux系统下的整块硬盘
    5. 数据以 SSL 形式加密并确保安全性
    6. 支持 IPv6
    7. 整合SSH
    8. 基于 PAM的认证体系
    9. 支持打印
    10. 提供对64位的支持
    11. NX提供计算架构,整套开源技术以及商业工具,以此来确保软件的易用性
    12. 支持自定义脚本

    网站:http://www.nomachine.com/

    十.FreeNX
    FreeNX 是一个基于 GPL协议的 NX服务端和客户端的实现工具。
    NX是一项致力于远程显示的技术。它可以在高速和低速的网络状况下保障应用程序以近乎本地的速度来访问和控制。NX的的核心运行库文件由 NoMachine在GPL协议的基础上提供。主要特性:
    1. 占用极少量带宽
    2. 支持会话暂停
    3. 支持NX客户端和后端

    主页:http://freenx.berlios.de/

    十一. OpenSSH
    OpenSSH是一个被大家广泛使用的基于SSH网络连接工具的免费软件。它内置很多程序:
    1. shd: 负责运行在服务器上,并对连接进行监听,当收到客户端连接时,负责认证并为客户端服务
    2. sh:别名 slogin,运行在客户端上的用于登陆其他电脑并运行命令的程序
    3. cp:安全的在不同机器之间拷贝文件
    4. sh-keygen:用于创建公匙认证文件(RSA或者DSA)
    5. sh-agen:认证的代理程序,用于保存 RSA认证密匙。
    6. sh-add:用户通过代理程序来添加,注册新的密匙
    7.ftp-server: SFTP服务器的子系统
    8.ftp:文件传输程序
    9.sh-keyscan:收集SSH公匙的程序
    10.sh-keysign: 用于主机认证的ssh辅助程序。

    网址: http://www.openssh.org/

  • Fedora release 20

    1. 关闭防火墙

    systemctl stop firewalld                停止防火墙

    systemctl disable firewalld          禁用防火墙

    2. 停用selinux

    vi /etc/selinux/config

    将文件中的SELINUX选项修改为disable.

    #     enforcing – SELinux security policy is enforced.
    #     permissive – SELinux prints warnings instead of enforcing.
    #     disabled – No SELinux policy is loaded.
    SELINUX=disable

    3. 安装更新源

    a) yum install yum-fastestmirror

    b) 下载 http://download1.rpmfusion.org下的free和nonfree中fedora20的rpm包(双击安装即可). 地址如下:

    http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-20.noarch.rpm

    http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-20.noarch.rpm

    4. 安装一些软件(上面3步执行之后建议重启一下电脑)

    yum -y install unar p7zip p7zip-plugins ibus-table ibus-pinyin ibus-table-chinese-wubi-haifeng  gnome-tweak-tool stardict stardict-dic-zh_CN stardict-dic-en

    一些开发软件:  yum -y install  vim emacs gcc gcc-c++ glibc.i686 glibc ncurses make cmake

    yum -y install  samba xinetd tftp tftp-server ftp vsftpd

     

    5. 支持mp3 rmvb等一系列格式 (摘自: http://www.linuxidc.com/Linux/2012-06/62112.htm )

    yum localinstall –nogpgcheck  http://mirrors.163.com/rpmfusion/free/fedora/rpmfusion-free-release-stable.noarch.rpm

    yum install gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly libtunepimp-extras-freeworld xine-lib-extras-freeworld

    yum install ffmpeg ffmpeg-libs gstreamer-ffmpeg libmatroska xvidcore

     

    6. 安装flash player

    a) 到adobe网站上下载gz包.

    b) 解压, 将usr文件夹拷贝到/目录    cp -rf usr /

    c) 将解压的libflashplayer.so拷贝到firefox目录    cp -f libflashplayer.so /usr/lib64/mozilla/plugins/

     

    二.  所遇问题解决方法

    1. 不能安装flash player (注意: 此安装需要占用大量磁盘空间,多数会安装一些无用程序)

    先执行: sudo yum -y install gstream-*

    sudo yum -y install gstream1-*

    执行后一般能安装,默认音频和视频播放器能正常安装插件.

    2. bad ELF interpreter: 没有那个文件或目录

    出错: 64位机 安装glibc.i686即可

    解决: sudo yum install glibc.i686

    3. 安装qt出现错误

    出错: cannot find -Igl

    解决: yum install libGL libGL-devel

  • 【转】IIS服务命令 FTP命令格式

    IIS服务命令:
    iisreset /reboot 重启win2k计算机(但有提示系统将重启信息出现)
    iisreset /start或stop 启动(停止)所有Internet服务
    iisreset /restart 停止然后重新启动所有Internet服务
    iisreset /status 显示所有Internet服务状态
    iisreset /enable或disable 在本地系统上启用(禁用)Internet服务的重新启动
    iisreset /rebootonerror 当启动、停止或重新启动Internet服务时,若发生错误将重新开机
    iisreset /noforce 若无法停止Internet服务,将不会强制终止Internet服务
    iisreset /timeout Val在到达逾时间(秒)时,仍未停止Internet服务,若指定/rebootonerror参数,则电脑将会重新开机。预设值为重新启动20秒,停止60秒,重新开机0秒。
    FTP 命令: (后面有详细说明内容)
    ftp的命令行格式为:
    ftp -v -d -i -n -g[主机名] -v 显示远程服务器的所有响应信息。
    -d 使用调试方式。
    -n 限制ftp的自动登录,即不使用.netrc文件。
    -g 取消全局文件名。
    help [命令] 或 ?[命令] 查看命令说明
    bye 或 quit 终止主机FTP进程,并退出FTP管理方式.
    pwd 列出当前远端主机目录
    put 或 send 本地文件名 [上传到主机上的文件名] 将本地一个文件传送至远端主机中
    get 或 recv [远程主机文件名] [下载到本地后的文件名] 从远端主机中传送至本地主机中
    mget [remote-files] 从远端主机接收一批文件至本地主机
    mput local-files 将本地主机中一批文件传送至远端主机
    dir 或 ls [remote-directory] [local-file] 列出当前远端主机目录中的文件.如果有本地文件,就将结果写至本地文件
    ascii 设定以ASCII方式传送文件(缺省值)
    bin 或 image 设定以二进制方式传送文件
    bell 每完成一次文件传送,报警提示
    cdup 返回上一级目录
    close 中断与远程服务器的ftp会话(与open对应)
    open host[port] 建立指定ftp服务器连接,可指定连接端口
    delete 删除远端主机中的文件
    mdelete [remote-files] 删除一批文件
    mkdir directory-name 在远端主机中建立目录
    rename [from] [to] 改变远端主机中的文件名
    rmdir directory-name 删除远端主机中的目录
    status 显示当前FTP的状态
    system 显示远端主机系统类型
    user user-name [password] [account] 重新以别的用户名登录远端主机
    open host [port] 重新建立一个新的连接
    prompt 交互提示模式
    macdef 定义宏命令
    lcd 改变当前本地主机的工作目录,如果缺省,就转到当前用户的HOME目录
    chmod 改变远端主机的文件权限
    case 当为ON时,用MGET命令拷贝的文件名到本地机器中,全部转换为小写字母
    cd remote-dir 进入远程主机目录
    cdup 进入远程主机目录的父目录
    ! 在本地机中执行交互shell,exit回到ftp环境,如!ls*.zip

  • Build your own Litecoin Mining Rig

    http://www.cryptobadger.com/2013/04/build-a-litecoin-mining-rig-linux/

     

    In the second installment of our DIY litecoin mining guide, we’ll look at how to install and configure Linux to properly mine with your GPUs at optimal settings. Don’t be dissuaded if you’ve never used Linux before—our step-by-step guide makes it easy.

    Linux has a few advantages over Windows, including the ability to install to a USB stick (which means you don’t need a harddrive), lesser hardware requirements (you can get by just fine with less than 4GB of RAM), and simpler remote administration capabilities. Best of all, Linux is free! However, be aware that if you’d like to undervolt your GPUs to save power, Windows might be a better choice for you (update 10/2013: no longer true!).

    If you missed the hardware portion of our guide, make sure to check it out first. Otherwise, read on.

     

    Build a Litecoin Mining Rig, part 2:  Linux Setup

    So you’ve decided to use Linux to run your mining rig—a fine choice! If you’re still a bit nervous because you’ve a complete Linux newbie, don’t be. Simply follow the step-by-step instructions exactly as they’re written, and you’ll be fine. Even if you’ve never done anything like this before, you should be up and running in about an hour.

    Step 1: Configure BIOS settings

    Before we even get to Linux, make sure your mining computer’s BIOS settings are in order. Power on your computer, and press the “delete” key a few times immediately after power on. You should end up in the BIOS configuration area. Do the following, then save & exit:

    • Change power options so that the computer automatically turns itself on whenever power is restored. The reason for this is two-fold: first, it’ll make sure that your miner automatically starts up after a power outage. Second, it makes powering the computer on much easier if you don’t happen to have a power switch connected to the motherboard.
    • Make sure that your USB stick is first in the boot-up order (you may need to have a USB stick attached).
    • Disable all components that you don’t plan to use. This will save a little bit of power, and since your miner will likely be running 24/7, it’ll add up. For me, that meant disabling onboard audio, the SATA controller, the USB 3.0 ports (I only had a 2.0 USB stick), the Firewire port, and the serial port.

    Step 2: Install Xubuntu Desktop to your USB stick

    Xubuntu is a lightweight version of Ubuntu, a popular Linux distribution. Most other distros should work just fine, but be aware that the GPU drivers require the presence of Xorg, which means server distros that don’t have a GUI will not work properly.

    • Download the Xubuntu Desktop x64 v12.10 installation image.
    • You’ll need to either burn the installation image onto a CD, or write the image to a second USB stick. If you use a CD, you’ll need to temporarily hook up a CD-ROM drive to your mining rig for the installation (make sure you temporarily enable your SATA controller if you disabled it in step 1!).
    • Once you have the installation media prepared, you’re ready to install Xubuntu to the blank USB stick on your miner. Make sure your blank USB stick is inserted into a USB port on your mining, and then boot into your installation media. The Xubuntu installer should appear.
    • Make sure to click the “auto-login” box towards the end of the installer; otherwise take all of the default installation options.
    • If you’re using a USB stick that is exactly 8GB, the installer may complain about the default partition sizes being too small. Create a new partition table with these settings: 5500mb for root (/), 315mb for swap, and the remaining amount for home (/home). If you’re using a USB stick larger than 8GB, you will not have to do this.
    • When the installation is complete, you should automatically boot into the Xubuntu desktop. Make sure to remove your installation media.

    Step 3: Install AMD Catalyst drivers

    Open a terminal session by mousing over the bottom center of the screen so that a list of icons appears. Click on “terminal” (it looks like a black box).

    • Type the following commands (press “enter” at the end of each line and wait for Linux to finish doing it’s thing):
      sudo apt-get install fglrx-updates fglrx-amdcccle-updates fglrx-updates-dev
      sudo aticonfig --lsa
      sudo aticonfig --adapter=all --initial
      sudo reboot
    • After your computer reboots, you can verify that everything worked by typing:
      sudo aticonfig --adapter=all --odgt
    • If you see all of your GPUs listed, with “hardware monitoring enabled” next to each, you’re good to go.

    Important: you may need to have something plugged into each GPU to prevent the OS from idling it. You can plug 3 monitors into your 3 GPUs, but that isn’t very practical. The easiest option is to create 3 dummy plugs, and leave them attached to your GPUs. They’ll “trick” the OS into believing that a monitor is attached, which will prevent the hardware from being idled. Check out how to create your own dummy plugs.

    If you ever add or remove GPUs to your rig later, you’ll need to re-run this command:   sudo aticonfig --adapter=all --initial

    Step 4: Install SSH, Curl, and package updates

    • Install SSH by typing:
      sudo apt-get install openssh-server byobu

    With SSH installed, you can unplug the keyboard/mouse/monitor (put dummy plugs into all GPUs, though) from your miner, and complete the rest of the installation from your desktop computer. Simply download Putty onto your desktop, run it, and enter the IP address of your mining rig. That should bring up a remote terminal session to your miner, which is more or less just like sitting at the keyboard in front of it.

    If you plan to manage your mining rig remotely over the internet, you’ll need to forward port 22 on your router to your miner. Make sure that you use a strong Xubuntu password!

    Setup should be quicker from this point, as now you can simply copy text from this webpage (highlight it and press control-C) and then paste it into your Putty session by simply right-clicking anywhere inside the Putty window. Neat, eh?

    • Install Curl and package updates by typing (or copying & pasting into Putty) the following commands:
      sudo apt-get install curl
      sudo apt-get update
      sudo apt-get upgrade

    Step 5: Install cgminer

    Cgminer is the mining software we’ll be using. If the first command doesn’t work, you’ll need to check out the cgminer website and make a note of the current release version. Substitute that in the commands below.

    Update: Cgminer 3.7.2 is the last version to support scrypt—do not use any version after that! In addition, depending on which version you choose to use, you may receive an error complaining about libudev.so.1 when you try to run cgminer—you can find the fix for that here.

    • Type the following:
      wget http://ck.kolivas.org/apps/cgminer/2.11/cgminer-2.11.4-x86_64-built.tar.bz2
      tar jxvf cgminer-2.11.4-x86_64-built.tar.bz2
    • If everything was uncompressed successfully, we can delete the downloaded archive; we don’t need it anymore:
      rm *.bz2
    • Now check if cgminer detects all of your GPUs properly:
      cd cgminer-2.11.4-x86_64-built
      export DISPLAY=:0
      export GPU_USE_SYNC_OBJECTS=1
      ./cgminer -n

    Step 6: Create cgminer startup script

    We’re almost done—now we just need to create a few simple scripts to control cgminer.

    • If you’re still in the cgminer directory from the previous step, first return to your home directory:
      cd ..
    • Type the following to create a new file with nano, a Linux text editor:
      sudo nano mine_litecoins.sh
    • Type the following into nano (note where the places you need to substitute your own usernames!) :
      #!/bin/sh
      export DISPLAY=:0
      export GPU_MAX_ALLOC_PERCENT=100
      export GPU_USE_SYNC_OBJECTS=1
      cd /home/YOUR_XUBUNTU_USERNAME/cgminer-2.11.4-x86_64-built
      ./cgminer --scrypt -I 19 --thread-concurrency 21712 -o stratum+tcp://coinotron.com:3334 -u USERNAME -p PASSWORD
    • Save the file and quit nano, then enter the following:
      sudo chmod +x mine_litecoins.sh

    Note that the cgminer settings we’re using in our mine_litecoins.sh script correspond to a good starting point for Radeon 7950 series GPUs. If you followed our hardware guide, these settings will give you good hashrates. If you’re using another type of GPU, you’ll want to use Google to find optimal cgminer settings for it.

    Also note that you’ll need to create an account at one of the litecoin mining pools, and plug your username and password into the script (the -u and -p parameters). I have Coinotron in there as an example, but there are quite a few to choose from.

    Step 7: Create auto-start scripts

    We want cgminer to automatically start mining whenever the rig is powered on. That way, we keep mining losses to a minimum whenever a power outage occurs, and we don’t have to worry about manually starting it back up in other situations.

    • Type the following to create a new script and open it in nano:
      sudo nano miner_launcher.sh
    • Enter the following text into the editor (substitute your Xubuntu username where shown!):
      #!/bin/bash
      DEFAULT_DELAY=0
      if [ "x$1" = "x" -o "x$1" = "xnone" ]; then
         DELAY=$DEFAULT_DELAY
      else
         DELAY=$1
      fi
      sleep $DELAY
      su YOUR_XUBUNTU_USERNAME -c "screen -dmS cgm /home/YOUR_XUBUNTU_USERNAME/mine_litecoins.sh"
    • Save and quit nano, and then type:
      sudo chmod +x miner_launcher.sh
    • Now we need to call our new script during startup; we do that by adding it to /etc/rc.local. Type the following to open /etc/rc.local in nano:
      sudo nano /etc/rc.local
    • Add the following text, right above the line that reads “exit 0″ (substitute your own username!):
      /home/YOUR_XUBUNTU_USERNAME/miner_launcher.sh 30 &

    Step 8: Create an alias to easily check on cgminer

    We’re essentially done at this point, but you’ll probably want to manually SSH into your miner from time to time to manually check on your GPU temperatures & hashrates, etc. Creating an alias will make that easy.

    • Type:
      sudo nano .bashrc
    • Scroll to the end of the file, and then add this text above the line that reads “# enable programmable completion…”
      alias cgm='screen -x cgm'
    • Save and quit out of nano.

    That’s it—you’re done! You’ll probably want to test everything now. The easiest way to do that is to close your Putty session and power down your miner. Turn it back on and the following should happen:

    1. Your miner should boot into Xubuntu. This may take about a minute, depending on the speed of your USB stick.
    2. 30 seconds after Xubuntu has loaded, cgminer will automatically start and begin mining. You’ll probably notice the fans on your GPUs spin up when this happens.
    3. You should be able to SSH into your miner at any time and type cgm to bring up the cgminer screen. To close the screen (and leave cgminer running), type control-A, then control-D.
    4. If you ever need to start cgminer manually (because you quit out of it, or kill it, etc), simply type ./miner_launcher.sh

    cgminer running

    If all went well, you should see something like this when checking cgminer via your “cgm” alias.

    Congratulations—you have your own headless linux litecoin miner!

    http://www.cryptobadger.com/2013/04/build-a-litecoin-mining-rig-windows/

    By now you’ve probably seen our Linux Litecoin mining setup guide (and hopefully the hardware guide that preceded it). Perhaps you’ve decided that Linux just doesn’t seem like your cup of tea. If Windows is more your thing, you’re in luck—this guide is for you.

    Let me just reiterate that for most people, Linux is likely the better choice. With Linux, you can use a $5 USB stick instead of a $50 harddrive, and you save yourself the cost of a Windows license as well. The actual mining performance will be the same on either platform, so the cost savings of Linux would seem to make it a no-brainer as long as you’re comfortable with the slightly more complex setup (although our guide makes it simple!).

    However, if you have GPUs that aren’t voltage-locked (such as the MSI 7950s that we recommend in our hardware guide), and you plan to take advantage of that feature to undervolt your cards (we’ll show you how), Windows might become the better long-term option for you, depending on how much electricity costs in your area (edit 10/2013: easy undervolting in linux is now possible, too).

    So with that in mind, if Windows sounds like it’s the right choice for you, read on for our setup guide!

     

    Build a Litecoin Mining Rig, part 3:  Windows Setup

    I’m not going to go into quite as much detail as I did with our Linux setup guide, as most of you are probably already quite comfortable with basic Windows tasks. The steps outlined below should be adequate for the average Windows user, but feel free to leave comments if anything is unclear or missing.

    Step 1: Configure BIOS Settings

    Before we even get to Windows, make sure your mining computer’s BIOS settings are in order. Power on your computer, and press the “delete” key a few times immediately after power on. You should end up in the BIOS configuration area. Do the following, then save & exit:

    • Change power options so that the computer automatically turns itself on whenever power is restored. The reason for this is two-fold: first, it’ll make sure that your miner automatically starts up after a power outage. Second, it makes powering the computer on much easier if you don’t happen to have a power switch connected to the motherboard.
    • Disable all components that you don’t plan to use. This will save a little bit of power, and since your miner will likely be running 24/7, it’ll add up. For me, that meant disabling onboard audio, the USB 3.0 ports (I only had a 2.0 USB stick), the Firewire port, and the serial port.

    Step 2: Install Windows 7

    Any 64-bit edition of Windows 7 should work fine (32-bit installations should work too, but may require tweaking the settings that I provide). Windows 8 should work as well, although I have not tested it myself. Feel free to use the cheapest SATA hard drive that you can find, as it won’t impact mining performance.

    I’m going to assume that everyone reading this is capable of installing a fresh copy of Windows 7. Complete the installation and boot into the Windows desktop before proceeding to the next step. If necessary, also install the LAN/Ethernet driver that came with your motherboard so that you can get online.

    Step 3: Install Windows security updates

    While this step isn’t strictly necessary in order to get you mining, it is strongly recommended.

    • Click Start Menu -> Control Panel -> System & Security -> Windows Update -> Check for Updates
    • Install all of the critical updates

    Repeat the above two steps until there are no more updates to install. Depending on how old your Windows installation media is, this process could take quite awhile.

    Step 4: Configure automatic login

    We want our mining rigs to boot up and start mining without any intervention on our part. We’ll need to enable auto-login for that to happen.

    • Click on the Start Menu and type “netplwiz” (without the quotes) into the search box, and click on it when it appears in the programs list.
    • Uncheck the box that says “Users must enter a user name and password to use this computer”.
    • Click “Apply”. You’ll be prompted to enter your password to confirm the change.

    Step 5: Change power settings to prevent sleep

    By default, Windows will go to sleep after 30 minutes without user interaction. Obviously, we don’t want that behavior on our mining rigs. To disable it:

    • Click Start Menu -> Control Panel -> System & Security -> Power Options.
    • “Balanced” should be selected. Click on “Change plan settings” next to it.
    • Under “Plugged in”, change “Put the computer to sleep” to “Never”, then click “Save changes”.

    Step 6: Install Catalyst GPU drivers & SDK

    The latest version of the Catalyst drivers (13.x) are known to cause issues when mining. Version 12.8 and 12.10 are generally regarded as the best mining options (I’ve opted for 12.8). Some versions of the SDK can cause issues as well (I’m using 2.7, as the 2.8 SDK is known to be buggy with cgminer).

    Note that these drivers are for Radeon 7xxx series GPUs (like the 7950 that I recommend in part 1 of this guide). If you’re using another GPU, you’ll need to go to the AMD site and get appropriate drivers.

    Important: you may need to have something plugged into each GPU to prevent the OS from idling it. You can plug 3 monitors into your 3 GPUs, but that isn’t very practical. The easiest option is to create 3 dummy plugs, and leave them attached to your GPUs. They’ll “trick” the OS into believing that a monitor is attached, which will prevent the hardware from being idled. Check out how to create your own dummy plugs.

    Step 7: Install cgminer

    Cgminer is the mining software we’ll be using.

    • Download the cgminer archive (if this link is broken, check the cgminer website for the latest version and download that).
    • Extract the downloaded archive into a folder on your mining computer (you may need 7-zip to extract it).
    • Open the folder where you extracted cgminer, and create a new text file called “mine_litecoins.bat” (you can use notepad for this).
    • Enter the following text into your mine_litecoins.bat file (make sure to substitute your own pool user name and password—see note below):
      timeout /t 30
      setx GPU_MAX_ALLOC_PERCENT 100
      setx GPU_USE_SYNC_OBJECTS 1
      cgminer --scrypt -I 19 --thread-concurrency 21712 -o stratum+tcp://coinotron.com:3334 -u [USER] -p [PASS]

    Note that the cgminer settings we’re using in our mine_litecoins.bat script correspond to a good starting point for Radeon 7950 series GPUs. If you followed our hardware guide, these settings will give you good hashrates. If you’re using another type of GPU, you’ll want to use Google to find optimal cgminer settings for it.

    Also note that you’ll need to create an account at one of the litecoin mining pools, and plug your username and password into the script (the -u and -p parameters). I have Coinotron in there as an example, but there are quite a few to choose from.

    Step 8: Configure cgminer to start automatically

    We want cgminer to automatically start mining whenever the rig is powered on. That way, we keep mining losses to a minimum whenever a power outage occurs, and we don’t have to worry about manually starting it back up in other situations.

    • In your cgminer folder, right-click on your new mine_litecoins.bat file, and click “Copy”.
    • Now, click on the Start Menu, then right-click on “All Programs”. Finally click on “Open All Users”.
    • Double-click “Programs”, then double-click “Startup”. Right-click anywhere on the empty background of the Startup folder and select “Paste shortcut”.

    You should see a shortcut to your mine_litecoins.bat batch file appear in the startup folder. Windows should automatically execute it upon bootup.

    At this point, we’re done with the essentials. If you’ve done everything correctly, you should be able to reboot and watch your rig automatically start mining shortly after the Windows desktop loads. There are a couple more steps that may be important to you, though.

    Step 9 (optional): Configure MSI Afterburner & GPU undervolting

    If you have GPUs that aren’t voltage-locked, like the cards I recommended in our hardware guide, then this is the main advantage Windows has over Linux. Unfortunately, the AMD ADL for Linux imposes some artificial limits on voltage settings that aren’t present in Windows. Thus, in Windows, it’s possible to lower the voltage on certain GPUs, which will result in a significant power savings—without negatively affecting performance!

    Disclaimer: changing the factory voltage settings on your GPU can result in system instability, crashes, and/or damage. Proceed at your own risk!

    • Download MSI Afterburner.
    • When the download is complete, extract the archive and install Afterburner.
    • After installation, open Afterburner (you may be prompted to reboot—do so if asked). Click the “settings” button in the lower right, and enable every option on the “general” tab, except auto-update (the last one). Close the settings.
    • Now you should be able to change the voltage settings on your GPUs, assuming your card supports it. If you’re using the MSI 7950 from our hardware guide, 1087 mV is a good place to start.
    • Click the “auto apply overclock settings on startup” button, and minimize Afterburner.

    MSI Afterburner will auto-start at bootup, and your voltage settings will be applied automatically. For me, running a rig with our recommended hardware, using Afterburner to undervolt GPUs resulted in a ~150w reduction in power usage. Pretty significant considering the rig runs 24/7!

     Step 10 (optional): Configure remote administration

    Configuring remote administration will allow you to disconnect the monitor, keyboard, and mouse from your mining rig and manage it from another computer—even over the internet, if you wish. The Windows built-in Remote Desktop Administration feature unfortunately isn’t a great option, as it messes with the GPU driver and will prevent cgminer from reading temperature information properly.

    Fortunately there are a host of other options available. I recommend TightVNC or Google Chrome Remote Desktop. Both are lightweight, simple, and free. Here are the basic setup instructions for TightVNC:

    • Download TightVNC.
    • Install TightVNC on your mining rig. Choose a custom installation and make only the server portion of the application available.
    • Now install TightVNC on the other computer(s) that you plan to manage your rig with. Choose a custom installation and make only the client portion of the application available.
    • If you plan to manage your miner across the internet, forward port 5900 on your router to your mining rig (make sure you choose a strong password if you do this!).

    That’s it—you’re done! You’ll probably want to test everything now. The easiest way to do that is to power down your miner. Turn it back on and the following should happen:

    1. Windows should boot up as usual.
    2. You should see a 30 second countdown to cgminer’s launch shortly after the Windows desktop appears.
    3. MSI Afterburner will load minimized (if you installed it in step 9) at some point, and undervolt your GPUs.
    4. After the 30 second countdown, cgminer will launch, and your GPUs should start mining. You’ll probably hear your GPU fans spin up a few seconds after this occurs.
    5. You should be able to VNC into your rig at any point after the desktop loads to monitor cgminer’s progress and GPU temperatures.
    6. If you ever need to start cgminer manually (because you quit out of it, or killed it, etc), simply double-click your mine_litecoins.bat file, located in your cgminer folder.

    cgminer in Windows

    If all went well, you should see something like this in your cgminer window!

    Congratulations—you have your own headless windows litecoin miner!

    The screenshot above shows 3x 7950 GPUs getting nearly 1.9 Mh/sec, which is pretty good. These cards are slightly overclocked (but still undervolted!)—I show you how to achieve even higher speeds in the next section of this guide.

     

     

  • 转–virtualbox 下Ubuntu使用USB

    关于linux mint 下virtualbox使用USB 的一点经验或者可以说是教训,由于我的Andriod开发在linux系统下进行的 ,为了因为要经常下载软件,在linux下下载不方便,就在linux下安装了虚拟机跑XP,在XP 下下载软件,于是就出现了虚拟机使用USB 问题
    方法/步骤

    1

    确保已经安装了virtualbox 建议安装最新的 我安装的是4.2.16和对应的 Extend pack

    1、

    https://www.virtualbox.org/wiki/Downloads 下载对应于你的系统的版本(linux windows等)注意要对应于你的操作系统位数是32还是64

    2、exntend pack

    在这个网站中找到:

    VirtualBox 4.2.16 Oracle VM VirtualBox Extension Pack  All supported platforms

    该包适合与所有的平台 不管是linux 还是windows还是其他的
    2

    以上安装完毕后,在Virtualbox主界面中可以看到USB设备,在虚拟机中的可分配USB设备也可以看到,但是灰色不可用。按照如下步骤做:

    1、添加usbfs 用户组(virtualbox 装完成后会有 vboxusers 和vboxsf )

    sudo groupadd usbfs

    使用命令查看你添加的用户组成功没有:

    cat /etc/group  我的如下:

    ………………

    ……………….

    ……………….

    colord:x:120:pulse:x:121:pulse-access:x:122:saned:x:123:vboxsf:x:124:sambashare:x:125:kueinmdm:x:110:kuein:x:1000:vboxusers:x:116:kueinwinbindd_priv:x:126:usbfs:x:1001:kuein // 这个就是我添加的

    2、将你的linux常用用户添加到vboxusers、usbfs这个两个组中

    sudo adduser kuein vboxusers

    sudo adduser kuein usbfs

    有些资料上说 还有第三步:

    3)、修改fstab文件,添加如下内容:

    none /sys/bus/usb/drivers usbfs devgid=802,devmode=664 0 0

    我操作过程当中 做了也没有用 所以我就省略了这步

    然后重启电脑,只有重启才会有用
    3

    重启之后,插上你的USB设备 ,在virtualbox的第一个选项中选择settings菜单 选择USB项 将enable usb controler 、enable usb2.0 controler打勾。在USB device filler项点击“+”选择你的USB 设备,将你的USB 设备添加上,进入虚拟机安装的系统在状态栏(我的是XP 右下角)的USB图标上右击鼠标,选择你刚添加的你的USB 设备,没有弹出失败的框框说明已经成功。如果需要则会提示安装USB 驱动。注意:我在这里卡了很久,总是提示什么主机没有加载,明明我在linux下用lsusb 看到我的设备了,后来我就重启了虚拟机,再次点击还是同样的提示,哥郁闷,想了个歪招,切换到我的爽系统之一XP (不是Virtualbox中的这个XP 哦),格式化了我的USB 设备,再次进入虚拟机的XP 系统,成功提示安装USB驱动,OK 大功告成!下载软件 开机OK 。如果你是和我一样,注意一下我说的这两点。

    以上就是我的virtualbox使用USB 经验,由于刚刚搞这个东东,难免有很多地方让民间的高手觉得弱智,如果不对地方请大家多多包涵,并予以指正 ,多谢

    注意事项

    vritualbox版本最好用最新的版本,如果不是最新的版本 下载extend [pack 有点儿小麻烦

    如果你跟我一样是下软件到USB 设备的话 可能会有些不稳定 如果不能下载,点击右下角的USB图标,重新加载你的USB 就可以了

  • 转–ubuntu apt-get install

    sudo apt-get install ntfs-3g ntfs-config #ntfs写入支持,装完后运行ntfs-config,把两个钩打上即可。楼下方法作废
    sudo apt-get install googleearth googlizer gtalk#google相关,skyx友情提示:不推荐马甲 gtalk
    sudo apt-get install ghex #GNOME 上的十六进制文件编辑器
    sudo apt-get install kvm #Full virtualization on x86 hardware 华主席推荐
    sudo apt-get install vmware-player #Free virtual machine player from VMware
    sudo apt-get install makeself #utility to generate self-extractable archives
    sudo apt-get install sun-java6-jre#安装JAVA6环境
    sudo apt-get install sun-java6-jdk #安装JAVA6环境#
    sudo update-alternatives –config java#设定JAVA环境
    sudo apt-get install rox-filer#一个简单的文件管理软件
    sudo apt-get install socks4-server socks4-clients #一个socks 代理服务器/soks4代理客户端
    sudo apt-get install mc #类似norton commander 工具,skyx 吐血推荐
    sudo apt-get install liferea #超强的rss reader ,明显比akregator好用, 由zhuqin_83吐血推荐
    sudo apt-get install axel-kapt gwget aria2#多线程下载工具,也可在论坛search 超强工具prozilla,由雕啸长空吐血推荐
    sudo apt-get install privoxy tor mixmaster anon-proxy socat#突破风锁线和雁过无痕
    sudo apt-get install kdebluetooth #超简单的ubuntu与蓝牙手机互传文件工具
    #蓝牙请参见:   http://forum.ubuntu.org.cn/viewtopic.php?t=61426&;highlight=
    sudo apt-get install build-essential #build-essential
    sudo apt-get install proxychains #一个socks4 socks5代理软件 ,可以支持apt-get代理
    sudo apt-get install language-support-zh language-pack-zh#安装中文语言支持
    sudo apt-get install stardict stardict-common stardict-cdict-gbstardict-cedict-gb stardict-hanzim stardict-langdao-ce-gbstardict-langdao-ec-gb stardict-oxford-gb stardict-xdict-ce-gbstardict-xdict-ec-gb stardict-jcedict stardict-jedictstardict-jmdict-en-ja stardict-jmdict-ja-en wyabdcrealpeopletts#安装StarDict
    sudo apt-get install rxvt yakuake tilda kuake konsole multi-gnome-terminal pyqonsole #几个终端
    sudo apt-get install viewglob #一个shell相关的工具
    sudo apt-get install nautilus-open-terminal #在右键菜单中加入打开终端
    sudo apt-get instll eva amsn wengophone skype licq #安装im语音视频聊天软件
    sudo apt-get install beryl emerald emerald-themes#安装beryl
    sudo apt-get install pcmanx-gtk2 qterm mozilla-plugin-pcmanx #安装bbs 客户端
    sudo apt-get install gkrell* #很好的一个东东,装了就知道了
    sudo apt-get install conky# 有意思的一个系统monitor
    sudo apt-get install nmapfe #nmap前端
    sudo apt-get install meld #一个文件、目录比较器
    sudo apt-get install imagemagick# e主席(ee)大力推荐的批量修改图片的软件,现在论坛个别人在搞个人崇拜
    sudo apt-get install kolourpaint #又一个画图软件
    sudo apt-get install tuxpaint #好玩的画图软件
    rgbpaint #getdeb上有,最弱,但很小巧的画图软件
    mtpaint(getdeb上有,比gpaint强一点的画图软件)。
    sudo apt-get install kompare # 又一个文件比较器
    sudo apt-get install gnome-commander #gnome 上类似Total commander的工具
    sudo apt-get install krusader #kde 上类似Total commander的工具
    sudo sudo apt-get install bum #系统服务管理软件
    sudo apt-get install rbot # ruby写的irc bot
    sudo apt-get install sysv-rc-conf #一款基于perl的开机进程调整工具,sysv-rc-conf执行命令即可
    sudo apt-get install rcconf # Debian Runlevel configuration tool
    sudo apt-get install rar unrar p7zip* #安装rar 7zip
    sudo apt-get install rpm alien #安装rpm支持
    sudo apt-get install xpdf xpdf-chinese-simplified #安装pdf查看软件
    sudo apt-get install xchm xpdf-chinese* #安装chm查看软件
    sudo apt-get install gqview #一个图片浏览器
    sudo apt-get install gnomebaker k3b#安装刻录软件
    sudo apt-get install brasero #gnome上的刻录软件
    sudo apt-get install ksnapshot #一个抓屏程序
    sudo apt-get install kinstaller #application installer
    sudo apt-get install vncserver #vncserver,vncview默认已经安装了
    sudo apt-get install tightvncserver tightvnc-java #另一个vnc
    sudo apt-get install apt-build #frontend to apt to build, optimize and install packages
    sudo apt-get install vim-full #vim无法高亮显示,然后编辑 /etc/vim/vimrc,取消syntax on前面的”注释符号
    sudo apt-get install firestarter #图形接口的防火墙设定程序
    sudo apt-get install smbfs #smbfs挂载支持
    sudo apt-get install flashplugin-nonfree #安装浏览器Flash插件
    sudo apt-get install gftp kftpgrabber filezilla kasablanca#安装ftp客户端
    sudo apt-get install sun-java5-jdk #安装Java环境
    sudo apt-get install sun-java5-plugin #安装Java环境
    sudo apt-get install build-essential # 安装编译环境
    sudo apt-get install yum rpm #redhat相关
    sudo apt-get install mysql-client mysql-server #安装mysql服务
    sudo apt-get install kde-i18n-zhcn kde-i18n-zhtw#k程序中文支持,很讨厌kde ,但不太讨厌qt程序可以这样装
    sudo apt-get install qt4-qtconfig#qt4 gui配制工具, 如字体等,很讨厌kde ,但不太讨厌qt程序可以这样装
    sudo apt-get install kcontrol #k程序gui配制工具,很讨厌kde ,但不太讨厌qt程序可以这样装
    sudo apt-get apache2 mysql-server php4 php4-gd php4-mysql #安装LAMP
    sudo apt-get install d4x azureus amule ktorrent mldonkey-servermldonkey-gui rtorrent qtorrent bittornado-gui bittorrent-guitorrentflux deluge-torrent# 几个下载/bt/电驴 工具
    sudo apt-get install sysstat #安装sar, iostat and mpstat
    sudo apt-get install nmap #网络端口扫描工具
    sudo apt-get install nfs-common #nfs
    sudo apt-get install samba nfs-kernel-server #samba
    sudo apt-get install xvidcap gnome-splashscreen-manager #安装屏幕视频录制 / splash 管理
    sudo apt-get install istanbul #Desktop session recorder
    sudo apt-get install sysinfo xsysinfo#系统信息查看

    网络
    [pre]$ sudo apt-get install d4x //这是linux上的flashget,在apt中可以找到
    $ sudo apt-get install amule //这是linux上的emule,在apt中可以找到
    $ sudo apt-get install eva //这是linux下的qq,只不过狡猾的腾讯修改了协议,用了eva以后再用就必须输入验证码才能进入,但eva并不支持验证码,所以最终的结果就是eva再也没法用了。
    $ sudo apt-get install tor privoxy //匿名动态代理,与之类似的还有JAP和freedom,据说freedom速度更快一些
    $ sudo apt-get install liferea //一个GTK的离线RSS阅读器
    $ sudo apt-get install curl //一个利用URL语法在命令行下工作的文件传输工具
    [/pre]

    系统
    [pre]$ sudo apt-get install rar //安装rar支持,装了以后,压缩包管理器就可以支持rar格式了
    $ sudo apt-get install bum //一个不错的安装系统启动程序管理器
    $ sudo apt-get install xpdf-chinese-simplified  //xpdf的中文字体支持,不过经过试用,貌似乱码依旧,这个问题可以参考ubuntu 下Evince看pdf文档的乱码解决方案
    $ sudo apt-get install gnome-commander //类似norton-commander的文件管理器,功能还不错,比较适合用惯了norton-commander的用户
    $ sudo apt-get install nautilus-open-terminal //在nautilus的右键菜单里打开终端,要重登录才起效
    $ sudo apt-get install nautilus-gksu //在nautilus中以管理员身份打开,要重登录才起效
    $ sudo apt-get install ntp //系统时间与internet时间保持同步
    $ sudo apt-get install meld //基于gonme的目录差异比较工具,可以比较文件夹和文件的变化
    $ sudo apt-get install enca //一个非常不错的编码转换工具
    $ sudo apt-get install keepassx //一个密码管理软件,具有windows版本和linux版本
    $ sudo apt-get gparted //图形化分区工具
    $ sudo apt-get install gcolor2 //一个不错的基于gtk的图形化吸取颜色的工具。
    $ sudo apt-get install unison-gtk //一个基于gtk的文件和目录同步工具,具有比较和合并功能。
    $ sudo apt-get install conduit //一个很牛的资源同步工具,可以同步网络相册,文件夹,邮件、照片等等资源,非常牛X
    $ sudo apt-get install manpages-zh //中文man手册,linux操作系统的必备资料
    [/pre]
    办公软件
    [pre]$ sudo apt-get install scribus //一个类似microsoft publisher的排版软件
    $ sudo apt-get install kchmviewer-nokde //一个看chm的小软件,支持中文,只是安装后只能用命令行启动,执行kchmviewer即可
    [/pre]
    多媒体
    [pre]$ sudo apt-get install ksnapshot //抓图工具
    $ sudo apt-get install ogle ogle-gui  //dvd 播放器
    $ sudo apt-get install mkisofs //貌似是和刻录光盘有关
    $ sudo apt-get install wink //一个屏幕录像工具,可以用来制作视频教程
    $ sudo apt-get install gsopcast //一个网络电视
    $ sudo apt-get install gonmebaker //一个gonme下的刻录光盘软件
    $ sudo apt-get install isomaster //一个管理和生成ISO镜像的小工局,可以提取、修改、删除添加文件,功能挺全的。
    $ sudo apt-get krita //一个小巧的图像编辑软件,比GIMP小巧,但功能对付一般的照片修改已经足够了。
    $ sudo apt-get install xaralx imagemagick //一个巨好的免费矢量图绘制工具,功能不是一般的强,windows下收费,linux下免费。
    $ sudo apt-get install gnome-subtitles //linux下的divx电影的字幕调校工具,可视化的哦
    [/pre]
    游戏
    $ sudo apt-get install wormux //百战天虫linux版,据本人体验,比起百战天虫差不少
    [pre]$ sudo apt-get install assaultCube //一个类似CS的FPS游戏,不过据本人体验,效果比起CS差远了
    $ sudo apt-get install glest glest-data //一个类似魔兽争霸的3D即时战略游戏,相当不错,强烈推荐。

  • Win7下修改TrustedInstaller权限文件(无法删除文…

    在Win7系统中,存在一个虚拟账户,即TrustedInstaller,有时需要对C盘一些系统文件/文件夹进行修改,或删除,就会弹出“你需要TrustedInstaller提供的权限才能修改此文件”。这时用此法可解除此限制。对于系统中一些无法删除的文件/文件夹,有时采用此法也能轻松删除。

    打开记事本,复制粘贴以下代码:

    ========================分割线========================

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\*\shell\runas]

    @=”获取TrustedInstaller权限”

    [HKEY_CLASSES_ROOT\*\shell\runas\command]

    @=”cmd.exe /c takeown /f \”%1\” && icacls \”%1\” /grant administrators:F”

    “IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” && icacls \”%1\” /grant administrators:F”

    [HKEY_CLASSES_ROOT\Directory\shell\runas]

    @=”获取TrustedInstaller权限”

    “NoWorkingDirectory”=””

    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]

    @=”cmd.exe /c takeown /f \”%1\” /r /d y && icacls \”%1\” /grant administrators:F /t”

    “IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” /r /d y && icacls \”%1\” /grant administrators:F /t”

    ========================分割线========================

    将文件保存为扩展名为reg的文件
    运行注册表文件后,右击任意文件或文件夹,菜单中会有“获取TrustedInstaller权限”项,点击此项,如果出现用户账户控制窗口点击是,然后出现一个黑色窗口(如果要处理的文件少,黑框会一闪而过,甚至看不见),黑窗口自动关闭后就可以自由删除和修改文件/文件夹了。