Linux
共 10 篇文章
VMware Workstation 11 或者 VMware Player 7安装MAC OS X 10.10 Yosemite
最近尝试了下VMware下安装MacOS 系统, 安装过程中发现网上可供参考的文章都是VMware Workstation 10以下, MacOS X 10.9以下的文章, 只能提供大概的思路, 但是实际安装起来由于版本问题, 走了不少弯路, 所以我尝试写以下总结, 希望能给有兴趣安装OSX的人提供一点帮助。 写在前面的话: 其实安装好后发现, 由于我的thinkpad实在太老了, 实在没法流畅的带动这个osx系统, 所以运行的很慢, 只能蛋疼的表示玩玩罢了, 如果你的系统够强劲, 应该效果比我的会好很多的。 需要准备好的软件 VMware Workstation 11 或者 VMware …
2014-12-15 20:26 · Linux · Vmware · Mac OS · Player · workstation
openldap configuration leaning note
hostname // to display the computer name hostname <changed name> // to change go to: /etc/sysconfig/network, add/modify HOSTNAME=NEWNAME to change permenately dont forget to change /etc/hosts after you change your hostname, 127.0.0.1 localhost.localdomain localhost // the following part mainly is f…
2014-10-21 01:04 · Linux
头文件与之实现文件的的关系
头文件与之实现文件的的关系 今天在网上看到一篇解释.h与.c(.cpp)的文章,我读完后感到有些地方不妥,特此按照我的理解,给初学者一些指导~ 说几句题外话,刚才让女朋友陪我出去一会,她说她要先化化妆,我随口就来--简单就是美丽啊! 你猜她说什么:美丽除了天生丽质外,保养也是很重要的~ 我倒~ 你理解简单的含义吗? 关于两者以前的关系,要从N年以前说起了~ long long ago,once aupon a time ....... 那是一个被遗忘的年代,在编译器只认识.c(.cpp))文件,而不知道.h是何物的年代。 那时的人们写了很多的.c(.cpp)文件,渐渐地,人们发现在很多.c(…
2013-03-22 17:19 · Linux
话说C语言的const
话说C语言的const const在C语言中算是一个比较新的描述符,我们称之为常量修饰符,意即其所修饰 的对象为常量(immutable)。 我们来分情况看语法上它该如何被使用。 1、函数体内修饰局部变量。 例: void func(){ const int a=0; } 首先,我们先把const这个单词忽略不看,那么a是一个int类型的局部自动变量, 我们给它赋予初始值0。 然后再看const. const作为一个类型限定词,和int有相同的地位。 const int a; int const a; 是等价的。于是此处我们一定要清晰的明白,const修饰的对象是谁,是a,和int没 有关系…
2013-03-22 17:18 · Linux
进程控制入门
进程控制入门 进程系统 Linux是个多任务多用户的操作系统,系统直接管理的每个任务的最小单位,就是进程(process)。每个进程都有一个惟一的标识符pid,不同的进程pid不相同,在Shell下输入ps -A,可以显示当前的所有进程。一个进程不代表一个应用程序(application),因为一个应用程序可能对应多个进程,也不代表一个可执行文件(executable file),因为一些可执行文件可以被同时运行多个,它们是互不相干的。 在Linux中,进程不是相互独立的,每个进程(除了init进程)都有一个父进程(parent process),同时每个进程可以有0个1个或多个子进程(ch…
2013-03-22 17:16 · Linux
进程的终止方式
有8种方式使进程终止,其中前5种为正常终止,它们是: 1:从 main 返回 2:调用 exit 3:调用 _exit 或 _Exit 4:最后一个线程从其启动例程返回 5:最后一个线程调用 pthread_exit 异常终止有3种,它们是: 6:调用 abort 7:接到一个信号并终止 8:最后一个线程对取消请求做出响应 补充:exit和_exit还有atexit函数的区别: exit()在结束调用它的进程之前,要进行如下步骤: 1.cleanup(); 2.在atexit()注册的函数; 3.最后调用_exit()函数.
2013-03-22 17:14 · Linux · Linux · 进程
How to record timestamp of each command in history
There's no timestamp of each command when we are using ' history ' command to see the command records. We can add timestamp for each command by following steps: 1. Edit ~/.bashrc or /etc/bashrc export HISTTIMEFORMAT="%m-%d-%Y %H:%M:%S " Note: m, d are in lowercase, Y, H, M, S are in uppercase. Ther…
2011-12-01 15:26 · Linux · Linux · History · bashrc
Command Line Options: getopt_long() Learning Note
Definition #include < getopt .h> extern char * optarg ; extern int optind , opterr , optopt ; int getopt_long (int argc , char * const argv [], const char * optstring , const struct option * longopts , int * longindex ); optarg : if an option takes an argument, the pointer will point at that argume…
2011-11-30 15:06 · Linux · C · GCC · Linux · getopt · getopt_long
remove duplicates for yum check
Apparently, when doing " yum update ", and it fails miserably, you can end up with duplicate versions of packages in the RPM database. This seems harmless, but is annoying. yum provides a tool to check for this, but I was not able to find anything that would automatically repair it. So here's a lit…
2011-10-29 22:46 · Linux
cygwin改成fedora风格的提示符
cygwin 默认的提示符是这样的: user@host ~ $ls -lah _ 有点不大喜欢, 所以做了下改动, 打开etc/bash.bashrc, 重新设置变量: # Set a default prompt of: user@host and current_directory PS1='\[\e]0;\w\a\]\n[\[\e[32m\]\u@\h \[\e[33m\]\W\[\e[0m\]] \$ ' 改完后重启cygwin, 现在的提示符: [user@host ~ ] $_ 变的跟fedora下shell的提示符一样了.
2011-10-25 13:57 · Linux