Posts

Showing posts from February, 2013

About DPKG

ref  http://www.cyberciti.biz/howto/question/linux/dpkg-cheat-sheet.php ref  http://linuxprograms.wordpress.com/2010/05/14/dpkg-tutorial/ Very thank for Owners of 2 links above. The first column corresponds to the status of a package. How to interpret this status. Status of every package is represented by  three characters xxx Let’s explore each of the character signify. First character : The possible value for the first character. The first character signifies the desired state, like we (or some user) is marking the package for installation u: Unknown (an unknown state) i: Install (marked for installation) r: Remove (marked for removal) p: Purge (marked for purging) h: Hold Second Character : The second character signifies the current state, whether it is installed or not. The possible values are n: Not- The package is not installed i: Inst – The package is successfully installed c: Cfg-files – Configuration files are present u: Unpacked- The package is stille

Bash Shortcuts

These content are from SKORKS ( http://www.skorks.com/2009/09/bash-shortcuts-for-maximum-productivity/ ), Thanks Alan Skorkin Command Editing Shortcuts Ctrl + a  – go to the start of the command line Ctrl + e  – go to the end of the command line Ctrl + k  – delete from cursor to the end of the command line Ctrl + u  – delete from cursor to the start of the command line Ctrl + w  – delete from cursor to start of word (i.e. delete backwards one word) Ctrl + y  – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor Ctrl + xx  – move between start of command line and current cursor position (and back again) Alt + b  – move backward one word (or go to start of word the cursor is currently on) Alt + f  – move forward one word (or go to end of word the cursor is currently on) Alt + d  – delete to end of word starting at cursor (whole word if cursor is at the beginning of word) Alt + c  – capitalize to end of word starting

Recursive rename in python script

#!/usr/bin/env python import fnmatch import os root = os.getcwd() pattern = "*.JPG" for root, dirs, files in os.walk(root):     for filename in fnmatch.filter(files, pattern):         #print (os.path.join(root, filename))         full_src = os.path.join(root, filename)         full_dst = full_src.replace('.JPG','.jpg')         os.rename(full_src, full_dst)         print "Renaming {0} to {1}".format(full_src, full_dst)

Noted from Wizard's Hero K

This is the note from chatting with Wizard's Hero K of Proteus-Tech. I derived them to keywords. stdin, stdout, stderr mixin of stdout and stderr PTY ELF mkfifo ( explicit pipe ) stderrred LD_PRELOAD buffer read between user program and varanus/profab/buildbot/fabric buildbot has miss order problem may cause of the buffer read see in buildbot waterfall, the traceback error come before the command that generate it. in c/c++ \r and \n act in different way in linux and window std:flush, std:out printf  :) Have recall my knowledge!! Thank Wizard K