etaf / blog Goto Github PK
View Code? Open in Web Editor NEWblogs in issue
blogs in issue
To see etaf belongs to which group:
groups etaf
Change etaf's default group to new_group:
usermod -g new_group etaf
find all the core file and remove them
find ~ -regex ".*core\.[0-9]*" | xargs rm
redirect stderr to file
cmd 2> stderr.txt
redirect stdout and stderr to file
cmd >file 2>&1 ##first redirect stderr to stdout , then redirect stdout to file ``
vim replace
:%s/origin_pattern/new_string/cig
kill multi process with one line
kill $(ps aux | grep '[p]ython csp_build.py' | awk '{print $2}') Details on its workings are as follows:first try kill -15 $(....)
if not help try kill -9
- The ps gives you the list of all the processes.
- The grep filters that based on your search string, [p] is a trick to stop you picking up the actual grep process itself.
- The awk just gives you the second field of each line, which is the PID.
- The $(x) construct means to execute x then take its output and put it on the command line. The output of that ps pipeline inside that construct above is the list of process IDs so you end up with a command like kill 1234 1122 7654.
run command without shell
nohup command &
format code
indent -linux x.cpp or: clang-format -i -style=xxx *.cpp
arp scan
sudo arp-scan -I eth0 -l
find excutabe file
find -type f -perm /u=x -exec ls -l {} \;
find ip of a ASUS server which has open port 80;
sudo arp-scan -l | grep ASUS | awk '{print $1}' | xargs nmap -p 80 | grep -A 1 -B 3 "open"
comment the flow line in file ~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py :
'-Wc++98-compat',
$ sudo apt-get install xclip clang
$ hg clone https://code.google.com/p/vim/
$ cd vim
##Note: python-config-dir should be set according to real situation.
$./configure -with-features=huge --enable-rubyinterp=yes --enable-pythoninterp=yes --enable-perlinterp=yes --enable-luainterp=yes --enable-sniff --enable-multibyte --enable-xim --enable-fontset --enable-gtk2-check --enable-gnome-check --enable-gui=auto --enable-cscope --with-python-config-dir=/usr/lib/python2.7/config --with-x --prefix=/usr > configure_output.txt
$ make
$ sudo make install
apt-get install protobuf-compiler protobuf-c-compiler libprotobuf-dev
sodo install ntfs-3g
grub2-mkconfig -o /boot/grub2/grub.conf
sudo grub2-set-default "windows 7 (loader) (on /dev/sda1)"
i need to create tcl file that include 4 wireless node (n0 , n1 , n2 , n3) zigbee. n1 is authenticated to n0 and n2 request to authenticate to n0 throw n1. n3 has other job dont need now
scp is a tool like cp in linux.The different is,scp copy file between PCs.
A~: scp -p file1 username@B's IP : ~/file1
eg:
scp -p test.txt [email protected]:~/tset.txt
here -p measn to preserve the modify time ,access time,mode from original file.
A~: scp -pr dir1 username@B's IP : ~/dir1
eg:
scp -p test_dir [email protected]:~/tset_dir
here -r means copy a directory
other option see :
man scp
on the above step,each scp need you offer the password of the target PC.
Now there is a way to avoid the password step: by ssh certification.
in PC A:
ssh-keygen -t rsa
scp ~/.ssh/id_rsa.pub [email protected]:~/.ssh/authorized_keys
the same for B->A
sudo yum install tetex-latex
*gtk on python 2.6
$ ls /usr/lib64/python2.6/site-packages | grep gtk
copy all this to /usr/local/lib/python2.7/site-packages/
$ ls /usr/local/lib/python2.7/site-packages | grep gtk
gtk need packages cairo , install pycairo or copy it from python2.6
$ /usr/lib64/python2.6/site-packages/cairo /usr/local/lib/python2.7/site-packages -r
now try to import gtk in python2.7.
waiting
# please run as root
#install jdk
yum install java-1.7.0-openjdk-devel.x86_64
#install scala
tar -xf scala-2.11.2.tgz
cd scala-2.11.2
cp scala-2.11.2 /usr/local/share/scala -r
echo "export SCALA_HOME=/usr/local/share/scala\nexport PATH=\$PATH:\$SCALA_HOME/bin\n" >> /etc/profile
source /etc/profile
scala -version
#install spark
wget "http://d3kbcqa49mib13.cloudfront.net/spark-1.1.0-bin-hadoop2.4.tgz"
echo "export SPARK_HOME=/home/etaf/software/spark\nexport PATH=\$PATH:\$SPARK_HOME/bin" >> /etc/profile
source /etc/profile
push local code to new created repo
$ git init $ vim .gitignore $ git add -A $ git commit -m "init" $ git remote add origin https://etaf@github.... $ git push origin master
remote file from git repo
$ git rm file $ git rm -r dir
added but not commit, rm file added:
$ git rm --cached file
force replace local code with server code:
$ git reset --hard $ git pull origin master
cheate a new branch and switch to it:
$ git checkout -b branch-name
push local branch to remote server:
$ git push origin branch-name
fetch remote branch from remote server:
$ git fetch origin
replace local branch with server branch:
$ git reset --hard HEAD~3 # HEAD~3 means rollback 3 commit versions $ git pull
if you make a mistake when using: git reset --hard , then the commits before it would lose(see git log), how to recover them ?
$ git reflog $ git reset --hard <sha>
sudo apt-get install xclip clang
hg clone https://code.google.com/p/vim/
cd vim
##Note: python-config-dir should be set according to real situation.
./configure -with-features=huge --enable-rubyinterp=yes --enable-pythoninterp=yes --enable-perlinterp=yes --enable-luainterp=yes --enable-sniff --enable-multibyte --enable-xim --enable-fontset --enable-gtk2-check --enable-gnome-check --enable-gui=auto --enable-cscope --with-python-config-dir=/usr/lib/python2.7/config --with-x --prefix=/usr > configure_output.txt
make -j 8
sudo make install
##__Do not use vundle to install it__
git clone https://github.com/Valloric/YouCompleteMe.git
git submodule update --init --recursive
./install.sh --clang-completer --system-libclang ( _on centos_ )
./install.sh --clang-completer ( _on ubuntu_ )
cp third_party/ycmd/cpp ./ -rf
#now test !
./install
...
set env:
#ns2 export PATH="$PATH:home/etaf/software/ns-allinone-2.35/bin:/home/etaf/software/ns-allinone-2.35/tcl8.5.10/unix:/home/etaf/software/ns-allinone-2.35/tk8.5.10/unix" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/etaf/software/ns-allinone-2.35/otcl-1.14:/home/etaf/software/ns-allinone-2.35/lib" export TCL_LIBRARY="/home/etaf/software/ns-allinone-2.35/tcl8.5.10/library:/home/etaf/software/ns-allinone-2.35/tk8.5.10/library"
hop5 repo
first add hop5install
yum install boost boost-devel
for example
pip2.7 install matplotlib
pip3.3 install matplotlib
enable
ulimit -c ulimited
ulimit -c 12345 (12345 is the size of core file)
disable
ulimit -c 0
get src
$ ./configure --prefix=/usr
$ make
$ make install
sudo vim /etc/profile
add content:
PKG_CONFIG_PATH="/usr/lib/pkgconfig/:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH
error: Peer's certificate issuer has been marked as not trusted by the user. while accessing https://github.com
Solution:
sudo rm -rf /etc/pki /etc/ssl
sudo yum reinstall -y openssl ca-certificates
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.