LinuxBash/Shell:[root@memshell]#catprime.sh
#!/bin/sh
#Printprimefrom1to100
for((i=1;i<=100;i++))
do
if[$i-eq1];then
continue
fi
flag=0
for((j=2;j<i;j++))
do
a=$[$i%$j]
if[$a-eq0];then
flag=1
fi
done
if[$flag-eq0];then
echo$iispri..
分类:
其他好文 时间:
2014-08-04 14:42:08
阅读次数:
257
Ubuntu-14.04中默认文件用gedit文本打开,而不是BT5里面的默认双击打开四个选择,如下图(这是配置完毕后的结果,就不换BT5系统了):
直接文本打开,虽然很安全,实际生产中肯定是不行的!而默认执行这更是不可取,所以,需要配置成如上图所示结果。
配置方法
1、首先使用sudo apt-get install dconf-editor命令安装dconf-editor,默认是...
分类:
其他好文 时间:
2014-08-04 11:00:17
阅读次数:
199
首先,我们简单的介绍一下bash,bash是GNU计划编写的Unixshell,它是许多Linux平台上的内定shell,它提供了用户与系统的很好的交互,对于系统运维人员,bash的地位是举足轻重的,bash编程能很快处理日常的任务bash入门,一个最简单的bash例子#vimhello.sh
#!/bin/bash
#Thisist..
分类:
其他好文 时间:
2014-08-03 23:34:27
阅读次数:
588
最近在实习,看着公司有些脚本是perl写,久闻perl处理文本还是很强大的,趁着周末扫了一般这本书~记录下了~
undef 默认未定义字符,perl里面没有NULL,defined($x)函数:如果参数为undef返回false
qw(cs phy geo) 类似于 (“cs”, "phy", "geo")列表可以赋值给数组@array
数组操作符:pop,push操作末尾,sh...
分类:
其他好文 时间:
2014-08-03 18:07:25
阅读次数:
228
这是我在实验中碰到的问题,我们在定义php-fpm为资源的时候,用php程序包自带的脚本会报错。笔者花了很多时间尝试了各种办法,最后找到了一位网友写的脚本,可以解决。脚本如下:#!/bin/sh#=================================================================================..
分类:
Web程序 时间:
2014-08-03 08:00:26
阅读次数:
347
root@node1glance]#su-s/bin/sh-c"glance-managedb_sync"glanceTraceback(mostrecentcalllast):File"/usr/bin/glance-manage",line10,in<module>sys.exit(main())File"/usr/lib/python2.6/site-packages/glance/cmd/manage.py",line253,inmainlog.setup(‘glance‘)File"/u..
novadbcreatenotice:
xxxxxxxsu-s/bin/sh-c"nova-managedb_sync"novaxxxxxx
correctone:
su-s/bin/sh-c"nova-managedbsync"nova[root@node1/]#su-s/bin/sh-c"nova-managedbsync"novaTraceback(mostrecentcalllast):File"/usr/bin/nova-manage",line10,in<module>sys.exi..
分类:
其他好文 时间:
2014-08-03 07:57:25
阅读次数:
300
装完FreeBSD10的安装,安装完退出之后,发现启动项里面只剩下fedora的启动项,我的电脑是Fedora20+FreeBSD双系统,想用GRUB引导修复freeBSD的启动项,网上搜了一堆方法。但是都不可行。
我的FreeBSD是装在gpt5中
修改/ect/grub.d/40-custom
#!/bin/sh
exec tail -n +3 $0
# This file provides...
分类:
其他好文 时间:
2014-08-03 01:47:54
阅读次数:
245
1 #!/bin/bash - 2 #=============================================================================== 3 # 4 # FILE: ftp_put_file.sh 5 # 6 # ...
分类:
系统相关 时间:
2014-08-03 01:45:34
阅读次数:
411
#!/bin/sh#modprobe ipt_MASQUERADEmodprobe ip_conntrack_ftpmodprobe ip_nat_ftpiptables -Fiptables -t nat -Fiptables -Xiptables -t nat -X###############...
分类:
系统相关 时间:
2014-08-01 22:30:22
阅读次数:
424