DevNotes

Concise, Handy and Elegant Notes for Developers

0%

Static site generator

When I want to write some technical blogs and publish them online, from programmers’ point of view, there are many options for static website generator, such as Jekyll, Octopress, Hugo, Pelican, Nuxt, Hexo, etc. It is actually not that easy to say which one is the best, depends largely on your needs and background, e.g. Jekyll and Octopress is Ruby based, Hugo is powered by Go, Pelican is written in Python, Nuxt is Vue based, and Hexo is built on Nodejs. You can of course pick any one to start with, I did some investigation and comparison and finally end up choosing Hexo, simply because it is easy to start with, and I like its simple and clean style.


Setup Hexo

Two dependencies need to be installed in advance:

Read more »

Here is a collection of the Linux commands I used but always forget.

  • Check the system 64 or 22 bit:
    getconf LONG_BIT

  • Check space usage:
    df -h

  • Check processes:
    ps ux or ps -ef or lsof -n -i

  • Kill a process:
    kill -9 PID

  • Check Ubuntu version
    $cat /etc/lsb-release

  • Check folder size
    du -sh /PATH_TO_FOLDER

  • Display information about the contents of ELF files
    readelf -h libname.a

  • To create a soft link
    ln -s /full/path/of/original/file /full/path/of/soft/link/file

  • To remove all the .svn files from the previous version control system
    find . -name .svn -exec rm -rf {} \;

  • Find all .py files and rename them to .html files
    find . -name "*.py" -exec rename 's/.py/.html/' '{}' \;

  • Find all files and folders without metadata and filter by date Oct, then remove them
    ls -tl | grep -v metadata | awk '/Oct/ {print $NF}' | xargs rm -rf

  • CTRL + ALT + F7 for switching to gui, CTRL + ALT + F1 to switch to CLI.

  • Put down/up interface "eth0" sudo ifconfig eth0 down/up

  • Keep runing after exit, refer http://en.wikipedia.org/wiki/Nohup nohup sth &

  • Get a list of packages installed locally, refer http://askubuntu.com/questions/17823/how-to-list-all-installed-packages dpkg --get-selections | grep -v deinstall

  • Analysis tcp transport via "eth0" interface on port 1883, refer https://danielmiessler.com/study/tcpdump/ sudo tcpdump -i eth0 port 1883 -XX

  • Sort the files by size du -sh * | sort -h

  • Remove old files, filtered by year ll | grep 2015 | awk '{print $9}' | xargs rm

  • Apache HTTP server benchmarking load test ab -n 10000 -c 100 http://localhost/

  • bitbake get DISTRO_VERSION and return version number bitbake -e core-image-x | grep ^DISTRO_VERSION= | awk -F= '{print $2}' | sed 's/\"//g'

  • Search keyword grep -rin keyword

  • Show full path in the Finder window
    defaults write com.apple.finder _FXShowPosixPathInTitle TRUE killall Finder

  • Get the external monitor
    export EX_MONITOR=$(xrandr | grep " connected " | grep -v "primary" | awk '{print $1}')

view raw commands.md hosted with ❤ by GitHub