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
http://fun.coolshell.cn/welcome.html | |
http://fun.coolshell.cn/1944.html | |
http://fun.coolshell.cn/42.html | |
http://fun.coolshell.cn/81648.html | |
http://fun.coolshell.cn/unix.html | |
http://fun.coolshell.cn/furyy.html | |
http://fun.coolshell.cn/cat.html | |
http://fun.coolshell.cn/variables.html | |
http://fun.coolshell.cn/tree.html | |
http://fun.coolshell.cn/zWp8LGn01wxJ7.html |
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
set fp [open $some_file] | |
while {-1 != [gets $fp line]} { | |
puts "The current line is '$line'." | |
} |
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
#!/usr/bin/tclsh | |
set fp [open "tmp" r] | |
while {-1 != [gets $fp line]} { | |
puts "The current line is '$line'." | |
set vs [split $line " "] | |
set a [lindex $vs 0] | |
set b [lindex $vs 1] | |
puts "$a + $b = [expr $a+$b]" | |
} |
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: | |
#download the easy fm more to learn mp3 from start day to now | |
trap ctrl_c INT | |
function ctrl_c(){ | |
echo "\n catched interput signal, exiting..." | |
[ ! -e $current_process_file ] || rm $current_process_file | |
echo "bye!" | |
exit | |
} |
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 | |
DIR="./leetcode" | |
for file_name in `ls ./leetcode`; | |
do | |
new_file_name=`echo "$file_name" | tr '[:upper:]' '[:lower:]' ` | |
if [ "$file_name"x != "$new_file_name"x ]; then | |
echo "mv $DIR/$file_name $DIR/$new_file_name" | |
`mv $DIR/$file_name $DIR/$new_file_name` | |
fi | |
done |
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
#sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm | |
sudo yum install -y epel-release | |
sudo yum install -y git boost boost-devel libX11-devel xorg-x11-proto-devel libXt-devel libXmu-devel autoconf automake gcc gcc-c++ protobuf protobuf-devel pkg-conf jemalloc* tmux vim zsh autojump | |
curl -o ~/.zshrc https://gist.githubusercontent.com/etaf/4a5ac4f7c5e170dc6f67/raw/60a29d50a665d1fb8fb50a2e3e56f7e322c48231/gistfile1.sh | |
sudo chsh ec2-user |
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
# Dark 256 color solarized theme for the color GNU ls utility. | |
# Used and tested with dircolors (GNU coreutils) 8.5 | |
# | |
# @author {@link http://sebastian.tramp.name Sebastian Tramp} | |
# @license http://sam.zoy.org/wtfpl/ Do What The Fuck You Want To Public License (WTFPL) | |
# | |
# More Information at | |
# https://github.com/seebi/dircolors-solarized |
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
yum install -y epel-release | |
yum install -y git boost boost-devel libX11-devel xorg-x11-proto-devel libXt-devel libXmu-devel autoconf automake make gcc gcc-c++ protobuf protobuf-devel pkg-conf jemalloc* tmux vim zsh autojump | |
cd /home | |
curl -sSL http://etaf.me/public/ns-allinone-2.35.tar.gz | tar -xz | |
cd ns-all* | |
rm ns-2.35 -rf | |
git clone https://github.com/etaf/ns4kemy.git && mv ns4kemy ns-2.35 | |
cd ns-2.35/queue/kemy-train | |
./autogen.sh && ./configure > configure_out && make clean && make |
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
FROM centos | |
MAINTAINER etaf <fjdksfjdks@qq.com> | |
RUN yum install -y epel-release | |
RUN yum install -y git boost boost-devel libX11-devel xorg-x11-proto-devel libXt-devel libXmu-devel autoconf automake make gcc gcc-c++ protobuf protobuf-devel pkg-conf jemalloc* | |
RUN cd /home && curl -sSL http://etaf.me/public/ns-allinone-2.35.tar.gz | tar -xz | |
RUN cd /home/ns-all* && rm ns-* -rf && git clone --recursive https://github.com/etaf/ns4kemy.git && mv ns4kemy ns-2.35 | |
RUN cd /home/ns-all*/ns-*/queue/kemy-train && ./autogen.sh && ./configure > configure_out && make clean && make | |
RUN cd /home/ns-all* && sed -i '1i alias make="make -j 4"' ./install && ./install |
OlderNewer