[nodeJS]redis设置密码及nodejs带密码连接

2015-11-3 写技术

redis 默认不需要密码即可访问,黑客直接访问即可获取数据库中所有信息,造成严重的信息泄露。 修复方案:  1、绑定需要访问数据库的IP 修改 redis.conf 中的 “bind 127.0.0.1” ,改成需要访问此数据库的IP地址。  2、设置访问密码 在 redis.conf 中找到“requirepass”字段,在后面填上你需要的密码。  注:上述两种方法修改后,需要重启redis才能生效。 nodejs带密码连接:(片段) args = [port, host, {auth_pass:pass}]; app....

阅读全文>>

标签: nodeJS

评论(0) 浏览(6665)

[MySQL]分页查询的三种方式

2015-10-31 写技术

 SQL中分页查询的方式,记录一下。方式有三种,各自特点就不说了。   CREATE TABLE 收藏表(      `id` bigint(20) unsigned NOT NULL auto_increment COMMENT 'primary key',      `uid` bigint(20) unsigned NOT NULL default 0 COMMENT 'uid',<br>    `status` tinyint(3) un...

阅读全文>>

标签: MySQL

评论(0) 浏览(1968)

[ubuntu]How to use xtensa gcc

2015-10-31 写技术

If you want to use xtensa-lx106-elf.tar.bz2 directly, you need only two steps: (1) tar jxcv xtensa-lx106-elf.tar.bz2 –C /opt (2) export PATH=/opt/xtensa-lx106-elf/bin:$PATH or add it to the end of .bashrc or .profile

阅读全文>>

标签: ubuntu

评论(0) 浏览(2962)

[ubuntu]How to start github

2015-10-30 写技术

Install git: apt-get install git Create a account: Visit github.com, register a account. Create a project in github.com. Create a new repository on the command line: git config --user.name=*** git config --user.email=***@anycle.com ...

阅读全文>>

标签: ubuntu

评论(0) 浏览(1480)

[MySQL]MySQL联合查询语法内联、左联、右联、全联

2015-10-29 写技术

MySQL联合查询效率较高,以下例子来说明联合查询(内联、左联、右联、全联)的好处: T1表结构(用户名,密码)    userid(int)   usernamevarchar(20)   passwordvarchar(20)    1   jack  jackpwd    2   owen  owenpwd    T2表结构(用户名,密码)    userid(int)  ...

阅读全文>>

标签: MySQL

评论(0) 浏览(1544)

[JS]How to get url params

2015-10-29 写技术

How to get url params?   function GetUrlParams(){     var args=new Object();       var query=location.search.substring(1);     var pairs=query.split("&");       for(var   i=0;i<pa...

阅读全文>>

标签: JS

评论(0) 浏览(1480)

[JS] How to jump to an anchor slowly

2015-10-29 写技术

How to jump to an anchor slowly?   function goto(id){  var top = jQuery("#"+id).offset().top;  jQuery("html,body").animate({scrollTop:top},1000); }

阅读全文>>

标签: JS

评论(0) 浏览(1470)

[PHP]html标签与实体之间互换

2015-10-23 写技术

PHP中的几个函数,实现实体与标签之间的互换。记录一下,具体用法就不贴了。   htmlspecialchars_decode() 函数把预定义的 HTML 实体转换为字符。 会被解码的 HTML 实体是: & 解码成 & (和号) " 解码成 " (双引号) ' 解码成 ' (单引号) < 解码成 < (小于) > 解码成 > (大于) htmlspecialchars_decode() 函数是 htmlspecialchars() 函数的反函数。 html_entity_decode() 函...

阅读全文>>

标签: php

评论(0) 浏览(1706)

[ubuntu]Set swap file on ubuntu12.04

2015-10-14 写技术

Creating the Swap File # dd if=/dev/zero of=/swapfile bs=1024 count=512000 512000+0 records in 512000+0 records out 524288000 bytes (524 MB) copied, 10.411 s, 50.4 MB/s # mkswap /swapfile Setting up swapspace version 1, size = 511996 KiB no label, UUID=7baa7ca8-c840-4c6e-bd53-038ce4e9a477 ...

阅读全文>>

标签: ubuntu

评论(0) 浏览(1648)

[ubuntu]ubuntu 12.04 install redis

2015-10-9 写技术

1.Install redis $ wget http://download.redis.io/releases/redis-2.8.3.tar.gz   $ tar xzf redis-2.8.3.tar.gz   $ cd redis-2.8.3   $ make   $ sudo make install   #These files are put in /usr/local/bin now.  2.Copy some files important # cp ...

阅读全文>>

标签: nodeJS ubuntu

评论(0) 浏览(1531)

Powered by anycle 湘ICP备15001973号-1