随笔分类 -  Linux

使用xxd命令把png图片转成c语言使用的数组
摘要:#!/bin/bashimage_list=$(ls *.png)for imag in ${image_list}do if test -f $imag then xxd -i ${imag} >> test.h fidone参考:http://www.cnblo... 阅读全文

posted @ 2014-07-16 10:08 K's Blog 阅读(1131) 评论(0) 推荐(0)

bash no job control in this shell
摘要:在安装devtoolset-2的时候,虚拟机莫明关机,不能启动,还会出现bash no job control in this shell 的提示,后来,根据一篇文章,才明白是虚拟机所长的硬盘空间不足了,只要删除一些文件,扩大剩余空间即可 阅读全文

posted @ 2014-02-01 22:36 K's Blog 阅读(2921) 评论(0) 推荐(0)

安装devtoolset-2:因由安装gcc 4.8而引起
摘要:下午,为了使用C++11某些特性,不得不安装更高版本的gcc4.7 或gcc 4.8有两种方法:一、通过下载源码的方式安装,不过这个有点麻烦,而且容易出问题,推荐第二个方案二、安装devtoolset-2工具具体步骤:1、Save repository information as /etc/yum.repos.d/slc6-devtoolset.repo on your system,then install it using yumwget -O /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devt 阅读全文

posted @ 2014-02-01 22:21 K's Blog 阅读(5353) 评论(0) 推荐(0)

ubuntux中gvim的若干问题
摘要:前言:以下的问题及方法仅适合我自己的情况,对您所遇到的问题未必有用,切勿简单模仿!一、背景配色问题 修改.gvimrc文件,添加:colorshceme desert //设置背景为desert方案二、中文输入问题: 描述:在Gvim 中不能切换fcitx输入法,使用Ctri+Space会出现空格而不是切换到输入法 方法:详情请参考这篇Wiki三、gvim Unable to create Ubuntu Menu Proxy 错误: 描述:在gnome-terminal 中用命令gvim filename时会出现:** (gvim:22593): WARNING **: Unable... 阅读全文

posted @ 2013-05-01 21:16 K's Blog 阅读(334) 评论(0) 推荐(0)

修改ubuntu的终端提示符
摘要:修改/etc/profile文件为:if [ "$PS1" ]; then if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then # The file bash.bashrc already sets the default PS1. # PS1='\h:\w\$ ' ,下面是添加的 export PS1='[/u@/h /W/]/$ ' if [ -f /etc/bash.bashrc ]; then . /etc/bas 阅读全文

posted @ 2013-04-19 15:58 K's Blog 阅读(1569) 评论(0) 推荐(0)

code::block之spell checker配置
摘要:打开codeblocker时总是提示我要配置spell checker,只需要:把词典路径设置成/usr/share/myspell即可 阅读全文

posted @ 2013-04-09 14:21 K's Blog 阅读(688) 评论(0) 推荐(0)

几篇文章
摘要:关于指针:Reading C Declarations: A Guide for the MystifiedThe ``Clockwise/Spiral Rule''A Question About Function Pointer In C关于git:图解Git 阅读全文

posted @ 2013-03-27 11:18 K's Blog 阅读(109) 评论(0) 推荐(0)

gdb调试gcc出现:Missing separate debuginfos, use: debuginfo-install glibc-x.i686
摘要:vim /etc/yum.repos.d/CentOS-Debuginfo.repo //修改/etc/yum.repos.d/CentOS-Debuginfo.repo里面的debuginfo目录中enable=1debuginfo-install glibc-2.12-1.80.e16_3.5.i686参考:链接 阅读全文

posted @ 2013-03-21 11:29 K's Blog 阅读(275) 评论(0) 推荐(0)

gcc 引用math.h头文件,编译出现undefined reference to `pow‘等错误时,需要加参数-lm.
摘要:在自己编写的函数中调用数学函数时,如下例子:#include<stdio.h>#include<math.h>void p(void){ printf("%g\n", pow(2, 3));} int main(){ p(); return 0;}出现编译问题:undefined reference to `pow'解决方法:gcc pow.c -lm问题:为什么在函数中调用math.h头文件需要加 -lm参数,而在main中调用却不需要? 阅读全文

posted @ 2013-03-21 11:22 K's Blog 阅读(1354) 评论(0) 推荐(0)

linux下设置vim的字体编码
摘要:可以用命令:cat set fileencodings=utf-8,gb2312 >> .vimrc详细点击链接1链接2更新:今天vim打开一个文本文件时,中文是乱码,但是我已经在.vimrc中设置了 fileencoding=utf-8, gb2312了,最后:查看我的文件类型: 为euc-cn在.vimrc中加入set tenc=euc-cn 阅读全文

posted @ 2013-03-15 17:10 K's Blog 阅读(318) 评论(0) 推荐(0)

linux下自动挂载硬盘
摘要:步骤:1。先用mount命令挂载硬盘到某个文件夹:[root@wyj wang]# mount /dev/sda6 /media/tarena2。修改/etc/fstab文件:[root@wyj wang]# vim /etc/fstab 在文件末尾加上如下内容,即可开机自动挂载硬盘分区: /dev/sda6 /media/tarena ext3 defaults 1 2 或者使用命令可直接添加上面内容:[root@wyj wang]# echo /dev/sda6 /media/tarena ext3 defaults 1 2 >> /etc/f... 阅读全文

posted @ 2013-03-05 20:02 K's Blog 阅读(307) 评论(0) 推荐(0)

Installing virtualbox4.1 in centos6.2
摘要:一、安装1.先安装相关的编译工具和库(因为自己已经安装过开发环境套件,所以省略)2.安装软件源:下载rpmforge-release-0.5.2-2.el6.rf.i686.rpm3.搜索软件:yum list virtualbox*4.安装:yum install virtualbox4.1二、安装windows XP(具体过程请点击链接1或 链接2) 注意:最好下载纯净版的系统三、配置VirtualBox4.11。安装增强扩展,点击下载,打开VirtualBox > File > Preference >Extensions >打开下载的扩展包2。解决“virtua 阅读全文

posted @ 2013-03-02 14:07 K's Blog 阅读(168) 评论(0) 推荐(0)

Installing BCM4313 driver in Centos6.2
摘要:[user@host ~]$ /sbin/lspci | grep Broadcom //确定无线网卡型号05:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)07:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57780 Gigabit Ethernet PCIe (rev 01)辨认完无线网络芯片型号之后,请确定你不会欠缺编译及安装时所需的组件:[root@host]# y. 阅读全文

posted @ 2013-03-01 20:26 K's Blog 阅读(901) 评论(0) 推荐(0)

导航