rpm2cpio [package.rpm] |cpio -dvim
it should extract the archive in the current directory
rpm2cpio [package.rpm] |cpio -dvim
it should extract the archive in the current directory
xbacklight is an useful command to change the brightness of your monitor backlight provided you have a supported driver.
xbacklight -get
to retrieve to get present brightness level in %
xbacklight -set value
to set the brightness to desired value in %
Most of the time I need to login to my linux box in my office from home. The obvious choice is to ssh using putty or cygwin (in case i need some X windows). Normally in cygwin – you will run
ssh -l xyz@yourserver.com ………(1)
to login to your account “xyz” in yourserver.com . This would ask for password and if you provide the correct password you would be able to login to the server.
SSH optionally uses public-key encryption – where a public and private key pair can be used to automate the login process. If you are using cygwin( or in fact any other client running ssh) you can do the following to generate your public and private key pair
ssh-keygen…………………………..(2)
It will prompt for a few input – but you can just press ‘enter’ in all the cases. The keys will be created in $HOME/.ssh/as id_rsa(private key) and id_rsa.pub(public key). Now you can copy the id_rsa.pub to the server -yourserver.com’s ‘xyz’s ~/.ssh/ as ‘authorized_keys’ – and you are done. Try running (1) and you should be able to login without the prompt for password.
In case you are using putty – you can use puttygen to generate the public & private key pair. Then you will do the same step – copy the public key to the desired account’s .ssh/authorized_keys and use the private key to login. There are tutorials that explains this with nice diagrams .
I have been working on mozilla codebase quite sometime. Its a huge codebase with millions of lines of code. A simple counting on the numbers of lines in *.cpp files for 3.0b2 release accounts 1778818 lines of code[1]. Most of the time I need to search for function definitions – I used grep -r xyz * as that was the only option I know until recently I have started using cscope which came as a rescue. cscope maintains its own database of symbol definition of the code. You can find the symbol, find a symbol definition, a file , a text within source code. Configuration of the cscope database is simple.
Step 1 . Make a directory to store the cscope db say $HOME/mycscope/mozilla
Step 2. cd /
Step 3. say $HOME/mozilla is the home directory of the project that contains the source files(*.c,*.cpp,*.h)
run find $HOME/mozilla -name “*.cpp” >> $HOME/mycscope/mozilla/cscope.files
run find $HOME/mozilla -name “*.h” >> $HOME/mycscope/mozilla/cscope.files etc.
It will simply populate the cscope.files used by cscope to create the data with the desired filenames.
Step 4. run in $HOME/mycscope cscope -b -q -k which will create the database cscope.out
Step 5. run cscope -d from $HOME/myscope and start searching and browsing code.
In case you want to invoke it from vim add the following lines to your .vimrc
set nocsverb ; supress cscope logging messages
cscope add $HOME/mycscope/cscope.out
You should be able to invoke cscope from vim window now . eg try :cs find 1 XYZ
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1. sum=0;for i in `find . -name “*.cpp” -exec wc -l {} \; |cut -d ‘ ‘ -f 1` ; do sum=`expr $sum + $i`; done; echo $sum
For those who are writing codes in C/C++ using Vim should find this .vimrc configuration file useful . The script should be self explanatory . If you have any question, I will try to answer. or :help should help you out. Put the following lines to your .vimrc and save .
set incsearch “when you start searching ESC /[string] it will start matching as soon as you type
set scrolloff=3 ” there would be atleast 3 lines from the top/bottom of the screen as you edit
set wildmode=longest,list ” ESC :![filename] TAB should give you a list of matched files
set ts=2 ” TAB would be of two char length
set expandtab “expand TAB char to spaces
set ai ” set auto indent
set cindent shiftwidth=4 “enable C style indent
set ignorecase
set smartcase ” together they help you search string ignoring case if you type in lower case
colo evening ” if you like a colorful editing experience
Many people do not like Vista for a lot of reasons. I personally donot like it because I can no longer use my favorite softwares that runs in XP due to compatibility issues. Initially I thought I would just install Windows XP over Vista. But again I had some issues with the drivers for my laptops – they are just made for Vista it seems. Finally I found a turnaround.
Microsoft thankfully provides a virtual desktop environment called Virtual PC. You can use it as a virtual machine in most of the Vista Versions and install Windows XP and other Windows OS on it.
Details on how to set up the Virtual PC on your machine can be found in this link.
I am currently using it and found it powerful and fast enough for my programming stuff.
It comes FREE of cost.
A $100 laptop – with a tablet screen, video camera, microphone, a graphics tablet, game-pad controllers, and a memory-card slot ? Yes, this is the dream of One Laptop Per Child to develop a very low-cost, high-potential, extremely rugged computer for the two billion educationally underserved children in poor countries. And the dream comes true OLPC unveiled their dream machine XO in October.
XO provides regular wireless Internet connectivity as well as mesh networking, and its system software takes up one-fifth of its 1 GB of flash memory storage. The majority of the laptop’s programs can be shared on the mesh network it supports. The XO comes close to the initiative’s original vision of a $100 laptop (it currently costs $200 ) and in November the computer will be offered for sale to the public in industrialized countries for two weeks through OLPC’s “Get 1, Give 1″ program. Under the program, a consumer pays $400, which covers the cost of one XO laptop–complete with tax deduction–for the consumer and one for a student in an impoverished country. One more reason to be happy – XO is built from free and open-source software.
Configuration : (Details can be found here )
Comments