有趣的开源项目

gource 可视化git项目的工具

https://github.com/acaudwell/Gource

##农历
https://github.com/giwhub/zhCal

##命令行有道词典
https://github.com/longcw/youdao

##命令行网易云音乐
https://github.com/darknessomi/musicbox

Ubuntu下图片的各种操作

Ubuntu中有一个强大的图片转换命令:convert

安装:

    sudo  apt-get install imagemagick  

使用:
1. 图片格式转换:

    convert 221622462017.jpg test.png
    convert 221622462017.jpg test.eps
    convert test.png png.eps

2.变形:

    convert -resize 1024x768  hello.jpg   hello_.jpg    # 变形
    convert -resize 160x80!  inputFileName outputFileName 
    #在尺寸后面加上"!"(感叹号) 表示强制转换

3.采样:

    convert -sample 20%x20%  hello.jpg  hello_.jpg   # 按比例采样

4.旋转:

    convert -rotate 90 hello.jpg hello_.jpg      # 旋转

5.拼接:

    convert relation.png mfile.png -append question.png #上下拼接两张图为一张

图片格式想怎么转就怎么转。是否很酷呢?
继续阅读“Ubuntu下图片的各种操作”

Linux下工作03:使用微信

由于腾讯官方没有推出Linux版本的微信客户端,所以没有办法直接安装微信。在这里我要使用的是网页版本的微信。wechat

准备:Chrome浏览器(因为要用到这个浏览器里面一个功能)

第一步: 用Chrome浏览器打开 https://wx.qq.com/ 其实在浏览器里面就可以直接用微信了,但是每次都打开浏览器总感觉不爽。因此我们可以做接下来的工作。
继续阅读“Linux下工作03:使用微信”

Gnuplot Examples (1): Plotting With Double-yaxis

Gnuplot is one of the most useful tool for plotting all kinds of figures in Linux system. Here, we give an simple example to plot distribution function with gnuplot. We will plot the function of two kind of molecules A and B in a liquid, along the normal direction (z-axis),ie., as a function of z coordinate. The distribution file are dist_A.dat and dist_B.dat. The value is too different to each other, we plot them with different scale. The details can be found in the script scr_doubleaxis.gnuplot.

To plot, just run
$gnuplot scr_doubleaxis.gnuplot

The script is as follows.
继续阅读“Gnuplot Examples (1): Plotting With Double-yaxis”

Plot histograms in python with matplotlib

Suppose we have a file theta.dat which has 1000 lines and each line has a angle value. Its first 10 lines are as follows.

100.35766
105.05182
112.56954
119.66241
125.35966
127.44947
125.47673
121.08910
118.00765
117.77907

How to plot a histogram figure in python with matplotlib with the file theta.dat?

We put this file in the home directory, thus the position is ~/theta.dat.
Then , we plot in Enthought Canopy Graphical Environment! One can download and install it in Software Manager. If we open it, the window looks like this.

f0

继续阅读“Plot histograms in python with matplotlib”

How to use USB Audio cards on Raspberry Pi 3 (jessie)

A few days ago,I bought a USB Audio card.

I used one night to figure out how to configure the device on Raspberry Pi. I searched a lot of material, and I found many of them are outdated. Lots of people said to changed "/etc/modprobe.d/alsa-base.conf", but in jessie , the file dose not exist.

The files I changed are as follows and these settings works for me:
继续阅读“How to use USB Audio cards on Raspberry Pi 3 (jessie)”

Working in Linux 02: Jtext2code–Use Python to make a QR code generator

Sometimes, I need copy some links or text from computer to my smart phone.  It's such a bad experience to type all of the contents by myself. So I made a tool  in Linux called "Jtext2code", which  can  generate a QR code according to the text you choose. Use your smart phone application like Scanner to scan the picture generated, you can get the information you choose easily.

test

Let's build this.
继续阅读“Working in Linux 02: Jtext2code–Use Python to make a QR code generator”