Nov 4, 2013
Technology1. Soving the chinese Garbled in vim:
set fileencodings=utf8,cp936,gb18030,big5
2. Install chinese fonts:
wqy-bitmapfont
wqy-zenhei
ttf-arphic-ukai
ttf-arphic-uming
ttf-fireflysung
wqy-microhei(AUR中)
wqy-microhei-lite(AUR中
3. Copy files from linux to windows or other systems:
You should do like following:
mount /dev/sdc /mnt
#copy all of the pdf into the directory
export LANG="zh_CN.utf8"
export LC_ALL="zh_CN.utf8"
mount /dev/sdc /mnt -t vfat -o iocharset=utf8
cp /chinese/*** /YourDestination
4. Using ftp for uploading files.
In filezilla, Choose charset to gb2312, like following:
5. mount in specified charset
mount -t vfat -o iocharset=gb2312 -o codepage=936 /dev/sdc /mnt
6. Changing existing names:
convmv -f UTF-8 -t GBK --notest utf8编码的文件名
Nov 4, 2013
Technology###Preparation
Yaourt briss will show the following result:
1 aur/briss 0.9-2 (58)
Java tool to crop pages of PDF documents to one or more regions selected with a GUI.
==> Enter n° of packages to be installed (ex: 1 2 3 or 1-3)
Install it and now we will going to cut our pdfs.
###Cutting
First you can manually cut your pdf, and set it to fit your own size.Simply input “briss” then you can got a window for your operation.
Or via command line:
$ briss -s Your_pdf.pdf
The result is listed as following:
###Tips
How to resize your image to fixed size:
$ convert -resize 1000x from.jpg to.jpg
Nov 3, 2013
Technology###Kernel Source Preparation
Install libncurses5-dev for make menuconfig
$ sudo apt-get install libncurses5-dev
$ sudo apt-get update && sudo apt-get upgrade -y
Get the source code and configure the kernel modules
git clone --depth 1 https://github.com/raspberrypi/linux.git
cd linux
zcat /proc/config.gz >.config
edit .config and enable
The Configuration image listed as following:
###Wiring Preparation
ENC - RPi
===============
VCC - 3v3
GND - GND
CS - CE0 (gpio 8)
SI - MOSI (gpio 10)
SCK - SCKL (gpio 11)
SO - MISO (gpio 9)
Rapsberry PI GPIO Description:
GPIOs:
###Speedup compiling
Using cross-compiler:
Resolve the cross-compiler issue:
[root@XXXyyy lib]# cp libppl.so.13 libppl.so.12
[root@XXXyyy lib]# pwd
/usr/lib
The yaourt’s cross-compiler is not ok, so we need to use official cross-compiler, download it from :
$ git clone git://github.com/raspberrypi/tools.git
#### Install crosscompiler for RaspberryPI ####
$ export PATH="/media/x/vmware/rasp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:$PATH"
Then you can use cross-compiler to compile your own kernel image and kernel modules.
Nov 3, 2013
TechnologyTransfer Chinese to Pinyin using bash or python.
__How to cut the pdf and generate the suitable version in Linux. __
Nov 2, 2013
TechnologyDue to http://haitao.smzdm.com/youhui/88923 Nanjing Environmenmental Monitoring System changed their website, my python script can’t fetch the correct data from this page, I have to find another data source, from http://www.cnpm25.cn/city/nanjing.html, but this source has about 1 hour’s delay to the official site.
Because the source changes, the previous script can’t work any more, I made following changes, following is the changes in python code
# table which contians the atmosphere information
table = soup.find('table', {'id':'xiang1'})
for subrows in rows:
if "玄武湖" in subrows.text:
XuanwuLake = subrows
XuanwuLake_subitem = XuanwuLake.findAll('td')
# PM 2.5
pm_array[1] = XuanwuLake_subitem[3].text
# PM 10
pm_array[0] = XuanwuLake_subitem[4].text
# Fetch only the digits from the output
insert_pm25 = int(re.search('\d+', pm_array[1]).group())
insert_pm10 = int(re.search('\d+', pm_array[0]).group())
# Insert into the database
cur.execute('insert into foo values(?, ?, ? , ? ,?)', (word1, word2, insert_pm10, insert_pm25, currenttime_linux))
Also because the pollution is too serious, we have to change the following lines:
- yaxis: { min: 0, max: 200},
+ yaxis: { min: 0, max: 300},
After reboot, we then see the result is updated .
###Tips on delete the inserted sqlite3 records
$ sqlite /srv/www1/weather1.db
sqlite> select * from foo
18|88|123|62.0|1383303610000
19|83|258μg/m³|145μg/m³|1383395165000
sqlite> .schema foo
CREATE TABLE foo (d_temper integer, d_humi integer, d_pm10 integer, d_pm25 real, d_time timestamp);
sqlite> delete from foo where d_time = 1383395165000;