10 2013 档案

通过外部接口 根据ip获取城市名
摘要:3种接口淘宝/百度/不知名/ 推荐淘宝接口ip自个去获取,下附带php 获取ip的示例function getIP() { static $realip; if (isset($_SERVER)){ if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])){ $realip = $_SERVER["HTTP_X_FORWARDED_FOR"]; } else if (isset($_SERVER["HTTP_CLIENT_IP"])) { ... 阅读全文

posted @ 2013-10-25 16:40 叫我小洋 阅读(5445) 评论(0) 推荐(2)

pg psql命令
摘要:linux下使用psql命令操作数据库下面主要用到了insert into ,pg_dump , pg_restore 命令按步骤走su postgres 切换指定用户pg_restore -d mydb /mnt/mydb.backup mydb指定数据库 mydb.backup 恢复的文件ALTER TABLE table1 RENAME TO table2; 给表重命名 把表1改成表2insert into table1 select name,age,height from student where add_time <'2013-10-01'; ins... 阅读全文

posted @ 2013-10-18 18:24 叫我小洋 阅读(454) 评论(0) 推荐(0)

linux 命令部分说明
摘要:shell 文件头格式 #! /bin/sh定义变量 dir_tmp=/tmp/xxx级联创建 mkdir -p /etc/aaa/bbb 阻塞命令 等待用户输入回车 继续 read yum 安装多个软件 自动安装 多个软件中间用空格 yum install -y httpd mod_ssl php-cli php-devel 不记录日志 >/dev/nullcat 输出内容到文件是有顺序执行的cat 1.text 2.text > 3.text 先输出1到3 再输出2到3ssh在登录的机器里执行命令ssh -p 22022 -i /root/.ssh/xxx.pem root@1 阅读全文

posted @ 2013-10-18 18:00 叫我小洋 阅读(181) 评论(0) 推荐(0)

shell 里把命令的输出赋给变量 以及变量的使用
摘要://获取本月1号 的命令date +%Y-$m-1shell脚本 把时间命令的值赋给变量 并使用#! /bin/sh#赋值time=$(date +%Y-%m-1) #使用变量(转换成时间戳)time_sjc=$( date -d "$time" +%s)#时间戳转换old_time=$(date -d @$time_sjc "+%Y-%m-%d")echo $old_time 阅读全文

posted @ 2013-10-18 17:53 叫我小洋 阅读(2667) 评论(0) 推荐(1)

虚拟机安装centos 6 报错Erro processing drive
摘要:错误提示:Errorprocessingdrive: pci-0000:00:10-scsi-0:0:0:020480MB VMware,VMwareVirtualS Thisdevicemayneedtobereinitialized. REINITIALIZINGWILLCAUSEALLDATATOBELOST! Thisactionmayalsobeappliedtoallotherdisksneedingreinitialization.Devicedetails: pci-0000:00:10.0-scsi-0:0:0:0 底下有四个按钮,Ignore、Ignoreall、Re-in 阅读全文

posted @ 2013-10-12 17:49 叫我小洋 阅读(318) 评论(0) 推荐(0)

.htaccess 文件的使用
摘要:用于服务器对文件夹的控制官方解释为 :分布式配置文件 ,提供了针对目录改变配置的方法;项目可以有多个这样的配置文件,子目录文件会覆盖父目录的配置在apache(这里泛指服务器)中,/conf/vhost/xx.conf文件配置中 在 AllowOverride 设置为 None 时, .htaccess 文件将被完全忽略。 当此指令设置为 All 时,所有具有 ".htaccess" 作用域的指令都允许出现在 .htaccess 文件中。官方对此给予了一段建议 : 不建议使用此文件以下是一些使用方法---来自百度文库怎样利用.htaccess文件浏览: 4342 |更新: 阅读全文

posted @ 2013-10-11 11:59 叫我小洋 阅读(652) 评论(0) 推荐(0)

Apache Conf/Vost/xx.conf 文件配置
摘要:#监听8086端口Listen 8086 NameVirtualHost *:8086#保持绝对一致 ServerName localhost ServerAlias 127.0.0.1#指定根目录 DocumentRoot "D:\Htdocs\ajax\test" #设置 Options All ExecCGI FollowSymLinks Includes IncludesNOEXEC MultiViews SymLinksIfOwnerMatch #指定主页 Directory... 阅读全文

posted @ 2013-10-11 11:43 叫我小洋 阅读(386) 评论(0) 推荐(0)

php 使用phpmailer 发送邮件(附带中文乱码的解决方法)
摘要:下载phpmailer ,在程序里包含class.phpmailer.php 类 ,这里有中文乱码的解决方法实例代码如下 PHPMailer - Mail() basic test CharSet = "UTF-8"; //中文环境下需要设置编码 // $body = file_get_contents( 'contents.html' ); //包含网页的使用方法 //$body = eregi_replace( "[\]", '', $body ); $body = '测试邮... 阅读全文

posted @ 2013-10-10 18:29 叫我小洋 阅读(1627) 评论(0) 推荐(0)

导航