How to indent php+html+javascript code using Vim on Linux

1. install full vim with plugins.
put following vim commands in /root/.vimrc

:set nocompatible
:filetype indent on
:syntax on
:set tabstop=4
:set shiftwidth=4
:set expandtab

2. create a vim script file (lets say vimscript.scr) in /root
put the following vim commands in vimscript.scr file

" this is a vim script comment
" remove \r in case file is from windows world
:%s/\r$//g

" set filetype as javascript and indent it
:set ft=javascript
gg=G

" set filetype as html and indent it
:set ft=html
gg=G

" set filetype as php and indent it
:set ft=php
gg=G

" convert multiple blank lines to single blank line
:%s/\n\{3,}/\r\r/e

" after indenting save file
:wq
" script end


3. to indent all php files in a dir, go to that dir and run
#find . -type f -name '*.php' -exec vim -s /root/vimscript.scr "{}" \;

Building geany from source

[To compile geany]
Get source tar file from http://www.geany.org/Download/Releases
# cd geany-1.24.1
# ./configure
# make

[To compile geany plugin]
Get source tar file from http://plugins.geany.org/downloads.html
Make sure geany 1.24 is compiled and installed.
# cd geany-plugins-1.24
# ./configure
[This sometimes gives error, "configure: error: Package requirements (geany >= 1.24) were not met".
Test if installation is proper,
#PKG_CONFIG_PATH=/usr/local/lib/pkgconfig pkg-config --modversion geany
# echo $PKG_CONFIG_PATH
May be path is not having /usr/local/lib/pkgconfig, then do,
# PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure]
# make

To create puppy pet/sfs package from source code

Generally:

[compile]
# cd xyz-<ver>
# ./configure
# make

# new2dir make install
# cd ..

[to create a pet]
# dir2pet xyz-<ver>-<arch>

[to create a sfs]
# mksquashfs xyz-<ver>-<arch> xyz-<ver>-<arch>.sfs -noappend

Simplest way to install virtualbox in puppy linux.

VirtualBox has a package for generic Linux distributions, like
http://download.virtualbox.org/virtualbox/4.3.16/VirtualBox-4.3.16-95972-Linux_amd64.run

You can find this link at https://www.virtualbox.org/wiki/Linux_Downloads under name "All distributions".

Simply choose one .run file (32bit or 64bit).
After downloading it, simply run it from terminal.
You need to have devx and kernel-sources packages already loaded into your puppy linux.

VirtualBox gets installed in /opt.

That's it.

To adjust brightness of laptop screen, without help of keyboard. (2)

Some times acpi can't adjust the brightness.

Next thing we need to try is, pass the following parameter to Linux kernel from grub configuration file.

acpi_backlight=vendor

Now if you are lucky, you can control brightness using the same old technique.

Current brightness is provided by file /sys/class/backlight/intel_backlight/actual_brightness.
Collect current brightness.
Max brightness is provided by file /sys/class/backlight/intel_backlight/max_brightness.
Now write a number, from 0 to MAX, to the file /sys/class/backlight/intel_backlight/brightness using echo.
Done.

Thanks to https://wiki.ubuntu.com/Kernel/Debugging/Backlight

To adjust brightness of laptop screen, without help of keyboard.

Thanks to my puppy Linux, which provides nice little scripts "brightness-up" and "brightness-down" to do the job.

Once we peep into it, we see what is going on under the hood.

To adjust brightness of laptop screen, we do this:

Current brightness is provided by file /sys/class/backlight/acpi_video0/actual_brightness.
Collect current brightness.
Max brightness is provided by file /sys/class/backlight/acpi_video0/max_brightness.
Now write a number, from 0 to MAX, to the file /sys/class/backlight/acpi_video0/brightness using echo.
Done.

So simple!!