手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表Tag:mac

动态添加和删除crontab

 其实说白了很简单,就是新建一个文件 。然后把计算任务 写进去。执行完了或者有修改的地方就删除它。然后再crontab 执行下而已

1.添加:echo "1 * * * * /home/test" >> /user/crontabfile
2.删除:sed -i '/test/d'  /user/crontabfile
3.然后 crontab  /user/crontabfile 就行了.

然而我在测试的时候,一直失败。。。。我在mac下面的时候。sed -i '/test/d' xxxxfile的时候,一直报错。直到在linux下面执行就正常了。

不过,本来就是准备扔在服务器上处理,不影响不影响,我淡定的飘过

Tags: crontab

proftpd 问答

Frequently Asked Questions
Question: Why do I see the following when my proftpd starts up?

  getaddrinfo 'hostname' error: No address associated with hostname   warning: unable to determine IP address of 'hostname' 

Answer: This error is ProFTPD's way of reporting that it was unsuccessful in resolving hostname to an IP address. Fixing this is a matter of configuring DNS for that hostname: properly set up an IP address for that DNS name in your DNS server, use a DNS name that has an IP address, or (as a quick fix/last resort) add that DNS name to your /etc/hosts file. The proper solution depends largely on the circumstances.

Question: If proftpd resolves any DNS names to IP addresses when it starts up, and I am using dynamic IP addresses which change after my proftpd has started, will proftpd see my new IP addresses?
Question: Unfortunately not. ProFTPD has no easy way of handling dynamic IP addresses by itself. One way of dealing with this situation is to restart proftpd periodically, which will force it to re-parse its configuration and thus re-resolve all IP addresses.

Question: What if I do not want proftpd to use DNS to resolve the hostname to an IP address because I am in an environment where there is no DNS at all?
Answer: In ProFTPD 1.3.3rc1, support for a new -S command-line option was added. This option can be used to specify the IP address of the host machine. By default, proftpd attempts to resolve the host IP address by using DNS resolution of the hostname. However, in cases where DNS is not configured for the host machine, this approach does not work.

To specify the desired IP address, use -S when starting proftpd, e.g.:

  /usr/local/sbin/proftpd -S 1.2.3.4 ... 

And if you want proftpd to listen on all interfaces, you can specify a wildcard socket using an IP address of 0.0.0.0:

/usr/local/sbin/proftpd -S 0.0.0.0 ...

Note that will also mean that, in your proftpd.conf, any <VirtualHost> sections will need to use IP addresses, not DNS names.

Tags: proftpd

把iPad变成一台Web服务器

在网上找了很多资料 ,比如怎么把ipad变成webserver。之所以有这个想法,是因为ipad mini是32G的,好象有点浪费 。。。所以就想着用它来做点事儿。于是乎。。。找到一些资料 ,比如 :http://www.xzbu.com/8/view-3462992.htm

然而,我在cydia的源里进行搜索mysql的时候,却发现,原来有一个现成的 lighttpd-php-mysql的包已经帮你准备好了,直接安装这个包。然后就一切Over。

在设置里还能对lighttpd 和 mysql的开启与关闭进行控制,打开对应的网页后,里面还带了一份简易版的phpmyadmin。哦哦哦,这世界实在让人疯狂。

当然要安装的话,记得,一定是要在开发者模式下,否则可能搜不到mysql

Tags: ipad, webserver

Parallels Desktop 读取linux的虚拟机内容

PD读取windows的时候还是比较方便的,在运行的时候也能将整个虚拟机共享出来,但linux就不行了..
pd mounter不是说用就能用的..只有在停止虚拟机的时候才能用,但这个时候,你mounter出来就没有意义了...

所以最简单的办法,还是samba一下吧.当然前两天我介绍的,将ssh整合到finder菜单也是一个办法.

1.samba :[2009-03-03] - 笔记:在Ubuntu中设置samba共享可读写文件夹
2.ssh with finder : How to Mounting FTP/SFTP volumes with the Finder

如果你在未开机状态下,可以参考这个官方的教程:http://download.parallels.com/desktop/v4/docs/en/Parallels_Desktop_Users_Guide/27290.htm
如果你的linux虚拟机额外挂了一个分区,那用这个教程可能会出点问题,重启系统即可以解决...(可能是BUG),磁盘会挂载出错

那如何共享你虚拟机里的磁盘呢?官方还有一个教程:
http://download.parallels.com/desktop/v4/docs/en/Parallels_Desktop_Users_Guide/22907.htm

至此,已经基本上可以正常使用了

phpstorm设置ftp上传的时间问题

在用phpstorm上传文件的时候,发现时差8个小时,用FTP软件都没有问题,于是找了很久没有找到资料
后来到Deployment中的options里发现这个选项:

当打上勾后,时差就8小时了,不打勾立刻正常,采用了本地时间。
于是,把勾去掉。

Tags: phpstorm, 时差

Records:2112345