Our summer vacation is comming soon and I spent a whole weekend to find accomodations as we make our travel plan by ourselves for this time. How easy to use travel agency to find a vacation plan... Still I need to make reservation 2 nights in Germany & Poland.
By the way, I somehow find the way to customize blogger and google map. I put some functions to this blog to see if everything is all right. How cool that blogger can customize the design of the blog. Free (as a free speach) is good that I can enjoy ;-) Finally I could put a bit of Ajax taste in my blog with the big help of google ;-)
BTW, the kernel 2.6.17.9 is released on 18th Aug. Aren't they on vacation ?
The Answer to Life, the Universe, and Everything
Monday, August 21, 2006
Thursday, August 17, 2006
Vim setting for .vimrc
Vim is the very powerful text editor for GNU/Linux. Here is the sample of the .vimrc which confortably set up your vim.
" .vimrc
" Clear any existing autocommands:
autocmd!
" *** User Interface
" use indents of 4 spaces, and have them copied down lines:
set shiftwidth=4
set tabstop=4
set shiftround
set expandtab
set autoindent
" Set for visible tab
"set listchars=tab:>-,extends:<,trail:-,eol:<
set listchars=tab:>-
set list
" The format of status line
set statusline=%<%f\ %m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%=%l,%c%V%8P
" No beep
" set vb t_vb=
set visualbell
" No auto NL
set formatoptions=q
" Show line number
set number
" have syntax highlighting in terminals which can display colours:
if has('syntax') &amp;amp;amp;& (&t_Co > 2)
syntax on
endif
" have fifty lines of command-line (etc) history:
set history=50
" display the current mode and partially-typed commands in the status line:
set showmode
set showcmd
" have the mouse enabled all the time:
set mouse=a
" don't have files trying to override this .vimrc:
set nomodeline
" Set the type of background color
set background=dark
" *** Text Formatting -- Specific File Formats
" enable filetype detection:
filetype on
" for C-like programming, have automatic indentation:
autocmd FileType c,cpp,slang set cindent
" for actual Java C (not C++) programming where comments have explicit end
" characters, if starting a new line in the middle of a comment automatically
" insert the comment leader characters:
autocmd FileType c,java set formatoptions+=ro smartindent noexpandtab tabstop=4
" for Perl programming, have things in braces indenting themselves:
autocmd FileType perl set smartindent
" for CSS, also have things in braces indented:
autocmd FileType css set smartindent
" for HTML, generally format text, but if a long line has been created leave it
" alone when editing:
autocmd FileType html set formatoptions+=tl
" for both CSS and HTML, use genuine tab characters for indentation, to make
" files a few bytes smaller:
autocmd FileType html,css set noexpandtab tabstop=4
" in makefiles, don't expand tabs to spaces, since actual tab characters are
" needed, and have indentation at 4 chars to be sure that all indents are tabs
" (despite the mappings later):
autocmd FileType make set noexpandtab shiftwidth=4
" *** Search & Replace
" make searches case-insensitive, unless they contain upper-case letters:
set ignorecase
set smartcase
set hlsearch
" show the `best match so far' as search strings are typed:
set incsearch
Wednesday, August 16, 2006
Shell Backup Script
Here is the shell script for backup of the server contents to another over scp.
#!/bin/sh
#################################################################
# Script for the backup the contents under the specified folder
# and the all mysql data
#
# -Cavalierski
#################################################################
# The Following setting should be modified for the each environment
##################################################################
#Date format of the back up file. This will be the prefix of the file
DATE_FORMAT=$(date +'%Y%m%d')
#Specify the folder that you want to backup
TARGET_DIR=(/var/www/xxx /home/xxx/test)
#Set the backup file name
BACKUP_LOGFILE=${DATE_FORMAT}.log
BACKUP_SQLFILE=${DATE_FORMAT}.sql.gz
#Setting for MySQL
MYSQL_PASSWD=
#Setting for Backup server over scp
SCPURL=www.loveanna.net:backup
SCPUSER=xxx
# Do not edit the below lines
##################################################################
# Temporary backup file
BACKUP_DIR=/tmp/www
function make_backup(){
for f in "$@"
do
if [ -d "$f" ]
then
tar zcvf ${BACKUP_DIR}/${DATE_FORMAT}_${f##/*/}.tar.gz "$f"/* >>
${BACKUP_DIR}/${BACKUP_LOGFILE}
else
echo "[ERROR] $f doesn't exist" >> ${BACKUP_DIR}/${BACKUP_LOGFILE}
fi
done
#The Answer to Life, the Universe, and Everything
return 42;
}
mkdir -p $BACKUP_DIR
make_backup ${TARGET_DIR[*]}
mysqldump -uroot --password=$MYSQL_PASSWD --all-databases | gzip>
$BACKUP_DIR/$BACKUP_SQLFILE
if [ $? -ne 0 ]
then
echo "[ERROR] sqldump failed" > ${BACKUP_DIR}/${BACKUP_LOGFILE}
fi
BKFILES=$(ls $BACKUP_DIR/${DATE_FORMAT}*)
BKNUM=${#BKFILES[@]}
for ((i=0;i<BKNUM;i++)); do
scp ${BKFILES[i]} ${SCPUSER}@${SCPURL}
rm -R ${BKFILES[i]:-${BACKUP_DIR}/*}
done
Useful Eclipse Plug-ins
Here are the list that I use for Eclipse on Ubuntu.
- PMD - Refactoring
- CheckStyle- Check code style
- HexEditor- Hex view on Eclipse
- EclipseUML- UML view on Eclipse
Wednesday, August 09, 2006
Firefox flash sound problem
The following steps are the solution on the problem of firefox flash sound problem.
# Flash also looks for /usr/lib/libesd.so.1
sudo ln -s /usr/lib/libesd.so.0 /usr/lib/libesd.so.1
# Flash expects /tmp/.esd/socket to exist.
sudo mkdir -p /tmp/.esd/
sudo touch /tmp/.esd/socket
Tuesday, August 08, 2006
Install log script for linux
Sometimes you need to install the program from the source as it is stable etc. However without the package management , it is difficult to find where the program files are deployed.
The following commands will tell you where the new files are created. Now that you can remove the programm following the diff output. The following each line is in one line.
The following commands will tell you where the new files are created. Now that you can remove the programm following the diff output. The following each line is in one line.
%sudo find / | grep -v -e ^/proc/ -e ^/dev/ -e ^/media/ -e ^/tmp/ -e ^/mnt/ >beforeinstall.list
% sudo find / | grep -v -e ^/proc/ -e ^/dev/ -e ^/media/ -e ^/tmp/ -e ^/mnt/ >afterinstall.list
% diff beforeinstall.list afterinstall.list
Mastering dpkg
Debian GNU/Linux package manager is very cozy tool to manage applications on your system.
Here are the tips of useful commands of "dpkg".
Here are the tips of useful commands of "dpkg".
// Search the package
$dpkg -l 'firefox*'
//Search installed package
$dpkg -l | grep firerox
//List up the files install by the package
$dpkg -L firefox
//Search the package from the specific file
$dpkg -S mozilla-firefox.png
//Aquire the complete information of the packageThose commands are often needed but often forgotten...
$dpkg -s firefox
Subscribe to:
Posts (Atom)