Posts

Showing posts from May, 2016

VIM Best tips and tricks

Original author - http://rayninfo.co.uk/vimtips.html *vimtips.txt* For Vim version 7.3. ------------------------------------------------------------------------------ " new items marked [N] , corrected items marked [C] " *best-searching* /joe/e : cursor set to End of match 3/joe/e+1 : find 3rd joe cursor set to End of match plus 1 [C] /joe/s-2 : cursor set to Start of match minus 2 /joe/+3 : find joe move cursor 3 lines down /^joe.*fred.*bill/ : find joe AND fred AND Bill (Joe at start of line) /^[A-J]/ : search for lines beginning with one or more A-J /begin\_.*end : search over possible multiple lines /fred\_s*joe/ : any whitespace including newline [C] /fred\|joe : Search for FRED OR JOE /.*fred\&.*joe : Search for FRED AND JOE in any ORDER! /\<fred\>/ : search for fred but not alf

Save power on Linux based system link Linux Mint and Ubuntu

Kernel 3.2 to 2.6 has a bug in linux Mint thus causing laptops to be frying and battery is drastically affected. It is a pcie bus issue that is running at throttle power. Advanced power management comes to our rescue. Follow the below steps --------------------------------------------------------------------------- Change grub file sudo vi /etc/default/grub Change - This line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force intel_pstate=enable" Save and close the file Then sudo update-grub Reboot the machine to see if the problem is solved. If not then apply this GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 intel_pstate=enable" Now save file sudo update-grub Reboot and Enjoy a cooler machine

Edge vs Level sensitive interrupts

Edge Triggered Vs Level Triggered interrupts Discussion: Level triggered: as long as the IRQ line is asserted, you get an interrupt request. When you serve the interrupt and return, if the IRQ line is still asserted, you get the interrupt again immediately. Edge triggered: You get an interrupt when the line changes from inactive to active state, but only once. To get a new request, the line must go back to inactive and then to active again. Level triggered interrupt is like a baby. If the baby cries, you have to abandon whatever you are doing and feed the baby. You put her down. If she's still crying, you need to attend her immediately again. As long as she's crying, you serve her needs. You can get back to your work only when she's quiet. If you are in the garden (interrupt disabled) when she starts to cry, then when you get into the house (enable interrupts) the first thing you will do is to see her. However, if she starts crying