Friday, November 11, 2011

my ~/.vimrc file

set hlsearch
set nu
set ignorecase
set expandtab
set shiftwidth=4
set softtabstop=4

if has ("autocmd")
    autocmd BufRead *.file set tw=150
    autocmd BufRead *.prvc set nobackup nowritebackup foldmethod=indent fdo=insert
    filetype plugin indent on
    au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif


For gVim, following options can be added to "_vimrc" file
at path: C:\Users\\_vimrc

set noswf

if has("gui_running")
    if has("gui_win32")
        set guifont=Fixedsys:h11
    endif
endif


# other options:
# gui_gtk2 / gui_macvim / gui_gtk3 / gui_win32
 



Wednesday, November 9, 2011

Create Bootable Fedora USB stick from ISO image on any Linux distro


Fedora-15-x86_64-Live-KDE.iso,
usb-stick (/dev/sdb1) 8GB having label SATELLITE (1GB is enough),
and syslinux command.

Following are the steps:
# mkdir /mnt/{iso,usb}
# mount -t iso9660 /home/user/Fedora-15-x86_64-Live-KDE.iso /mnt/iso
# mount /dev/sdb1 /mnt/usb
NOTE: /dev/sdb1 is my usb-stick
# cp -rv /mnt/iso/* /mnt/usb/
# syslinux --install -d EFI/boot/ /dev/sdb1
used '-d EFI/boot/' because vmlinuz and initrd image file exist in this folder wrt to root of usb ie /mnt/usb
otherwise need to edit their paths accordingly in syslinux.cfg.
# cd /mnt/usb/EFI/boot
# cp isolinux.cfg syslinux.cfg
edit syslinux.cfg and edit 'root' parameter of kernel
root=LABEL=SATELLITE
eg,
label linux0
   menu label Boot
   kernel vmlinuz0
   append initrd=initrd0.img root=LABEL=SATELLITE rootfstype=auto ro liveimg rd.luks=0 rd.md=0 rd.dm=0


Can Test it with qemu or qemu-system-x86_64:
# qemu-system-x86_64 -hda /dev/sdb1 -m256 -vga std

If boot successfully, just reboot the system and boot it from usb.

NOTE: label can be set using command: e2label /dev/sdb1 SATELLITE