随笔分类 -  Linux

linux收集
摘要:文章转自:https://www.sinosky.org/linux-sublime-text-fcitx.html测试系统:Ubuntu 12.10 (理论上所有 Linux 发行版都通用)输入法:Fcitx 4.2.6.1Sublime Text 版本:Sublime Text 3 dev(Bu... 阅读全文
posted @ 2015-02-27 09:51 KoMiles 阅读(19842) 评论(0) 推荐(2)
摘要:参考文章:http://blog.smdcn.net/article/1308.html准备工作:下载安装 VirtualBox :https://www.virtualbox.org/下载安装 Vagrant :http://www.vagrantup.com/下载需要使用的 box :官方提供的... 阅读全文
posted @ 2015-02-26 12:21 KoMiles 阅读(24063) 评论(0) 推荐(3)
摘要:在重启nginx时报错误。wangkongming@ThinkPad-T410 ~ $ sudo /usr/sbin/nginx -s reloadnginx: [error] invalid PID number "" in "/run/nginx.pid"google一番,下面是解决办法ngin... 阅读全文
posted @ 2015-02-14 09:25 KoMiles 阅读(14537) 评论(0) 推荐(0)
摘要:配置好lamp后,在浏览器中运行程序后,出现上面的错误。转自:http://www.xuejiehome.com/blread-1828.htmlI'm experiencing 502 gateway errors when accessing a PHP file in a directory ... 阅读全文
posted @ 2015-02-13 16:45 KoMiles 阅读(58241) 评论(0) 推荐(0)
摘要:在配置nginx 虚拟机时,执行sudo /usr/sbin/nginx -t报下面的错误:nginx: [emerg] "root" directive is duplicate in /etc/nginx/server/blogs.conf:7nginx: configuration file ... 阅读全文
posted @ 2015-02-13 16:22 KoMiles 阅读(60976) 评论(0) 推荐(1)
摘要:host+chost就是指右边的那个ctrl键 阅读全文
posted @ 2015-02-12 22:31 KoMiles 阅读(4603) 评论(0) 推荐(0)
摘要:转自:http://leenjewel.blog.163.com/blog/static/601937922010124444051/说来这个不难,主要是我看网上有的写的不是很明确,甚至有的写的根本不对,在这里写个正解。 在netbeans安装目录找到 etc 目录下的 netbeans.conf ... 阅读全文
posted @ 2015-02-11 15:11 KoMiles 阅读(1735) 评论(0) 推荐(0)
摘要:转自:http://istyles.blog.163.com/blog/static/1811003892011828111418654/Lucifr翻译了 Sublime Text 2 快捷键 Mac版,用win系统的哥们表示伤不起啊~今天把windows版 Sublime Text 2 快捷键 ... 阅读全文
posted @ 2015-02-10 11:21 KoMiles 阅读(330) 评论(0) 推荐(0)
摘要:突然想自己整理一下,优秀的代码规范,让自己的代码变得优雅。参考:http://docs.typecho.org/phpcoding约定文件编码请调整您的编辑器文件编码为UTF-8,并关闭UTF-8 BOM的功能。请不要使用windows自带的记事本编辑项目文件。缩进详细的代码缩进会在后面提到,这里需... 阅读全文
posted @ 2015-02-06 17:21 KoMiles 阅读(411) 评论(0) 推荐(0)
摘要:转自:http://blog.lizhigang.net/archives/265.ssh/config简单使用需求: 工作的电脑经常会存储不同的key,并且使用不同的用户登录linux系统。如:ssh jackie@123.123.1.1ssh www@123.122.1.145我只想输入ip地址... 阅读全文
posted @ 2015-02-04 23:13 KoMiles 阅读(793) 评论(0) 推荐(0)
摘要:转自:http://blog.163.com/tqq_0716/blog/static/7690741220110611350344/服务器A: 192.168.1.1服务器B: 192.168.1.2服务器A:配置:ssh-keygen -b 2048 -t rsa#这里的-b 2048 是密钥加... 阅读全文
posted @ 2015-02-04 23:11 KoMiles 阅读(5919) 评论(0) 推荐(0)
摘要:有时候用浏览器调试太麻烦,想在linux命令下直接执行php代码php -r 'echo 0500;' 阅读全文
posted @ 2015-01-20 14:59 KoMiles 阅读(888) 评论(0) 推荐(0)
摘要:在图形界面中,执行拉取操作时,出现下面的错误。Youaskedtopullfromtheremote'origin',butdidnotspecifyabranch.Becausethisisnotthedefaultconfiguredremoteforyourcurrentbranch,youm... 阅读全文
posted @ 2015-01-16 09:36 KoMiles 阅读(29156) 评论(2) 推荐(1)
摘要:看下面的一段程序。#!/bin/bashif [ $# -gt 0 ]; then echo "参数个数为$#个"else echo "没有参数"fi 阅读全文
posted @ 2015-01-13 16:08 KoMiles 阅读(38487) 评论(0) 推荐(2)
摘要:下面是工作中用到的链接数据库的shell程序。#!/bin/bashif [ $# -le 0 ] ; then echo "prase is wrong ,please check first" exitfi#知识点: 1,$#代表了命令行的参数数量 2,-le表示... 阅读全文
posted @ 2015-01-13 15:48 KoMiles 阅读(582) 评论(0) 推荐(0)
摘要:转自:http://qubaoquan.blog.51cto.com/1246748/292461比较两个字符串是否相等的办法是:if [ "$test"x = "test"x ]; then这里的关键有几点:1 使用单个等号2 注意到等号两边各有一个空格:这是unix shell的要求3 注意到"... 阅读全文
posted @ 2015-01-13 15:38 KoMiles 阅读(79129) 评论(0) 推荐(1)
摘要:select 语句select表达式是bash的一种扩展应用,擅长于交互式场合。用户可以从一组不同的值中进行选择:select var in ...; do break;done.... now $var can be used ....下面是一个简单的示例:#!/bin/bashecho "Wha... 阅读全文
posted @ 2015-01-13 14:05 KoMiles 阅读(15751) 评论(0) 推荐(0)
摘要:转自:http://os.51cto.com/art/200907/140987.htmvi/vim 中可以使用 :s 命令来替换字符串。以前只会使用一种格式来全文替换,今天发现该命令有很多种写法(linux vi命令真是强大啊,还有很多需要学习),记录几种在此,方便以后查询。:s/vivian/s... 阅读全文
posted @ 2015-01-12 16:09 KoMiles 阅读(2112) 评论(0) 推荐(0)
摘要:撒销一个合并如果你觉得你合并后的状态是一团乱麻,想把当前的修改都放弃,你可以用下面的命令回到合并之前的状态:$ git reset --hard HEAD或者你已经把合并后的代码提交,但还是想把它们撒销:$ git reset --hard ORIG_HEAD但是刚才这条命令在某些情况会很危险,如果... 阅读全文
posted @ 2014-12-15 14:06 KoMiles 阅读(26600) 评论(0) 推荐(0)
摘要:1,在开发过程中,大家在远程创建了许多分支,有些是无用的,该如何删除呢,可以参考下面的方法。如果不再需要某个远程分支了,比如搞定了某个特性并把它合并进了远程的 master 分支(或任何其他存放稳定代码的地方),可以用这个非常无厘头的语法来删除它:git push[远程名] :[分支名]。如果想在服... 阅读全文
posted @ 2014-12-15 11:49 KoMiles 阅读(87337) 评论(2) 推荐(5)