Skip to content

Instantly share code, notes, and snippets.

View shalk's full-sized avatar
🎯
Focusing

shalk(xiao kun) shalk

🎯
Focusing
View GitHub Profile
@shalk
shalk / gist:6247151
Created August 16, 2013 03:45
com interface comfiguration in linux
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
@shalk
shalk / gist:5812214
Created June 19, 2013 07:07
a perl print problem
#./test.pl 2 4 5 8 12
# *
# *
# *
# *
# **
# **
# **
# ***
# ****
@shalk
shalk / gist:5757771
Created June 11, 2013 15:22
fix a bug in LWP 'usc-cn' can not be recognized correctly.
# 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.