Showing posts with label Fixbug. Show all posts
Showing posts with label Fixbug. Show all posts

Tuesday, August 7, 2012

Why crontab does not work?

I've try to set my python script run daily use crontab.
If your dont know what is cron, learn it now:
http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/

If your crontab is working well now, skip this post. Otherwise, try to figure out why it does not work.

0. Find out whether cron daemon running or not

hvn@squeeze:~/Apps/birth-reminder$ pgrep cron
1530

Wednesday, August 1, 2012

[FIXBUG] depends ... but ... is not going to be installed

Cài lại vim vì bản vim đang dùng không hỗ trợ copy ra clipboard.

Làm sao biết?
mở vim ra, gõ :version
tìm xem chữ  xterm_clipboard trước nó là dấu + hay -.
Nếu - là không hỗ trợ (không compile với parameter xterm_clipboard).

Thế nên phải cài vim-gtk hoặc vim-gnome. Nhưng khi gõ sudo apt-get install vim-gnome nó báo lỗi như sau:
....
depends vim-common (= 2:7.3.429-2ubuntu2) but 2:7.3.429-2ubuntu2.1 is to be installed
các xử sự với tất cả các lỗi kiểu depends ... but ... is not going to be installed như sau

gỡ hết ra và cài lại:
sudo apt-get purge vim
sudo apt-get remove vim-common
sudo apt-get autoremove

rồi cài lại là ok

Friday, July 27, 2012

Python buildout

The official document quite ugly:
http://www.buildout.org/install.html

You should follow below tuts to get understanding what id does:
http://wiki.pylonshq.com/display/pylonscommunity/Howto+install+Pylons+with+buildout#initialize-a-buildout-for-your-project

http://jacobian.org/writing/django-apps-with-buildout/

Deploy using zc.buildout and PythonPaste  (if you know flask "just a little", this will help you full understand what it do,)

http://flask.pocoo.org/snippets/27/

Then, you can turn back to read the official document

What does zc.buildout do?
Basically, it install packages that you specified in buildout.cfg. So you can develop/deploy isolate to other project, and futhermore, you can help someone has the same environment as yours.



What is build out :
Quoting the Buildout website, "Buildout is a Python-based build system for creating, assembling and deploying applications from multiple parts, some of which may be non-Python-based. It lets you create a buildout configuration and reproduce the same software later.". Buildout originated from the Zope/Plone community to automate deployment of customized instances of their software. Lead by Jim Fulton, CTO of Zope Corporation, Buildout became a stable and mature product over the years.
Buildout is used in SlapOS to define which software must be executed on a Slave Node. It has a key role in SlapOS industrial successes. Without it, SlapOS could not exist. However, buildout is also often misunderstood - sometimes purposely - by observers who criticize its use in SlapOS. Many people still do not realize that there is no possible software standard on the Cloud and that buildout is the solution to this impossibility. Experts know for example that any large scale production system which is operated on the Cloud (ex. a social network system) or privately (ex. a banking software) uses patched software. Relational databases are patched to meet performance requirements of given applications as soon as data grows. If a Cloud operating system does not provide the possibility to patch about any of its software components, it is simply unusable for large scale production applications. SlapOS is usable because its definition of what is a software is based on the possibility of patching any dependent software component.

(theo http://www.slapos.org/wiki/slapos.Why.Buildout)

Nói chung với buildout bạn sẽ:
- Phát triển các phần mềm trên môi trường độc lập (tương tự virtualenv). Tức ở project này bạn dùng package A, phiên bản B còn ở project khác dùng package C phiên bản D. (ở A dùng python2.5 còn ở C dùng python2.7 chẳng han)
- Không cần quyền root để cài các package
- Tự động thiết lập môi trường giống hệt ở mọi nơi chỉ cần file buildout.cfg
- Tạm thế.

Monday, June 11, 2012

OpenOffice và trải nghiệm kinh khủng

OpenOffice (OO) là bộ Office miễn phí mã nguồn mở được cài sẵn trên hầu hết mọi phiên bản của Ubuntu. Nếu không phải làm những việc "nghiêm trọng" thì bạn có thể chơi với nó. Nhưng nếu phải làm 1 cái đồ án chẳng hạn thì lời khuyên là bạn nên dùng M$ Office 2003 - 2007 hoặc dùng Latex để khỏi phải trải qua những giây phút kinh khủng ấy :D

Bài viết này là bài đầu tiên cũng như cuối cùng cho OpenOffice, từ giở trở đi sẽ học viết bằng LaTex.

-1. Kinh nghiệm chung, ko liên quan đến OO là dù soạn thảo bằng cái gì thì bạn cũng nên chọn CỠ GIẤY, căn lề trước khi gõ bất kỳ dòng nào vào đó. (Format -> Page)
0. Kinh nghiệm chung cho việc dùng phần mềm miễn phí/ mã nguồn mở: dùng phiên bản Stable mới nhất để tránh gặp phải những lỗi ngớ ngẩn đốt cháy những giây phút quý báu của cuộc đời bạn.

1. Tạo dòng kẻ ngang cho header và gạch trên cho footer:
- Bấm vào khung của header/footer. Chuột phải chọn -> paragraph... rồi vào tab border.
2. Nếu gặp lỗi không thể để con trỏ xuống dưới 1 cái table trong writer để gõ:
- Cut cái bảng ấy đi. Gõ enter vài cái rồi paste nó lại lên trên các dòng vừa enter vào.
3. Numbering and bullet: Nếu bạn đang gõ 1, tiếp theo là 2 bằng chế độ numbering, khi bạn cần thì sẽ phải ra 3 ,4 (chuột phải -> chọn use previous numbering...) . Nếu giữa khoảng 2 -> 3 của bạn có sử kiểu numbering khác (như -  đầu dòng chẳng hạn) bạn sẽ không thể nối tiếp cái danh mục 12 34 của mình được
- Dùng cái chổi, bôi vào dòng 1 hay 2 rồi quét cho 3 và 4.
4. Làm mục lục bằng OpenOffice.
Có 1 khái niệm bạn cần biết là outline. Outline là thể hiện của cái "đề mục" của bạn trong mục lục. Để chọn outline cho dòng bạn đang dùng, đặt chuột ở dòng đó, chuột phải chọn paragraph -> outline -> chọn level. Đừng chọn paragraph style... bạn sẽ đau đầu đấy :D
5. Viết formula:
Muốn viết tổng sigma từ i = 1 đến n thì hãy gõ vào : sum from i=1 to n abc, cái panel bạn  chọn không làm đúng việc này.
Căn giữa công thức:
chuột phải , chọn đâu đó ko nhớ nữa :D chọn 1 dòng là as character. Rồi bấm Ctrl E để căn giữa như chữ bình thường.
Xuống dòng trong công thức:
newline "=" nhớ có dấu ngoặc kép. Căn chỉnh vị trí trong công thức thì dùng alignl arignr arignc.

Sunday, December 11, 2011

Fixbug ko mở được biểu tượng "computer"

Nếu máy bạn gặp phải lỗi :
Nautilus cannot handle "computer" locations.
khi bấm vào biểu tượng computer. Đi kèm là các triệu chứng : không auto mount USB và CDROM. Cách fix như sau:
bạn tạo một thư mục /usr/local mới rồi khởi động lại máy. Câu lệnh dưới backup thư mục cũ vào tạo thư mục mới:

sudo mv /usr/local /usr/local.old
sudo mkdir /usr/local


Saturday, November 12, 2011

Cannot find install-sh, install.sh, or shtool ...

Painful  GTK+3.0 =.=

fix title error when configure py2cairo 
$ libtoolize --force
$ aclocal
$ autoheader
$ automake --force-missing --add-missing
$ autoconf
$ ./configure

Thursday, May 13, 2010

Fix MIC issue on Ubuntu 10.04

If your microphone input doesn't work try this tweak

step 1. Launch terminal and type " sudo gedit /etc/modprobe.d/alsa-base.conf "

step 2. Add "options snd-hda-intel position_fix=1"

Reboot and see if its working