This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub stockinfo1{ | |
# 使用腾讯的接口 | |
my $stockid = shift; | |
my $url1="http://qt.gtimg.cn/q=$stockid"; | |
my $ua = Mojo::UserAgent->new(); | |
my $res = $ua->get($url1)->res->body; | |
$res = encode("utf8",decode("gbk",$res)); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fix a bug in LWP 'usc-cn' can not be recognized correctly. | |
# | |
# when i use method HTTP::RESPONSE::decoded_content ,that can not decode 'usc-cn' html | |
# but it use 'iso-8859-1' to decode html. | |
# though 'iso-8859-1' is a universe code , the decode method can work well. | |
# but HTTP::RESPONSE::content_charset can not get the right code name . | |
# | |
# there are two causes | |
# one is Encode::Encoding::mime_name can not get usc-cn, usc-cn is not in the IANA charset name list. | |
# the other is HTTP::RESPONSE::decoded_content havdn't implement usc-cn decode,we only can use iso-8859-1 to replace. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#./test.pl 2 4 5 8 12 | |
# * | |
# * | |
# * | |
# * | |
# ** | |
# ** | |
# ** | |
# *** | |
# **** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -i -e '/splash/a\serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 terminal --timeout=5 serial console' grub.conf | |
sed -i -e '/vmlinuz/ s/$/& console=tty0 console=ttyS0,115200n8/' grub.conf | |
echo 'ttyS0' >> /etc/securetty | |
cat >> /etc/init/ttyS0.conf <<EOF | |
start on runlevel [345] | |
stop on runlevel [S016] | |
respawn | |
instance /dev/ttyS0 | |
exec /sbin/agetty ttyS0 115200 vt100-nav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Maintainer: | |
" Amir Salihefendic | |
" http://amix.dk - amix@amix.dk | |
" | |
" Version: | |
" 5.0 - 29/05/12 15:43:36 | |
" | |
" Blog_post: | |
" http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage(){ | |
echo " Usage :$0 10.0.50.181 10.0.50.254" | |
echo "Description: set ipmi ip and gateway" | |
exit 1 | |
} | |
if [ $# == 0] | |
then | |
usage | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p /cloudview/cvm/ | |
qemu-img convert -f qcow2 cvm.qcow2 -O raw /cloudview/cvm/cvm.raw | |
virt-install --hvm --name coc --ram 4096 --vcpus 4 \ | |
--disk path=/cloudview/cvm/cvm.raw --os-type "linux" --network bridge=br0 --boot hd | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -p -i -e "s/^.*PasswordAuthentication.*$/PasswordAuthentication yes/" /etc/ssh/sshd_config | |
perl -p -i -e "s/^.*PermitRootLogin.*$/PermitRootLogin yes/" /etc/ssh/sshd_config | |
service sshd restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage(){ | |
echo "$0 ip | |
egg $0 10.0.50.171 | |
" | |
exit 1 | |
} | |
if [[ $# != 1 ]] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[general] | |
# Path to a Public key to install on servers. If a usable key has not | |
# been installed on the remote servers the user will be prompted for a | |
# password and this key will be installed so the password will not be | |
# required again | |
CONFIG_SSH_KEY= | |
# Set to 'y' if you would like Packstack to install MySQL | |
CONFIG_MYSQL_INSTALL=y |