Saturday, March 1, 2014

Fedora out, Arch is in and am loving it!

Writing this post after many months, since I got little more time than anticipated. And after years running fedora, I finally switched to arch linux. Fedora was great, had no issues and I enjoyed the backup, reformat and new install of each new fedora release. The switch to arch was due to following three main reasons:
1. Rolling release, so no need to reformat. This was especially helpful for office laptops.
2. Awesome documentation. whenever you are stuck, just google your issue and suffix arch and you will be taken to arch wiki with solutions or forums for suggestions.
3. Since we start install and configuring the arch system from scratch, it's educational. There are lot of stuff I came to know after trying out arch. First  I started out in virtual box vm, then on other laptops. Also I haven't found any package which is not available in arch either in main repos or in aur, you will always find what you need.


Anyways here are the steps I took for my arch install. This will serve as reference to myself as well as others who want to try out.

---------------------------------------------------------------------------------------------------
# Burn arch iso to usb drive on existing linux system using dd
[More info at https://wiki.archlinux.org/index.php/USB_Flash_Installation_Media]
---------------------------------------------------------------------------------------------------
Goto https://www.archlinux.org/download/ and download arch iso.
I downloaded archlinux-2014.01.05-dual.iso
For my usb, the command  I used was
dd bs=4M if=/home/bhupendra/Downloads/archlinux-2014.01.05-dual.iso of=/dev/sdb && sync

---------------------------------------------------------------------------------------------------
# creating partitions
[More info at https://wiki.archlinux.org/index.php/Beginners%27_Guide#Prepare_the_storage_drive]
---------------------------------------------------------------------------------------------------
boot into arch linux cd or bootable usb
lsblk [to list existing partitions]
465.8gb total space was available on my hdd
I decided to create partition of 461.8gb and use 4gb for swap
fdisk /dev/sda
d - to delete partitions
o - to create a new empty dos partition table
n - add new partition
a - to set /dev/sda1 bootable else bios may not boot the partition
w - write to disk

After above has been done, verify changes using lsblk again. then
mkfs -t ext4 /dev/sda1
mkswap /dev/sda2

---------------------------------------------------------------------------------------------------
# minimal install
[More info at https://wiki.archlinux.org/index.php/Beginners%27_Guide]
---------------------------------------------------------------------------------------------------

mount /dev/sda1 /mnt
pacstrap -i /mnt base
genfstab -U -p /mnt >> /mnt/etc/fstab
echo "/dev/sda2 none swap defaults 0 0" >> /mnt/etc/fstab
arch-chroot /mnt
ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime
uncomment below line in /etc/locale.gen
en_US.UTF-8 UTF-8
generate locale with following command
locale-gen
vi /etc/locale.conf and add following:
LANG="en_US.UTF-8"
hwclock --systohc --utc
echo arch > /etc/hostname
systemctl enable dhcpcd
pacman -S grub
grub-install --target=i386-pc --recheck --debug /dev/sda
vi /etc/default/grub and set following [where /dev/sda2 is the swap partition]
GRUB_CMDLINE_LINUX="resume=/dev/sda2"
grub-mkconfig -o /boot/grub/grub.cfg

pacman -S mkinitcpio
mkinitcpio -p linux

passwd
useradd -m -g users -s /bin/bash bhupendra
passwd bhupendra
pacman -S sudo
echo 'bhupendra ALL=(ALL) ALL' >> /etc/sudoers

#remove vi and nano and install vim
sudo pacman -Rs vi nano
sudo pacman -S vim
add vi symlink to vim just in case some programs try to utilize vi eg. crontab -e or git
sudo ln -s /usr/bin/vim /usr/bin/vi

#set correct time [https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon]
pacman -S ntp
to synchronize your system clock just once without starting ntpd
ntpd -q
After updating the system clock, store the time to the hardware clock so that it is preserved when rebooting
hwclock -w
to enable ntpd service
systemctl enable ntpd
systemctl start ntpd

#enable remote login via ssh/sftp
pacman -S openssh
The SSH client configuration file is /etc/ssh/ssh_config or ~/.ssh/config
The SSH daemon configuration file can be found and edited in /etc/ssh/sshd_config
vi /etc/ssh/sshd_config and set following
PermitRootLogin no
X11Forwarding yes
sudo systemctl enable sshd
sudo systemctl start sshd
Note that for firefox to open on x forwarding, one might need to use firefox -no-remote

pacman -Syu

exit
umount -R /mnt
shutdown now
remove arch install cd and boot into installed arch
boot up

---------------------------------------------------------------------------------------------------
# lxde install
---------------------------------------------------------------------------------------------------

#install base xorg
sudo pacman -S xorg-server xorg-server-utils xorg-xinit mesa

#enable audio. ALSA usually works out-of-the-box. It just needs to be unmuted. Install alsa-utils (which contains alsamixer)
sudo pacman -S alsa-utils alsa-plugins pulseaudio
type alsamixer and unmute/inc everything.
After reboot, sound setting by alsamixer can not restore. Maybe you can restore by command : sudo alsactl restore.
Please check the Auto-Mute toggle status in alsamixer : set Enabled to Disabled.

#install video drivers
lspci | grep VGA
sudo pacman -S xf86-video-intel xf86-video-nouveau xf86-video-ati xf86-video-vesa
[for intel, nvidia and amd/ati respectivly. vesa as fallback generic mode-setting driver that will work with almost every GPU, but will not provide any 2D or 3D acceleration]

#enable video acceleration api
For me I have only the integrated intel graphics card, if there is discrete dedicated video card more info at https://wiki.archlinux.org/index.php/VA-API
sudo pacman -S libva-intel-driver
sudo vim /etc/profile and add following
export LIBVA_DRIVER_NAME=vdpau
for gstreamer, sudo pacman -S gst-vaapi
To enable hardware acceleration in vlc: Tools -> Preferences -> Input & Codecs, then check "Use GPU accelerated decoding". Generally, VAAPI is used for Intel and Broadcom graphic cards, while VDPAU is used for AMD/ATI and NVIDIA cards.

#install common fonts packages to support international languages
sudo pacman -S ttf-dejavu ttf-indic-otf ttf-freefont ttf-arphic-uming ttf-baekmuk

#lxde group install
sudo pacman -S lxde
sudo systemctl enable lxdm
sudo vim /etc/lxdm/lxdm.conf and uncomment line session=/usr/bin/startlxde
NOTE: obconf and lxappearance are very similar so installing one should be good enough

#setting up networking manager
sudo pacman -S rfkill networkmanager networkmanager-vpnc network-manager-applet
sudo systemctl enable NetworkManager
sudo systemctl enable NetworkManager-dispatcher
Note: instead of using ifconfig and iwconfig, use ip addr
sometimes if wifi link is down, do following:
sudo ip link wlo1 up
I had to stop and disable dhcpcd for networkmanager to pick up ethernet

#creating some default folders in home directory
mkdir ~/Downloads ~/scripts ~/Videos ~/Music ~/Pictures ~/Documents

#clipboard manager
sudo pacman -S clipit
I started it once by invoking from terminal and it always started showing up in on reboot. Hence removed it from autostart.
Also changed following preferences:
check use right-click menu under settings
under history, items in history 150 (default 50), items in menu 20 (default 20), character lenght of items 500 (default 50)

---------------------------------------------------------------------------------------------------
# lxde customization and common software install
---------------------------------------------------------------------------------------------------
#move panel to top, remove broken icon on left of panel and add lxterminal to panel shortcut
#right click panel, apprearance, set solid color with 0 opacity
#change date format on digital clock to %m/%d %r instead of %R and set font to bold

#add battery applet to lxde panel before systemtray. It uses xmessage to display notification that battery is low
sudo pacman -S gxmessage
right click battery applet and go to settings. change alarm command to following
gxmessage Battery low - 5 min left

#adding your own wallpaper
download to wallpaper image eg. Planets.jpg under ~/Downloads
sudo cp ~/Downloads/Planets.jpg /usr/share/lxde/wallpapers
sudo chmod 644 /usr/share/lxde/wallpapers/Black-Wallpaper.jpg
Now right click on desktop, desktop preferences, and change the wallpaper
#make lxdm use the updated wallpaper
sudo vim /etc/lxdm/lxdm.conf and add following
bg=/usr/share/lxde/wallpapers/Planets.jpg

#install adwaita theme
sudo pacman -S gnome-themes-standard

#prep for aur builds
sudo pacman -S --needed base-devel wget rync

#yaourt installation (to install packages from aur)
Add following to  /etc/pacman.conf
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch
Now run
sudo pacman -Sy yaourt

#install comix cursors, good especially on large monitors or connected tvs  [skipping for now]
yaourt xcursor-comix
now goto lxappearance and select
comiz cursor original white small bold - for laptop
comiz cursor original white huge bold - for connected tv
Also I have set following in lxappearance:
widget = adwaita
color = check "Use customized color scheme", for "selected items" change color to #75507B for purple or #000000 for black, instead of default blue
icon theme = nuoveXT.2.2 [default]
window border = onyx [default]

#Installing sound tray icon and equilizer
sudo pacman -S pavucontrol
yaourt pnmixer

open pnmixer preferences and under behavoiur tab set volume control command = pavucontrol if it does not exit
also select icon theme as nuoveXT.2.2 as it is more visible on dark background.
Ran into issue with hot key bindings for pnmixer. It was muting volume correctly but unmuting did not work.
Hence had to add custom bindings seperatly.
sudo vim /etc/xdg/lxsession/LXDE/autostart and add following
@pnmixer
Note that if you have keybindings for volume keys you need not install pnmixer at all. Worst case scenarios, one can open pavucontrol

#transparent lxterminal
open lxterminal
edit -> preferences
under background set opacity = 220

#nice effects
yaourt compton-git
pacman -Rs asciidoc git [since they were required only for the build]
vim ~/.compton.conf and add following
# Shadow
shadow = true; # Enabled client-side shadows on windows.
no-dock-shadow = true; # Avoid drawing shadows on dock/panel windows.
no-dnd-shadow = true; # Don't draw shadows on DND windows.
clear-shadow = true; # Zero the part of the shadow's mask behind the
# window. Fix some weirdness with ARGB windows.
shadow-radius = 7; # The blur radius for shadows. (default 12)
shadow-offset-x = -7; # The left offset for shadows. (default -15)
shadow-offset-y = -7; # The top offset for shadows. (default -15)
# shadow-opacity = 0.7; # The translucency for shadows. (default .75)
# shadow-red = 0.0; # Red color value of shadow. (0.0 - 1.0, defaults to 0)
# shadow-green = 0.0; # Green color value of shadow. (0.0 - 1.0, defaults to 0)
# shadow-blue = 0.0; # Blue color value of shadow. (0.0 - 1.0, defaults to 0)
shadow-exclude = [ "n:e:Notification" ]; # Exclude conditions for shadows.
# shadow-exclude = "n:e:Notification";
shadow-ignore-shaped = true; # Avoid drawing shadow on all shaped windows
# (see also: --detect-rounded-corners)
# Opacity
menu-opacity = 0.9; # The opacity for menus. (default 1.0)
inactive-opacity = 0.9; # Default opacity of inactive windows. (0.0 - 1.0)
# active-opacity = 0.8; # Default opacity for active windows. (0.0 - 1.0)
# frame-opacity = 0.8; # Opacity of window titlebars and borders. (0.1 - 1.0)
# inactive-opacity-override = true; # Let inactive opacity set by 'inactive-opacity' overrides
# value of _NET_WM_OPACITY. Bad choice.
alpha-step = 0.06; # XRender backend: Step size for alpha pictures. Increasing
# it may result in less X resource usage,
# Yet fading may look bad.
# inactive-dim = 0.2; # Dim inactive windows. (0.0 - 1.0)
# inactive-dim-fixed = true; # Do not let dimness adjust based on window opacity.
# blur-background = true; # Blur background of transparent windows.
# Bad performance with X Render backend.
# GLX backend is preferred.
# blur-background-frame = true; # Blur background of opaque windows with transparent
# frames as well.
blur-background-fixed = false; # Do not let blur radius adjust based on window opacity.
blur-background-exclude = [ "window_type = 'dock'", "window_type = 'desktop'" ];
# Exclude conditions for background blur.
# Fading
fading = true; # Fade windows during opacity changes.
# fade-delta = 30; # The time between steps in a fade in milliseconds. (default 10).
fade-in-step = 0.03; # Opacity change between steps while fading in. (default 0.028).
fade-out-step = 0.03; # Opacity change between steps while fading out. (default 0.03).
# no-fading-openclose = true; # Avoid fade windows in/out when opening/closing.
fade-exclude = [ ]; # Exclude conditions for fading.
# Other
backend = "xrender" # Backend to use: "xrender" or "glx". GLX backend is typically
# much faster but depends on a sane driver.
mark-wmwin-focused = true; # Try to detect WM windows and mark them as active.
mark-ovredir-focused = true; # Mark all non-WM but override-redirect windows active (e.g. menus).
use-ewmh-active-win = false; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused
# instead of using FocusIn/Out events. Usually more reliable but
# depends on a EWMH-compliant WM.
detect-rounded-corners = true; # Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-client-opacity = true; # Detect _NET_WM_OPACITY on client windows, useful for window
# managers not passing _NET_WM_OPACITY of client windows to frame
# windows.
refresh-rate = 0; # For --sw-opti: Specify refresh rate of the screen. 0 for auto.
vsync = "none"; # "none", "drm", "opengl", "opengl-oml", "opengl-swc", "opengl-mswc"
# See man page for more details.
dbe = false; # Enable DBE painting mode. Rarely needed.
paint-on-overlay = false; # Painting on X Composite overlay window. Recommended.
sw-opti = false; # Limit compton to repaint at most once every 1 / refresh_rate.
# Incompatible with certain VSync methods.
unredir-if-possible = false; # Unredirect all windows if a full-screen opaque window is
# detected, to maximize performance for full-screen windows.
focus-exclude = [ ]; # A list of conditions of windows that should always be considered
# focused.
detect-transient = true; # Use WM_TRANSIENT_FOR to group windows, and consider windows in
# the same group focused at the same time.
detect-client-leader = true; # Use WM_CLIENT_LEADER to group windows.
invert-color-include = [ ]; # Conditions for windows to be painted with inverted color.
# GLX backend # GLX backend fine-tune options. See man page for more info.
# glx-no-stencil = true; # Recommended.
glx-copy-from-front = false; # Useful with --glx-swap-method,
# glx-use-copysubbuffermesa = true; # Recommended if it works. Breaks VSync.
# glx-no-rebind-pixmap = true; # Recommended if it works.
glx-swap-method = "undefined"; # See man page.
# Window type settings
wintypes:
{
  tooltip = { fade = true; shadow = false; opacity = 0.75; focus = true; };
  # fade: Fade the particular type of windows.
  # shadow: Give those windows shadow
  # opacity: Default opacity for the type of windows.
  # focus: Whether to always consider windows of this type focused.
};
sudo vim /etc/xdg/lxsession/LXDE/autostart and add following to start compton on boot
@compton --config ~/.compton.conf -b
reboot


#enable touchpad scrolling
sudo pacman -S xf86-input-synaptics
sudo vim /etc/X11/xorg.conf.d/50-synaptics.conf and add following options under inputclass
  Option "VertEdgeScroll" "on"
  Option "VertTwoFingerScroll" "on"
  Option "HorizEdgeScroll" "on"
  Option "HorizTwoFingerScroll" "on"
  Option "CircularScrolling" "on"
  Option "CircScrollTrigger" "2"
  Option "EmulateTwoFingerMinZ" "40"
  Option "EmulateTwoFingerMinW" "8"
  Option "CoastingSpeed" "0"
Add following to /etc/xdg/lxsession/LXDE/autostart to disable touch pad while typing which helped in resolving jumping mouse/ error clicks.
@syndaemon -t -k -i 2 -d

#everything to handle archives
sudo pacman -S file-roller p7zip unrar zip arj unace

#open folders as root in pcmanfm
sudo pacman -S gksu
open pcmanfm preferences and under switch user commands replace "xdg-su -c '%s'" by "gksu %s"
However since this was installing gconf and libgnome-keyring I decided not to use this feature for now.

#to automount sdcards, external usb drives etc, mtp or camera devices
sudo pacman -S gvfs gvfs-mtp gvfs-gphoto2

#office suite
sudo pacman -S libreoffice-en-US libreoffice-base libreoffice-calc libreoffice-common libreoffice-draw libreoffice-impress libreoffice-writer libmythes mythes-en aspell hunspell hunspell-en hyphen

#calculator
sudo pacman -S galculator

#text editor
sudo pacman -S leafpad

#messenger
sudo pacman -S pidgin

#browser
sudo pacman -S firefox flashplugin
-Install following addons in firefox
Adblock Edge
No Google Analytics
fast dial
jsview [http://downloads.mozdev.org/xsidebar/mods/jsview-2.0.8-mod.xpi]
live http headers
measureit
poster
ref control
user agent switcher
Add your own useragent string or Download xml file from http://techpatterns.com/forums/about304.html and import via addon via options.
downloadhelper
Disable all the addons that are not in use and Add-on bar for faster firefox experience.
Goto firefox edit preferences, under general tab
show my homepage and set home page as chrome://fastdial/content/fastdial.html
right click on fast dial
under general tab -> inc quantity to 8x4, rearrange shortcuts if out of sync
under appearance tab -> page -> add your wallpaper
-sync bookmarks
Tools -> setup sync
I have account
click sync options and uncheck addons, history, tabs
I don't have the device with me, enter credentails and account key
-install plugin support
yaourt mozplugger

#play all video files
sudo pacman -S vlc ffmpeg
yaourt npapi-vlc-git
sudo pacman -Rs git npapi-sdk

#music players
lxmusic is already installed and should play mp3 files

#torrent client
sudo pacman -S transmission-gtk

#cd/dvd burner
sudo pacman -S k3b dvd+rw-tools vcdimager transcode emovix cdrdao

#disk usage gui
sudo pacman -S baobab

#skype
sudo vim /etc/pacman.conf and uncomment following lines
[multilib]
Include = /etc/pacman.d/mirrorlist
sudo pacman -Syyu
sudo pacman -S skype lib32-libpulse

#video chat browser plugin for google talk
yaourt google-talkplugin

#partition manager
sudo pacman -S gparted gpart mtools ntfs-3g dosfstools

-firewall
sudo pacman -S firewalld
sudo systemctl enable firewalld
sudo systemctl start firewalld

-printer
sudo pacman -S system-config-printer cups hplip
sudo systemctl enable cups
sudo systemctl start cups
sudo gpasswd -a bhupendra sys
type system-config-printer in terminal or under preferences print settings
click add, it will ask for root password and prompt to adjust firewall for printing
click network printer, select appsocket/jet direct, set host 192.168.0.8 (ip may differ), check duplexer installed
HP-Photosmart-Estn-c510 (printer may differ) should show up
--for my office xerox printer, I was able to configure below in similar way
Xerox WorkCentre Pro 238 SBKPRT0229
172.26.115.223
lpd://172.26.115.223/PASSTHRU
Xerox WorkCentre Pro 133 Foomatic/Postscript

#screensavers if needed
sudo pacman -S xscreensaver
Then goto preferences ->screensaver. Set mode to "only one screensaver" and selected xMatrix.
goto to matrix settings and change font to small
set blank after 5 minutes
set lock screen in 10 minutes
under advanced tab, check power management enabled
standby after 15 minutes
suspend after 20 minutes
off after 240 minutes

#image utilities
gpicview is already installed by default with lxde. If you want image manipulation try gimp.
sudo pacman -S scrot gimp
Gimp now has single window mode too.
To see image thumbnail preview in pcmanfm for large sized images,
open pcmanfm, edit-> preferences, under display, set size for "Do not generate thumbnails for files exceeding this size" as 99999

#remote control
yaourt teamviewer
sudo systemctl enable teamviewerd
sudo systemctl start teamviewerd
Either open teamviewer from application menu or terminal or to auto start it on boot add to autostart.
sudo vim /etc/xdg/lxsession/LXDE/autostart and add following
@teamviewer
Open teamviewer.
You can give the generated user id and password code for someone to remote access.
Alternativly, click on personal password and link it to your free teamviewer account for easier access.

#Remmina - gtk+ app for rdp/nx/vnc/xdmcp/ssh
sudo pacman -S remmina freerdp remmina-plugin-teamviewer
Once opened, it docks to tray. To disable that edit->preferences->applet->disable tray icon

#record desktop
sudo pacman -S recordmydesktop gtk-recordmydesktop

#stream to web from your webcam
run following
cvlc v4l2:// :v4l2-vdev="/dev/video0" --sout '#transcode{vcodec=x264{keyint=60,idrint=2},vcodec=h264,vb=400,width=368,heigh=208,acodec=mp4a,ab=32 ,channels=2,samplerate=22100}:duplicate{dst=std{access=http{mime=video/x-ms-wmv},mux=asf,dst=:8082/stream.wmv}}' --no-sout-audi
and open the stream using following url on same machine
127.0.0.1:8082/stream.wmv

#conky
sudo pacman -S conky
default config at /etc/conky/conky.conf and user specific at ~/.conkyrc. Below is my conky config. However I later removed it since show desktop was hiding conky always.

alignment bottom_left
background yes
border_width 1
cpu_avg_samples 2
default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
use_xft yes
xftfont DejaVu Sans Mono:size=10
gap_x 10
gap_y 30
minimum_size 300 500
net_avg_samples 2
no_buffers yes
double_buffer yes
out_to_console no
out_to_stderr no
extra_newline no
own_window yes
own_window_transparent yes
own_window_class Conky
own_window_type normal
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
stippled_borders 0
update_interval 1.0
update_interval_on_battery 3.0
uppercase no
use_spacer none
show_graph_scale no
show_graph_range no

TEXT
$hr
${color grey}$sysname $Kernel on $machine - $nodename $color
${color darkgrey}Internal IP:$color W[${addr wlo1}] E[${addr enp0s25}]
${color darkgrey}External IP:$color ${execi 3600 wget -O - http://ip.tupeux.com | tail}
${color darkgrey}Uptime:$color $uptime
$hr
${color darkgrey}MUMBAI:    $color ${tztime Asia/Kolkata %a %m/%d %I:%M:%S %p}
${color darkgrey}PLAINSBORO:$color ${tztime America/New_York %a %m/%d %I:%M:%S %p}
            ${texeci 300 curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=1\&locCode\=08536 | grep "Currently:" | sed 's/Currently://' | sed 's/C<\/title>/C/' | sed 's/^[ \t\n]*//'}<br>$hr<br>${color darkgrey}RAM:$color  ${membar 4,100} $memperc%  $memmax/$mem<br>${color darkgrey}SWAP:$color ${swapbar 4,100} $swapperc% $swapmax/$swap<br>${color darkgrey}FS:$color   ${fs_bar 4,100 /} ${fs_used_perc /}%  ${fs_used /}/${fs_size /}<br>$hr<br>${color darkgrey}CPU1 Usage:$color  ${cpubar cpu1 4,200} ${cpu cpu1}%<br>${color darkgrey}CPU2 Usage:$color  ${cpubar cpu2 4,200} ${cpu cpu2}%<br>${color darkgrey}CPU3 Usage:$color  ${cpubar cpu3 4,200} ${cpu cpu3}%<br>${color darkgrey}CPU4 Usage:$color  ${cpubar cpu4 4,200} ${cpu cpu4}%<br>$hr<br>${color grey}File systems:<br> / $color${fs_used /}/${fs_size /} ${fs_bar 6 /}<br>${color grey}Networking:<br>Up:$color ${upspeed eth0} ${color grey} - Down:$color ${downspeed eth0}<br>$hr<br>${color darkgrey}Wireless Networking:<br>Up:$color ${upspeed wlo1} ${color darkgrey} - Down:$color ${downspeed wlo1}<br>${color darkgrey}Wired Networking:<br>Up:$color ${upspeed enp0s25} ${color grey} - Down:$color ${downspeed enp0s25}<br>$hr<br>${color darkgrey}Name              PID    CPU%   MEM% $color<br>${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}<br>${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}<br>${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}<br>${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}<br>${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5}<br><br>sudo vim /etc/xdg/lxsession/LXDE/autostart and add following to autostart conky<br>@conky<br><br>If you find that the minimum_size and maximum_height or maximum_width are not being obeyed by conky, then comment out own_window_type and own_window_hints, let conly reload, then add those back again. Courtsey [https://bbs.archlinux.org/viewtopic.php?pid=1037806#p1037806]<br><br>#xrandr scripts<br>sudo pacman -S arandr<br>arandr is good to switch off one monitor and use another. In my case when I take laptop to office, I have 2 external monitors for which below scripts helps<br>cd ~/scripts<br><br>vim singlemonitor.sh<br>#!/bin/sh<br>xrandr --output DP3 --off --output DP2 --off --output DP1 --off --output HDMI3 --off --output HDMI2 --off --output HDMI1 --off --output LVDS1 --off --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal<br>xrandr --output DP3 --off --output DP2 --off --output DP1 --off --output HDMI3 --off --output HDMI2 --off --output HDMI1 --off --output LVDS1 --mode 1366x768 --pos 0x0 --rotate normal --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal<br>xrandr --output DP3 --off --output DP2 --off --output DP1 --off --output HDMI3 --off --output HDMI2 --off --output HDMI1 --off --output LVDS1 --mode 1366x768 --pos 0x0 --rotate normal --output VGA1 --off<br>xbacklight -set 100<br>pkill conky<br>conky 2> /dev/null &<br><br>vim dualmonitor.sh<br>#!/bin/sh<br>xrandr --output DP3 --off --output DP2 --off --output DP1 --off --output HDMI3 --off --output HDMI2 --off --output HDMI1 --off --output LVDS1 --mode 1366x768 --pos 0x0 --rotate normal --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal<br>xrandr --output DP3 --off --output DP2 --off --output DP1 --off --output HDMI3 --off --output HDMI2 --off --output HDMI1 --off --output LVDS1 --off --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal<br>xrandr --output DP3 --off --output DP2 --off --output DP1 --off --output HDMI3 --off --output HDMI2 --mode 1280x1024 --pos 1280x0 --rotate normal --output HDMI1 --off --output LVDS1 --off --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal<br>pkill conky<br>conky 2> /dev/null &<br><br>vim tvonly.sh<br>#!/bin/sh<br>xrandr --output HDMI-0 --off --output LVDS --off --output DVI-0 --off --output VGA-0 --mode 1920x1080 --pos 0x0 --rotate normal<br>pkill conky<br>conky 2> /dev/null &<br><br>chmod 775 *.sh<br><br>To invoke the scripts from run command add symlinks to /usr/local/bin<br>cd /usr/local/bin<br>sudo ln -s /home/bhupendra/scripts/dualmonitor.sh dualmonitor<br>sudo ln -s /home/bhupendra/scripts/singlemonitor.sh singlemonitor<br>sudo ln -s /home/bhupendra/scripts/tvonly.sh tvonly<br><br>#finding key bindings<br>Use xev command to find out the key values. More info at openbox.org/wiki/Help:Bindings however note that LXDE users should follow these instructions to edit the file ~/.config/openbox/lxde-rc.xml and not the ~/.config/openbox/rc.xml<br>#Adding custom key events<br>In ~/.config/openbox/lxde-rc.xml inside the <keyboard> element add the following:<br><!-- Keybinding for volume Keys --><br>   <keybind key="XF86AudioLowerVolume"><br>     <action name="Execute"><br>       <startupnotify><br>         <enabled>true</enabled><br>         <name>amixer</name><br>       </startupnotify><br>       <command>amixer -c 0 set Master 5- unmute</command><br>     </action><br>   </keybind><br>   <keybind key="XF86AudioRaiseVolume"><br>     <action name="Execute"><br>       <startupnotify><br>         <enabled>true</enabled><br>         <name>amixer</name><br>       </startupnotify><br>       <command>amixer -c 0 set Master 5+ unmute</command><br>     </action><br>   </keybind><br>   <keybind key="XF86AudioMute"><br>     <action name="Execute"><br>       <startupnotify><br>         <enabled>true</enabled><br>         <name>amixer</name><br>       </startupnotify><br>       <command>amixer -D pulse set Master 1+ toggle</command><br>     </action><br>   </keybind><br>   <keybind key="XF86HomePage"><br>     <action name="Execute"><br>       <startupnotify><br>         <enabled>true</enabled><br>         <name>firefox</name><br>       </startupnotify><br>       <command>firefox</command><br>     </action><br>   </keybind><br><!-- Keybinding for PrintScreen Key --><br>    <keybind key="Print"><br>      <action name="Execute"><br>       <execute>scrot -e 'mv $f ~/Downloads/'</execute><br>      </action><br>    </keybind><br>     <keybind key="A-Print"><br>      <action name="Execute"><br>       <execute>scrot -b -s -e 'mv $f ~/Downloads/'</execute><br>      </action><br>    </keybind><br>run openbox --reconfigure<br><br>#Hardware check<br>uname -a<br>cat /proc/cpuinfo<br>cat /proc/meminfo<br>cat /proc/partitions<br>lspci -v | grep VGA<br><br>sudo pacman -S dmidecode hdparm<br>sudo dmidecode --type memory   <br>hdparm -I /dev/sda             <br>          <br>One can also install lshw and view html for hw info<br>sudo pacman -S lshw<br>sudo lshw -html >> lshw.html<br>firefox lshw.html<br><br>#make arch faster<br>-For ssd<br>sudo vim /etc/fstab and add discard option to /dev/sda1. The file then looks something like below<br>#<br># /etc/fstab: static file system information<br>#<br># <file system> <dir>   <type>  <options>   <dump>  <pass><br># /dev/sda1<br>UUID=3e6fd4bb-6a0d-425a-81dd-fd3abbb37f96   /           ext4        rw,relatime,data=ordered,discard    0 1<br>/dev/sda2 none swap defaults,discard 0 0<br>-play around with linux swapiness and vfs_cache_pressure<br>To check the currently set values (60 and 100 respectively)<br>sysctl -n vm.swappiness<br>sysctl -n vm.vfs_cache_pressure<br>setting value for session<br>sudo sysctl -w vm.swappiness=20<br>sudo sysctl -w vm.vfs_cache_pressure=50<br>permanently setting value, add following in /etc/sysctl.conf<br>vm.swappiness=20<br>vm.vfs_cache_pressure=50<br>-install preload<br>yaourt preload<br>sudo systemctl enable preload<br>sudo systemctl start preload<br>-install prelink<br>sudo pacman -S prelink<br>Note: Some proprietary binaries will crash with prelink (such as Flash, Skype, Nvidia proprietary driver).<br>You can add these to the exclude list in /etc/prelink.conf as in https://wiki.archlinux.org/index.php/Talk:Prelink<br>prelink all the binaries in the directories given by /etc/prelink.conf run following<br>prelink -amR<br>Removing prelinking from all binaries run following<br>prelink -au<br>Add prelink to daily cron job in order to get benefits from updates<br>sudo vim /etc/cron.daily/prelink.cron and add follwowing:<br>#!/bin/bash<br>[[ -x /usr/sbin/prelink ]] && /usr/sbin/prelink -amR &>/dev/null<br>sudo chmod 755 /etc/cron.daily/prelink.cron<br>sudo systemctl enable cronie<br>sudo systemctl start cronie<br>-improve boot times<br>enable readahead<br>sudo systemctl enable systemd-readahead-collect systemd-readahead-replay<br>sudo vim /etc/default/grub and change GRUB_TIMEOUT=1 for quicker booting<br>sudo grub-mkconfig -o /boot/grub/grub.cfg<br>-improve firefox performance<br>Reduce load time by compressing the Firefox binary with UPX<br>sudo pacman -S upx<br>sudo cp /usr/lib/firefox/firefox /usr/lib/firefox/firefox.backup<br>sudo upx --best /usr/lib/firefox/firefox<br>Tweak about:config set following recommended values for 1.5mb connection<br>network.http.pipelining                             true    Enable pipelining for normal connections<br>network.http.proxy.pipelining                       true    Enable pipelining for proxy connections<br>Configure Firefox to use ram only cache<br>open about:config in the address bar<br>set browser.cache.disk.enable to "false" (double click the line)<br>set browser.cache.memory.enable to "true" (double click the line)<br>set browser.cache.memory.max_entry_size to the amount of KB you'd like to spare, to -1 for automatic cache size selection<br><br>#if you need power savings on battery [More at https://wiki.archlinux.org/index.php/TLP]<br>yaourt tlp-rdw<br>sudo systemctl enable tlp<br>sudo systemctl enable tlp-sleep<br>sudo systemctl enable NetworkManager-dispatcher<br>The default configuration /etc/default/tlp provides optimized power saving out of the box.<br>sudo cp  /etc/default/tlp  /etc/default/tlp.bak<br>sudo vim  /etc/default/tlp and change following:<br>DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"<br>DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan lan"<br>DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi lan"<br>DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi"<br>DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="lan"<br>DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""<br><br>#virtualbox<br>-installation<br>sudo pacman -S virtualbox virtualbox-host-modules qt4 virtualbox-guest-iso<br>-to load the kernal module manually<br>sudo modprobe vboxdrv<br>-to load the module at boot time add following virtualbox.conf under /etc/modules-load.d<br>#/etc/modules-load.d/virtualbox.conf<br>#load the virtualbox kernel module<br>vboxdrv<br>-to use usb ports of your host machines<br>sudo gpasswd -a $USER vboxusers<br>-once the virtualbox gui is up and running download and install the extention pack if needed.<br><br>#Copying backup from another *nix, use rsync<br>-Below command copies from current directory . to the remote directory via assh<br>rsync -auzve ssh .  bhupendra@archtv:/export/home/bhupendra/tmp/<br>-Below command copies all files and folders from the remote tmp directory in current directory<br>rsync -auzve ssh bhupendra@archtv:/export/home/bhupendra/tmp/ .<br>-Below does the same however it also creates the tmp directory in current directory if it does not exit<br>rsync -auzve ssh bhupendra@archtv:/export/home/bhupendra/tmp .<br>v verbose<br>z compress<br>u skip files that are newer on reciever<br>e specify the remote shell to use<br>a archive mode; equals -rlptgoD (no -H,-A,-X)<br>r recursive into directories<br>l copy symlinks as symlinks<br>p preserve permissions<br>t preserve modification times<br>g preserve group<br>o preserve owner (super user only)<br>D same as --devices --specials<br>--devices This option causes rsync to transfer character and block  device<br>              files  to  the  remote  system  to recreate these devices.  This<br>              option has no effect if the receiving rsync is not  run  as  the<br>              super-user <br>--specials This option causes rsync to transfer special files such as named<br>              sockets and fifos.<br>--delete-during deletes files on reciever side if they do not exist anymore during transfers<br><br>-So to backup usual home folders from my laptop having host archoffice over the network to archtv here is what I do<br>rsync --delete-during --ignore-errors -auzve ssh /home/bhupendra/DEV/ bhupendra@archtv:/home/bhupendra/DEV<br>rsync --delete-during --ignore-errors -auzve ssh /home/bhupendra/Documents/ bhupendra@archtv:/home/bhupendra/Documents<br>rsync --delete-during --ignore-errors -auzve ssh /home/bhupendra/Music/ bhupendra@archtv:/home/bhupendra/Music<br>rsync --delete-during --ignore-errors -auzve ssh /home/bhupendra/Pictures/ bhupendra@archtv:/home/bhupendra/Pictures<br>rsync --delete-during --ignore-errors -auzve ssh /home/bhupendra/scripts/ bhupendra@archtv:/home/bhupendra/scripts<br>rsync --delete-during --ignore-errors -auzve ssh /home/bhupendra/Videos/ bhupendra@archtv:/run/media/bhupendra/NTFS297GB/<br>Note that in the last rsync, I want to move videos to connected external hdd instead of Videos folder under home directory.<br><br>-Since we have to enter password anytime we want to run the remote rsync, time we avoid that by auto ssh logins without password<br>[More at https://wiki.archlinux.org/index.php/SSH_Keys]<br>I have 2 laptops running arch, having hostnames archtv and archoffice.<br>This is that I did on archoffice<br>ssh-keygen -t rsa -C "$(whoami)@$(hostname)-$(date -I)"<br>hit enter for all options it provided, ie. save key to .ssh/id_rsa, do not enter passphrase else we will have to enter it each time we ssh<br>This generates private key at ~/.ssh/id_rsa and public key at ~/.ssh/id_rsa.pub<br>Now, copy the public key to archtv<br>ssh-copy-id bhupendra@archtv<br>This copies the key to ~/.ssh/authorized_keys<br>Now you can ssh from archoffice to archtv without password<br>Followed same process on archtv so that archtv can connect to archoffice without passwords.<br>Now the above rsync commands will not ask for passwords<br><br>-Time to create shell script which combines all my rsync commands<br>vim ~/scripts/syncbackup.sh<br>#!/bin/bash<br>/usr/bin/rsync --delete-during --ignore-errors -auzve /usr/bin/ssh /home/bhupendra/DEV/ bhupendra@archtv:/home/bhupendra/DEV <br>/usr/bin/rsync --delete-during --ignore-errors -auzve /usr/bin/ssh /home/bhupendra/Documents/ bhupendra@archtv:/home/bhupendra/Documents<br>/usr/bin/rsync --delete-during --ignore-errors -auzve /usr/bin/ssh /home/bhupendra/Music/ bhupendra@archtv:/home/bhupendra/Music<br>/usr/bin/rsync --delete-during --ignore-errors -auzve /usr/bin/ssh /home/bhupendra/Pictures/ bhupendra@archtv:/home/bhupendra/Pictures<br>/usr/bin/rsync --delete-during --ignore-errors -auzve /usr/bin/ssh /home/bhupendra/scripts/ bhupendra@archtv:/home/bhupendra/scripts<br>/usr/bin/rsync --ignore-errors -auzve /usr/bin/ssh /home/bhupendra/Videos/ bhupendra@archtv:/run/media/bhupendra/NTFS297GB/<br><br>chmod 775 ~/scripts/syncbackup.sh<br>sudo ln -s /home/bhupendra/scripts/syncbackup.sh /usr/bin/syncbackup<br><br>-Now lets invoke the script when wireless network gets connected to ssid kitty.<br>sudo vim /etc/NetworkManager/dispatcher.d/01-syncbackup<br>#!/bin/sh<br><br>ssid="kitty"<br>interface=$1<br>status=$2<br><br>if [ "$interface" = "wlo1" -a "$status" = "up" ]; then<br>        if nmcli con status id $ssid | grep -qs activated; then<br>                syncbackup > /var/log/rsync/$(date +%Y-%m-%d-%H-%M-%S).log 2>&1<br>        fi<br>fi<br><br>sudo chmod 755 /etc/NetworkManager/dispatcher.d/01-syncbackup<br>sudo mkdir /var/log/rsync<br>sudo chown bhupendra:users /var/log/rsync<br><br>-google drive support<br>yaourt insync<br>run insync<br>login to google account<br>name your drive folder as: bhupendra.atre@gmail.com<br>put google drive folder at: /home/bhupendra/googledrive<br>Insync was starting automatically on reboot, and I did not see any systemd service or any entry in lxde autostart<br>then I created following symlink folder to sync my Documents folder<br>cd /home/bhupendra/googledrive/bhupendra.atre@gmail.com<br>ln -s /home/bhupendra/Documents Documents<br><br>---------------------------------------------------------------------------------------------------<br>#Changes for archtv<br>I have another arch laptop connected to my 47' led tv. Since we want larger fonts here are the steps I took<br>---------------------------------------------------------------------------------------------------<br>-disable latop display and enable tv display<br>sudo vim /etc/xdg/lxsession/LXDE/autostart and add following<br>@tvonly<br>-disbale suspend on lid close<br>sudo vim /etc/systemd/logind.conf<br>HandleSuspendKey=ignore<br>HandleHibernateKey=ignore<br>HandleLidSwitch=ignore<br>-in firefox add plugin noSquint to auto zoom pages on hdtv resolution. In global settings change the default zoom to 170%.<br>-default font increase<br>open lxappearance<br>under widget, adwaita, change default font to sams 18 instead of sams 10<br>under window border, title bar, change sans bold 10 to 18.<br>-open panel preferences on lxpanel,<br>under appearance, select font size and set it to 18<br>under geometry, change height to 44 pixel instead of 26 and icon size to 42 instead of 24.<br>-under lxterminal change default font size from monospace 10 to 18.<br>-under leafpad change default font size to 18.<br>-under pcmanfm preferences, display section, change following:<br>size of big icons 96x96 [default 48x48]<br>size of small icons 48x48 [default 24x24]<br>size of thumbnails 256x256 [default 128x128]<br>size of side pane icons 48x48 [default 24x24]<br>-in ~/.conkyrc change the font size from 10 to 18<br><br></p> <p> <!--data-blogger-escaped-<title>Currently://' | sed 's/C<\/title>/C/' | sed 's/^[ \t\n]*//'}<br>$hr<br>${color darkgrey}RAM:$color  ${membar 4,100} $memperc%  $memmax/$mem<br>${color darkgrey}SWAP:$color ${swapbar 4,100} $swapperc% $swapmax/$swap<br>${color darkgrey}FS:$color   ${fs_bar 4,100 /} ${fs_used_perc /}%  ${fs_used /}/${fs_size /}<br>$hr<br>${color darkgrey}CPU1 Usage:$color  ${cpubar cpu1 4,200} ${cpu cpu1}%<br>${color darkgrey}CPU2 Usage:$color  ${cpubar cpu2 4,200} ${cpu cpu2}%<br>${color darkgrey}CPU3 Usage:$color  ${cpubar cpu3 4,200} ${cpu cpu3}%<br>${color darkgrey}CPU4 Usage:$color  ${cpubar cpu4 4,200} ${cpu cpu4}%<br>$hr<br>${color grey}File systems:<br> / $color${fs_used /}/${fs_size /} ${fs_bar 6 /}<br>${color grey}Networking:<br>Up:$color ${upspeed eth0} ${color grey} - Down:$color ${downspeed eth0}<br>$hr<br>${color darkgrey}Wireless Networking:<br>Up:$color ${upspeed wlo1} ${color darkgrey} - Down:$color ${downspeed wlo1}<br>${color darkgrey}Wired Networking:<br>Up:$color ${upspeed enp0s25} ${color grey} - Down:$color ${downspeed enp0s25}<br>$hr<br>${color darkgrey}Name              PID    CPU%   MEM% $color<br>${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}<br>${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}<br>${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}<br>${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}<br>${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5}<br><br>sudo vim /etc/xdg/lxsession/LXDE/autostart and add following to autostart conky<br>@conky<br><br>If you find that the minimum_size and maximum_height or maximum_width are not being obeyed by conky, then comment out own_window_type and own_window_hints, let conly reload, then add those back again. Courtsey [https://bbs.archlinux.org/viewtopic.php?pid=1037806#p1037806]<br><br>#xrandr scripts<br>sudo pacman -S arandr<br>arandr is good to switch off one monitor and use another. In my case when I take laptop to office, I have 2 external monitors for which below scripts helps<br>cd ~/scripts<br><br>vim singlemonitor.sh<br>#!/bin/sh<br>xrandr --output DP3 --off --output DP2 --off --output DP1 --off --output HDMI3 --off --output HDMI2 --off --output HDMI1 --off --output LVDS1 --off --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal<br>xrandr --output DP3 --off --output DP2 --off --output DP1 --off --output HDMI3 --off --output HDMI2 --off --output HDMI1 --off --output LVDS1 --mode 1366x768 --pos 0x0 --rotate normal --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal<br>xrandr --output DP3 --off --output DP2 --off --output DP1 --off --output HDMI3 --off --output HDMI2 --off --output HDMI1 --off --output LVDS1 --mode 1366x768 --pos 0x0 --rotate normal --output VGA1 --off<br>xbacklight -set 100<br>pkill conky<br>conky 2> /dev/null &<br><br>vim dualmonitor.sh<br>#!/bin/sh<br>xrandr --output DP3 --off --output DP2 --off --output DP1 --off --output HDMI3 --off --output HDMI2 --off --output HDMI1 --off --output LVDS1 --mode 1366x768 --pos 0x0 --rotate normal --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal<br>xrandr --output DP3 --off --output DP2 --off --output DP1 --off --output HDMI3 --off --output HDMI2 --off --output HDMI1 --off --output LVDS1 --off --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal<br>xrandr --output DP3 --off --output DP2 --off --output DP1 --off --output HDMI3 --off --output HDMI2 --mode 1280x1024 --pos 1280x0 --rotate normal --output HDMI1 --off --output LVDS1 --off --output VGA1 --mode 1280x1024 --pos 0x0 --rotate normal<br>pkill conky<br>conky 2> /dev/null &<br><br>vim tvonly.sh<br>#!/bin/sh<br>xrandr --output HDMI-0 --off --output LVDS --off --output DVI-0 --off --output VGA-0 --mode 1920x1080 --pos 0x0 --rotate normal<br>pkill conky<br>conky 2> /dev/null &<br><br>chmod 775 *.sh<br><br>To invoke the scripts from run command add symlinks to /usr/local/bin<br>cd /usr/local/bin<br>sudo ln -s /home/bhupendra/scripts/dualmonitor.sh dualmonitor<br>sudo ln -s /home/bhupendra/scripts/singlemonitor.sh singlemonitor<br>sudo ln -s /home/bhupendra/scripts/tvonly.sh tvonly<br><br>#finding key bindings<br>Use xev command to find out the key values. More info at openbox.org/wiki/Help:Bindings however note that LXDE users should follow these instructions to edit the file ~/.config/openbox/lxde-rc.xml and not the ~/.config/openbox/rc.xml<br>#Adding custom key events<br>In ~/.config/openbox/lxde-rc.xml inside the <keyboard> element add the following:<br><!-- Keybinding for volume Keys --><br>   <keybind key="XF86AudioLowerVolume"><br>     <action name="Execute"><br>       <startupnotify><br>         <enabled>true</enabled><br>         <name>amixer</name><br>       </startupnotify><br>       <command>amixer -c 0 set Master 5- unmute</command><br>     </action><br>   </keybind><br>   <keybind key="XF86AudioRaiseVolume"><br>     <action name="Execute"><br>       <startupnotify><br>         <enabled>true</enabled><br>         <name>amixer</name><br>       </startupnotify><br>       <command>amixer -c 0 set Master 5+ unmute</command><br>     </action><br>   </keybind><br>   <keybind key="XF86AudioMute"><br>     <action name="Execute"><br>       <startupnotify><br>         <enabled>true</enabled><br>         <name>amixer</name><br>       </startupnotify><br>       <command>amixer -D pulse set Master 1+ toggle</command><br>     </action><br>   </keybind><br>   <keybind key="XF86HomePage"><br>     <action name="Execute"><br>       <startupnotify><br>         <enabled>true</enabled><br>         <name>firefox</name><br>       </startupnotify><br>       <command>firefox</command><br>     </action><br>   </keybind><br><!-- Keybinding for PrintScreen Key --><br>    <keybind key="Print"><br>      <action name="Execute"><br>       <execute>scrot -e 'mv $f ~/Downloads/'</execute><br>      </action><br>    </keybind><br>     <keybind key="A-Print"><br>      <action name="Execute"><br>       <execute>scrot -b -s -e 'mv $f ~/Downloads/'</execute><br>      </action><br>    </keybind><br>run openbox --reconfigure<br><br>#Hardware check<br>uname -a<br>cat /proc/cpuinfo<br>cat /proc/meminfo<br>cat /proc/partitions<br>lspci -v | grep VGA<br><br>sudo pacman -S dmidecode hdparm<br>sudo dmidecode --type memory   <br>hdparm -I /dev/sda             <br>          <br>One can also install lshw and view html for hw info<br>sudo pacman -S lshw<br>sudo lshw -html >> lshw.html<br>firefox lshw.html<br><br>#make arch faster<br>-For ssd<br>sudo vim /etc/fstab and add discard option to /dev/sda1. The file then looks something like below<br>#<br># /etc/fstab: static file system information<br>#<br># <file system> <dir>   <type>  <options>   <dump>  <pass><br># /dev/sda1<br>UUID=3e6fd4bb-6a0d-425a-81dd-fd3abbb37f96   /           ext4        rw,relatime,data=ordered,discard    0 1<br>/dev/sda2 none swap defaults,discard 0 0<br>-play around with linux swapiness and vfs_cache_pressure<br>To check the currently set values (60 and 100 respectively)<br>sysctl -n vm.swappiness<br>sysctl -n vm.vfs_cache_pressure<br>setting value for session<br>sudo sysctl -w vm.swappiness=20<br>sudo sysctl -w vm.vfs_cache_pressure=50<br>permanently setting value, add following in /etc/sysctl.conf<br>vm.swappiness=20<br>vm.vfs_cache_pressure=50<br>-install preload<br>yaourt preload<br>sudo systemctl enable preload<br>sudo systemctl start preload<br>-install prelink<br>sudo pacman -S prelink<br>Note: Some proprietary binaries will crash with prelink (such as Flash, Skype, Nvidia proprietary driver).<br>You can add these to the exclude list in /etc/prelink.conf as in https://wiki.archlinux.org/index.php/Talk:Prelink<br>prelink all the binaries in the directories given by /etc/prelink.conf run following<br>prelink -amR<br>Removing prelinking from all binaries run following<br>prelink -au<br>Add prelink to daily cron job in order to get benefits from updates<br>sudo vim /etc/cron.daily/prelink.cron and add follwowing:<br>#!/bin/bash<br>[[ -x /usr/sbin/prelink ]] && /usr/sbin/prelink -amR &>/dev/null<br>sudo chmod 755 /etc/cron.daily/prelink.cron<br>sudo systemctl enable cronie<br>sudo systemctl start cronie<br>-improve boot times<br>enable readahead<br>sudo systemctl enable systemd-readahead-collect systemd-readahead-replay<br>sudo vim /etc/default/grub and change GRUB_TIMEOUT=1 for quicker booting<br>sudo grub-mkconfig -o /boot/grub/grub.cfg<br>-improve firefox performance<br>Reduce load time by compressing the Firefox binary with UPX<br>sudo pacman -S upx<br>sudo cp /usr/lib/firefox/firefox /usr/lib/firefox/firefox.backup<br>sudo upx --best /usr/lib/firefox/firefox<br>Tweak about:config set following recommended values for 1.5mb connection<br>network.http.pipelining                             true    Enable pipelining for normal connections<br>network.http.proxy.pipelining                       true    Enable pipelining for proxy connections<br>Configure Firefox to use ram only cache<br>open about:config in the address bar<br>set browser.cache.disk.enable to "false" (double click the line)<br>set browser.cache.memory.enable to "true" (double click the line)<br>set browser.cache.memory.max_entry_size to the amount of KB you'd like to spare, to -1 for automatic cache size selection<br><br>#if you need power savings on battery [More at https://wiki.archlinux.org/index.php/TLP]<br>yaourt tlp-rdw<br>sudo systemctl enable tlp<br>sudo systemctl enable tlp-sleep<br>sudo systemctl enable NetworkManager-dispatcher<br>The default configuration /etc/default/tlp provides optimized power saving out of the box.<br>sudo cp  /etc/default/tlp  /etc/default/tlp.bak<br>sudo vim  /etc/default/tlp and change following:<br>DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"<br>DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan lan"<br>DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi lan"<br>DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi"<br>DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="lan"<br>DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""<br><br>#virtualbox<br>-installation<br>sudo pacman -S virtualbox virtualbox-host-modules qt4 virtualbox-guest-iso<br>-to load the kernal module manually<br>sudo modprobe vboxdrv<br>-to load the module at boot time add following virtualbox.conf under /etc/modules-load.d<br>#/etc/modules-load.d/virtualbox.conf<br>#load the virtualbox kernel module<br>vboxdrv<br>-to use usb ports of your host machines<br>sudo gpasswd -a $USER vboxusers<br>-once the virtualbox gui is up and running download and install the extention pack if needed.<br><br>#Copying backup from another *nix, use rsync<br>-Below command copies from current directory . to the remote directory via assh<br>rsync -auzve ssh .  bhupendra@archtv:/export/home/bhupendra/tmp/<br>-Below command copies all files and folders from the remote tmp directory in current directory<br>rsync -auzve ssh bhupendra@archtv:/export/home/bhupendra/tmp/ .<br>-Below does the same however it also creates the tmp directory in current directory if it does not exit<br>rsync -auzve ssh bhupendra@archtv:/export/home/bhupendra/tmp .<br>v verbose<br>z compress<br>u skip files that are newer on reciever<br>e specify the remote shell to use<br>a archive mode; equals -rlptgoD (no -H,-A,-X)<br>r recursive into directories<br>l copy symlinks as symlinks<br>p preserve permissions<br>t preserve modification times<br>g preserve group<br>o preserve owner (super user only)<br>D same as --devices --specials<br>--devices This option causes rsync to transfer character and block  device<br>              files  to  the  remote  system  to recreate these devices.  This<br>              option has no effect if the receiving rsync is not  run  as  the<br>              super-user <br>--specials This option causes rsync to transfer special files such as named<br>              sockets and fifos.<br>--delete-during deletes files on reciever side if they do not exist anymore during transfers<br><br>-So to backup usual home folders from my laptop having host archoffice over the network to archtv here is what I do<br>rsync --delete-during --ignore-errors -auzve ssh /home/bhupendra/DEV/ bhupendra@archtv:/home/bhupendra/DEV<br>rsync --delete-during --ignore-errors -auzve ssh /home/bhupendra/Documents/ bhupendra@archtv:/home/bhupendra/Documents<br>rsync --delete-during --ignore-errors -auzve ssh /home/bhupendra/Music/ bhupendra@archtv:/home/bhupendra/Music<br>rsync --delete-during --ignore-errors -auzve ssh /home/bhupendra/Pictures/ bhupendra@archtv:/home/bhupendra/Pictures<br>rsync --delete-during --ignore-errors -auzve ssh /home/bhupendra/scripts/ bhupendra@archtv:/home/bhupendra/scripts<br>rsync --delete-during --ignore-errors -auzve ssh /home/bhupendra/Videos/ bhupendra@archtv:/run/media/bhupendra/NTFS297GB/<br>Note that in the last rsync, I want to move videos to connected external hdd instead of Videos folder under home directory.<br><br>-Since we have to enter password anytime we want to run the remote rsync, time we avoid that by auto ssh logins without password<br>[More at https://wiki.archlinux.org/index.php/SSH_Keys]<br>I have 2 laptops running arch, having hostnames archtv and archoffice.<br>This is that I did on archoffice<br>ssh-keygen -t rsa -C "$(whoami)@$(hostname)-$(date -I)"<br>hit enter for all options it provided, ie. save key to .ssh/id_rsa, do not enter passphrase else we will have to enter it each time we ssh<br>This generates private key at ~/.ssh/id_rsa and public key at ~/.ssh/id_rsa.pub<br>Now, copy the public key to archtv<br>ssh-copy-id bhupendra@archtv<br>This copies the key to ~/.ssh/authorized_keys<br>Now you can ssh from archoffice to archtv without password<br>Followed same process on archtv so that archtv can connect to archoffice without passwords.<br>Now the above rsync commands will not ask for passwords<br><br>-Time to create shell script which combines all my rsync commands<br>vim ~/scripts/syncbackup.sh<br>#!/bin/bash<br>/usr/bin/rsync --delete-during --ignore-errors -auzve /usr/bin/ssh /home/bhupendra/DEV/ bhupendra@archtv:/home/bhupendra/DEV <br>/usr/bin/rsync --delete-during --ignore-errors -auzve /usr/bin/ssh /home/bhupendra/Documents/ bhupendra@archtv:/home/bhupendra/Documents<br>/usr/bin/rsync --delete-during --ignore-errors -auzve /usr/bin/ssh /home/bhupendra/Music/ bhupendra@archtv:/home/bhupendra/Music<br>/usr/bin/rsync --delete-during --ignore-errors -auzve /usr/bin/ssh /home/bhupendra/Pictures/ bhupendra@archtv:/home/bhupendra/Pictures<br>/usr/bin/rsync --delete-during --ignore-errors -auzve /usr/bin/ssh /home/bhupendra/scripts/ bhupendra@archtv:/home/bhupendra/scripts<br>/usr/bin/rsync --ignore-errors -auzve /usr/bin/ssh /home/bhupendra/Videos/ bhupendra@archtv:/run/media/bhupendra/NTFS297GB/<br><br>chmod 775 ~/scripts/syncbackup.sh<br>sudo ln -s /home/bhupendra/scripts/syncbackup.sh /usr/bin/syncbackup<br><br>-Now lets invoke the script when wireless network gets connected to ssid kitty.<br>sudo vim /etc/NetworkManager/dispatcher.d/01-syncbackup<br>#!/bin/sh<br><br>ssid="kitty"<br>interface=$1<br>status=$2<br><br>if [ "$interface" = "wlo1" -a "$status" = "up" ]; then<br>        if nmcli con status id $ssid | grep -qs activated; then<br>                syncbackup > /var/log/rsync/$(date +%Y-%m-%d-%H-%M-%S).log 2>&1<br>        fi<br>fi<br><br>sudo chmod 755 /etc/NetworkManager/dispatcher.d/01-syncbackup<br>sudo mkdir /var/log/rsync<br>sudo chown bhupendra:users /var/log/rsync<br><br>-google drive support<br>yaourt insync<br>run insync<br>login to google account<br>name your drive folder as: bhupendra.atre@gmail.com<br>put google drive folder at: /home/bhupendra/googledrive<br>Insync was starting automatically on reboot, and I did not see any systemd service or any entry in lxde autostart<br>then I created following symlink folder to sync my Documents folder<br>cd /home/bhupendra/googledrive/bhupendra.atre@gmail.com<br>ln -s /home/bhupendra/Documents Documents<br><br>---------------------------------------------------------------------------------------------------<br>#Changes for archtv<br>I have another arch laptop connected to my 47' led tv. Since we want larger fonts here are the steps I took<br>---------------------------------------------------------------------------------------------------<br>-disable latop display and enable tv display<br>sudo vim /etc/xdg/lxsession/LXDE/autostart and add following<br>@tvonly<br>-disbale suspend on lid close<br>sudo vim /etc/systemd/logind.conf<br>HandleSuspendKey=ignore<br>HandleHibernateKey=ignore<br>HandleLidSwitch=ignore<br>-in firefox add plugin noSquint to auto zoom pages on hdtv resolution. In global settings change the default zoom to 170%.<br>-default font increase<br>open lxappearance<br>under widget, adwaita, change default font to sams 18 instead of sams 10<br>under window border, title bar, change sans bold 10 to 18.<br>-open panel preferences on lxpanel,<br>under appearance, select font size and set it to 18<br>under geometry, change height to 44 pixel instead of 26 and icon size to 42 instead of 24.<br>-under lxterminal change default font size from monospace 10 to 18.<br>-under leafpad change default font size to 18.<br>-under pcmanfm preferences, display section, change following:<br>size of big icons 96x96 [default 48x48]<br>size of small icons 48x48 [default 24x24]<br>size of thumbnails 256x256 [default 128x128]<br>size of side pane icons 48x48 [default 24x24]<br>-in ~/.conkyrc change the font size from 10 to 18</p> <p> <br></p> </div> -->

Saturday, July 7, 2012

My personal Fedora 17 LXDE installation


Thanks to Fedora and many more users on other blogs/forums whose efforts helped me setup up Fedora 17 lxde on my home laptop and office laptop for regular use.

#installation
-unchecked use lvm and check review and modify partitioning layout
-set correct swap space, too much is waste anyways
-delete /home partition and merge space onto /
-Personally I would keep /home on the extended partition but this layout helps me reclaim the available space for partitions easily
-If dual booting with windows make sure you do not overwrite mbr and select first sector of sda2 or which ever partition has the /boot
-I also use http://gag.sourceforge.net/  to dual boot my windows 7 and fedora on my office laptop.

#setup sudo, update system and reboot
su
echo 'bhupendra ALL=(ALL) ALL' >> /etc/sudoers
exit
sudo yum update

#if getting error at boot 'cannot open Front File True'
http://forums.fedoraforum.org/showpost.php?p=1582163&postcount=7

#if you are in virtualbox vm, do following to install guest additions
sudo yum install kernel-devel kernel-headers dkms gcc gcc-c++
mount guest additions if not already mounted
cd /run/media/bhupendra/VBOXADDITIONS_*
sudo ./VBoxLinuxAdditions.run
reboot

#desktop changes
-Moved bottom panel to top, change background appearance to solid #000000 color with 30 opacity
-second panel to left for quick launch items again solid #000000 color with 30 opacity and width 26px, height 97%, alighnment bottom, edge left
-right click desktop preferences, wallpaper mode -> fill with background color only. Set background color to black
-disable screensaver or set to xmatrix, change to small fonts
-set custom color white to top panel and change date format on digital clock to %m/%d %r
-just in case you want to change the default background for login screen is controlled by symlink
default.png -> ./verne/default/standard/verne.png under /usr/share/backgrounds
Say we downloaded simple_linux.png under /usr/share/backgrounds/images and change the symlink to point to the downloaded image
sudo ln -sf /usr/share/backgrounds/images/simple_linux.png default.png
-If Tools > "Open Current Folder as Root" command gives an error, you probably need to enter a change similar to this one:
sudo yum install beesu
Then, PCManFM > Edit > Preferences > Advanced and in the the "Switch user command" field add the command "beesu %s" (without quotes).
-Enable left clicks and scrolling on mousepad
I added following lines to /usr/share/X11/xorg.conf.d/50-synaptics.conf. If you do not have this file, check which conf file is present under /usr/share/X11/xorg.conf.d
    Option "TapButton1" "1"
    Option "HorizEdgeScroll" "1"
    Option "VertEdgeScroll" "1"
Here is an interesting page to test scrolling: http://www.richinstyle.com/test/dynamic/overflowscroll.html
Reboot system.

#Make linux faster
-Preload - adaptive readahead daemon
sudo yum install preload
ensure it's running
sudo systemctl enable preload.service
sudo systemctl start preload.service
-On Fedora 16 lxde I also tried changing vm swappiness but held of from doing it here since I felt io operations were slower when I reduced the value.

#App installations
-skype
sudo yum -y install libXv.i686 libXScrnSaver.i686 qt.i686 qt-x11.i686 pulseaudio-libs.i686 pulseaudio-libs-glib2.i686 alsa-plugins-pulseaudio.i686
sudo yum install http://download.skype.com/linux/skype-4.0.0.7-fedora.i586.rpm
Based on test call, my mic was not correctly working.
Opened up pulse audio volume mixer, undere recording tab, show all streams, then gave test skype call.
Once the recording showed an entry I changed the option to Quickcam

-adobe flash 11 64bit
sudo yum install http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
sudo yum install flash-plugin

-office suite
removed exsting F17lxde office apps and install libreoffice
sudo yum remove abiword gnumeric osmo
sudo yum install libreoffice planner

-Firefox comes as default
Add fastdial to firefox and import bookmarks. Change default page startup to blank
Adblock plus
Awesome screenshot
downloadhelper
firebug
firecookie
fireftp
greasemonkey
jsview
live http headers
modify headers
measureit
poster
wsj/bol smartfox
UserAgent Switcher. Download xml file from http://techpatterns.com/forums/about304.html and import via addon via options.

-google chrome and voice chat
download rpm from https://www.google.com/chrome for chrome
download rpm from ls for google voice and video chat
sudo yum install lsb [required for chrome]
sudo rpm -Uvh google-*.rpm

-pdf viewer
lxde f17 comes preinstalled with epdfview, however it cannot enter fillable pdf forms
for editing pdfs, nothing beats pdfedit unfortunatly it's not in repo since F16
For now, I am staying with epdfview and mozplugger to view pdfs in firefox
sudo yum install epdfview mozplugger

-disk usage analyser
sudo yum install baobab

-rpm fusion repos for third party softwares
sudo yum install http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
sudo yum install http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
sudo yum update

-audio and video requirements
Since I use audacious and vlc for all my video/audio needs, I removed others and installed these
sudo yum remove asunder lxmusic gxine
sudo yum install mozilla-vlc vlc vlc-extras ffmpeg audacious audacious-plugins*

-conky
sudo yum install conky
To add any applications to autostart read http://wiki.lxde.org/en/LXSession#autostart. I have added conky to autostart.
sudo vi /etc/xdg/lxsession/LXDE/autostart
Add follwing
@conky

-Enable ssh
sudo systemctl enable sshd.service
sudo systemctl start sshd.service
Ensure firewall has port opened for 22, and enable port forwarding on wireless router
I found weird bug in Fedora 17. After doing aove changes, I was still not able to ssh to fedora 17 laptop. I had to uncheck apply and check apply again and reload rule for ssh in firewall.

-install 7zip
sudo yum install p7zip
To extract file use
7za e filename.7z
To create 7zip archive use
7za a filename.7z directoryWithFilesToCompress/

-image manipulation
lxde comes with mtpaint, which is ok but nothing beats gimp
sudo yum remove mtpaint
sudo yum install gimp
open gimp, under windows, there is option for single window mode

-printer
sudo yum install hplip hplip-gui
run following on command prompt or go to application menu -> administration -> hp device manager
hp-setup
During printer configuration, use ip to configure [192.168.0.6] and enter username/password for root.
For any other printer config like xerox, cannon etc. OR for most hp printer including hp estation
directly open printing menu, find netwrok printers and add them.

-scan to pdf if required
sudo yum install gscan2pdf

-picasa alternative
gone are the days for picasa on linux. I usually upload pics directly to picasa web. Alternatively shotwell is nice with photo editing features like red eye removal
sudo yum update shotwell
Anyways I did not install it this time around.

-finding key bindings
Use xev command to find out the key values
On hp elitebook 8440p
keycode 121 = XF86AudioMute
keycode 122 = XF86AudioLowerVolume
keycode 123 = XF86AudioRaiseVolume
keycode 171 = XF86AudioNext
Keycode 172 = XF86AudioPlay
Keycode 173 = XF86AudioPrev
Keycode 174 = XF86AudioStop
Keycode 163 = XXF86Mail
Keycode 107 = Print
keycode 232 = XF86MonBrightnessDown
keycode 233 = XF86MonBrightnessUp
keycode 150 = XF86Sleep
keycode 133 = Super_L
keycode 244 = XF86Battery
keycode 201 = XF86TouchpadOff

-volume key buttons
In ~/.config/openbox/lxde-rc.xml inside the <keyboard> element add the following
   <keybind key="XF86AudioLowerVolume">
     <action name="Execute">
       <startupnotify>
         <enabled>true</enabled>
         <name>amixer</name>
       </startupnotify>
       <command>amixer -c 0 set Master 5- unmute</command>
     </action>
   </keybind>
   <keybind key="XF86AudioRaiseVolume">
     <action name="Execute">
       <startupnotify>
         <enabled>true</enabled>
         <name>amixer</name>
       </startupnotify>
       <command>amixer -c 0 set Master 5+ unmute</command>
     </action>
   </keybind>
   <keybind key="XF86AudioMute">
     <action name="Execute">
       <startupnotify>
         <enabled>true</enabled>
         <name>amixer</name>
       </startupnotify>
       <command>amixer set Master toggle</command>
     </action>
   </keybind>
Re-login, reboot or just run openbox --reconfigure for above changes to be in effect.  

-print screen on linux
On terminal, run following, and click mouse on the screen whose image needs to be captured
xwd > myimage.xwd
To view the captured screen image run following or open with display, gimp, xv etc.
xwud -in myimage.xwd
Another option is to use gimp which has screenshot option
sudo yum install gimp
Goto file -> create ->screenshot
All this was great on comman promt but what about the print key?
Install scrot
sudo yum install scrot
Add following to inn ~/.config/openbox/lxde-rc.xml under keyboard
<!-- Keybinding for PrintScreen Key -->
    <keybind key="Print">
      <action name="Execute">
       <execute>scrot -e 'mv $f ~/Desktop/'</execute>
      </action>
    </keybind>

    <keybind key="A-Print">
      <action name="Execute">
       <execute>scrot -b -s -e 'mv $f ~/Desktop/'</execute>
      </action>
    </keybind>
Re-login or reboot and alt+printscreen allows you to select area to capture while printscreen captures whole page
On my laptop printscreen button was shared with insert key and had to be invoked using fn+insert/prt sc
Now there will be times when we want to take screenshot of pull down menu or something, in that case we need deplay

-dual monitor setups
LXDE ships with lxrandr which has limited functionality for xrandr, so most of the time we have to get hands dirty with xrandr as below:
get list of connected display with their supported resolution
xrandr
To attach 2nd monitor
xrandr --output VGA-1 --auto --right-of eDP-1
To remove 2nd monitor
xrandr --output VGA-1 --off
[More simplified details at http://blog.bodhizazen.net/linux/use-xrandr-to-set-a-screen-resolution/]
Alternatively, we can download and run arandr which is more complete but less intuitive gui for xrandr
cd ~
wget https://launchpad.net/arandr/release/0.1.6/+download/arandr-0.1.6.tar.gz [download latest one from https://launchpad.net/arandr]
tar xzf arandr-0.1.6.tar.gz
chmod 775 arandr-0.1.6
rm -rf arandr-0.1.6.tar.gz
One could create a menu item for this, but I just added keyboard shortcut for convinience
Add following to in ~/.config/openbox/lxde-rc.xml under keyboard
    <keybind key="C-F12">
      <action name="Execute">
        <execute>~/arandr-0.1.6/arandr</execute>
      </action>
    </keybind>
Reboot or relogin or openbox --reconfigure and hit ctrl+F12 keys

-Remmina - gtk+ app for rdp/nx/vnc/xdmcp/ssh
sudo yum install remminia remmina-plugins*
Once opened, it docks to tray. To disable that edit->preferences->applet->disable tray icon

-virtualbox
Download repo from virtualbox site into /etc/yum.repos.d/
cd /etc/yum.repos.d/
sudo wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
sudo yum install dkms kernel-headers gcc
sudo yum install VirtualBox-4.1
Add your user to vboxusers group
sudo service vboxdrv setup
Download and install extention pack

-configure wireless nw using certificates for office
check 'connect automatically'
ssid=djmcn
security=WPA & WPA2 Enterprise
Authentication=TLS
identity=username
user certificate=username-b64.cer
CA certificate=certname.cer
private key=username.pem
Private key password=passwordhere
http://www.sslshopper.com/article-most-common-openssl-commands.html

-import certificates to firefox
-Firefox promts to import certificate when clicked to save it in it's store.
-google chrome does not have it's own certificate store unlike firefox. On windows it uses windows store etc.
For more details http://code.google.com/p/chromium/wiki/LinuxCertManagement
yum install nss-tools
As for me, I download all the certificates to load using chrome
cd ~
certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n certname -i pathtocertfile/certname.crt

-configure cisco vpn to office
sudo yum install vpnc NetworkManager-vpnc
Now configure vpn using network manager applet

-outlook alternative -> thunderbird
sudo yum remove sylpheed [comes default with lxde]
sudo yum install thunderbird thunderbird-lightning
>>CONFIGURE MAIL [if mail.dowjones.net does not work, try outlooksbk.win.dowjones.net ]
incoming: IMAP mail.dowjones.net 143 STARTTLS normal password
outgoing: SMTP mail.dowjones.net 587 STARTTLS normal password
username: atreb [if this does not work try DJNAMERICAS/atreb]
>>Install addons
ImportExportTools
Exchange 2007/2010 Calendar and Tasks Provider
slideshow
>>CONFIGURE OFFLINE ADDRESSBOOK
Tools -> address book
File -> New -> Ldap directory
This will need the ldap details.
Right click new address book and click properties -> offline tab -> click download
Now goto mail settings -> composition & addressing
select 'Use a different LDAP server' and select new address book.
>>CONFIGURE CALENDAR
File -> New -> calendar
Select 'on the network'
Select Microsoft Exchange 2007/2010
Check Use Exchange's autodiscovery function

-ms office communicator plugin for pidgin
sudo yum install pidgin pidgin-sipe

-file editor
sudo yum install geany geany-plugins-treebrowser geany-plugins-xmlsnippets
Enable TreeBrowser and XML Snippets under tools -> plugins

-Install java
open jdk 1.7 was already installed
sudo yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel

-subversion installation
sudo yum install svn

-Download eclipse
mkdir ~/DEV
cp ~/Downloads/eclipse-jee-juno-linux-gtk-x86_64.tar.gz ~/DEV
cd ~/DEV
tar -xzvf eclipse-jee-juno-linux-gtk-x86_64.tar.gz
rm -rf eclipse-jee-juno-linux-gtk-x86_64.tar.gz
cd eclipse
chmod 775 eclipse
./eclipse
set workspace as /home/bhupendra/DEV/eclipse/workspace
Once eclipse is opened:
move outline and task panel to right
window -> show view -> navigator
help -> check for updates
Drop eclipse.png in /usr/share/icons and Create eclipse.desktop file under /usr/share/applications
[Desktop Entry]
Name=eclipse
Exec=/home/bhupendra/DEV/eclipse/eclipse
Icon=eclipse.png
Terminal=0
Type=Application
Encoding=UTF-8
Categories=Development;Application;

Install subversive from the juno update site using eclipse add new software.
After restart select svnkit 1.3x for connector [after checking which version of svn is running]

-for file and folder diff operations
sudo yum install meld

-Download sql developer from oracle site
sudo rpm -Uvh sqldeveloper-*

type sqldeveloper and it will prompt for jdk path, enter following
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.3.x86_64

-Maven installation
Downloaded apache-maven-2.2.1-bin.tar.gz
cp apache-maven-2.2.1-bin.tar.gz ../DEV
cd ../DEV
tar -xzvf apache-maven-2.2.1-bin.tar.gz
rm apache-maven-2.2.1-bin.tar.gz
Add following to /etc/profile
export M2_HOME=/home/bhupendra/DEV/apache-maven-2.2.1
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
To check the installation immediatly, run above command in terminal and type
mvn --version
For my dev, I updated the settings.xml file under $M2_HOME/conf

-Apache httpd installation
sudo yum install httpd
to check service status
sudo systemctl status httpd.service
to start service
sudo systemctl start httpd.service
to stop service
sudo systemctl stop httpd.service
conf files located at /etc/httpd/conf
Disable the default welcome page by commenting out lines in /etc/httpd/conf.d/welcome.conf
New files can be dropped in at /var/www/html which is the default DocumentRoot
Created index.htmll in the Document root and accessed using http://localhost/index.html
sudo yum install php
restart httpd so that it loads up php module
create new file /home/bhupendra/DEV/html/test.php
// Show all information, defaults to INFO_ALL
phpinfo();
// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);
?>


-mount windows share
mkdir /mnt/mountdir
sudo mount -t cifs //ipaddresshere/client4 -o username=myusername,password=mypassword /mnt/mountdir
umount /mnt/mountdir

Sunday, June 19, 2011

Fedora 15 with gnome 3 - my howto

Installed live image from Fedora 15 64bit running gnome 3
I had to reinstalled since first time around, it loaded into fallback mode.

-disable selinux
vi /etc/selinux/config
change SELINUX=targetted to SELINUX=disabled
save and close

-enable sudo
vi /etc/sudoers
add following
yourusername ALL=(ALL) ALL

-enable left click on touchpad of laptop
click 'Activities' (top left)
click 'System tools' (right)
click 'Mouse and Touchpad'
goto Touchpad tab and check following boxes
Disable touchpad while typing
Enable mouse clicks with touchpad

-intall new programs
sudo yum install yum-fastestmirror

-install plugins for the new gnome-shell
sudo yum install gnome-shell-extensions-alternative-status-menu [to have shutdown(power off) along with suspend menu]
sudo yum install gnome-shell-extensions-places-menu [adds places menu to right hand system indicator aread on top panel]
sudo yum install gnome-tweak-tool

-install flash plugin,for my 64 bit installation I did following
sudo yum install wget
cd /tmp
wget http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p3_64bit_linux_111710.tar.gz
tar xzvf flashplayer10_2_p3_64bit_linux_111710.tar.gz
sudo mv /tmp/libflashplayer.so /usr/lib64/mozilla/plugins/
For 32 bit, recommended approach is to download rpm from adobe site and install flash-plugin.

-skype
sudo yum -y install pulseaudio-libs.i686 pulseaudio-libs-devel.i686 alsa-plugins-pulseaudio.i686 libv4l.i686 libXv.i686 libXv-devel.i686 libXScrnSaver.i686 libXScrnSaver-devel.i686 dbus-qt-devel.i686 qt.i686 qt-devel.i686 dus-qt.i686
Then download and install fedora10+ rpm from skype site.
sudo rpm -Uvh skype-2.2.0.35-fedora.i586.rpm

-Install office
sudo yum install libreoffice-writer libreoffice-calc libreoffice-draw libreoffice-impress

-install webstart and java applet support for firefox
icetea-web

-install other programs that I use
gimp p7zip p7zip-plugins xboard gnuchess unrar wget

-Install repo for third party apps
su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'

-For mp3 player needs I use audacious, simple and winap like.
sudo yum install audacious audacious-plugins-freeworld*
change theme to winamp from view menu

-install play it all video player and fierfox plugin for videos.
sudo yum install vlc vlc-extras
God knows where vlc plugin for firefox went. It used to be available via rpmfusion repos. Anyways I downloaded it from ATrpms. Also got libdvdcss for dvd playback
http://dl.atrpms.net/all/vlc-plugin-1.1.9-69.fc15.x86_64.rpm at http://packages.atrpms.net/dist/f15/vlc/
http://dl.atrpms.net/all/libdvdcss2-1.2.10-5.fc15.x86_64.rpm at http://packages.atrpms.net/dist/f15/libdvdcss/
NOTE:After few days, once I updated using yum update, I was not able to update vlc due to vlc-plugin hard dependency. So I uninstalled vlc-plugin only to find out mozilla-vlc was back in repo. This was good news so no manual rpm installation required just do
sudo yum install vlc vlc-extras

-Enable ssh
system-config-services was missing on fedora 15, so I manually installed it only to find that I cannot enable/disable services only start/stop them. So I uninstalled it and googled for more info and found this http://fedoraproject.org/wiki/Systemd#How_do_I_start.2Fstop_or_enable.2Fdisable_services.3F
So after reading that, it was easy
sudo systemctl enable sshd.service
sudo systemctl start sshd.service

-Enable remote desktop
sudo yum install x11vnc x11vnc-javaviewers
x11vnc -storepasswd
The above command creates /home/yourusername/.vnc/passwd file where yourusername is your usernmae
To run server
sudo /usr/bin/x11vnc -o /var/log/x11vnc.log -display :0 -rfbauth /home/bhupendra/.vnc/passwd -many -bg -http
access via java enabled browser using http://hostOrIP:5800
access via vnc client hostOrIP:5900
To disconnect all connected clients
x11vnc -R disconnect:all
To stop running x11vnc server
x11vnc -R stop
To autostart x11vnc server on logon
cd /etc/gdm/PostLogin
sudo cp Default.sample Default
Add following line to Default file
/usr/bin/x11vnc -o /var/log/x11vnc.log -display :0 -rfbauth /home/bhupendra/.vnc/passwd -many -bg -http

-make fast firefox 4 faster, in browser open about:config
Search and update following
network.http.max-connections change to 60 (default: 30)
network.http.max-connections-per-server change to 20 (default: 15)
network.http.max-persistent-connections-per-server change to 8 (default: 6)
network.http.pipelining change to true (default: false)
network.http.pipelining.ssl change to true (default: false)

-Added following firefox addons
fireftp
User Agent switcher
Download helper
Awesome screenshot
fast dial
firecookie
firebug
colorzilla
live http header
measureit
refcontrol
JSONview
poster
jsview
flashblock

-share media on dlna enabled devices [Samsung BD-6500]
sudo yum install ffmpeg java-1.6.0-openjdk
Open TCP 8895 and UDP 1900 ports in firewall
Download serviio-0.5.2-linux.tar.gz from http://www.serviio.org/download
cp serviio-0.5.2-linux.tar.gz /home/bhupendra [where bhupendra is my home directory]
tar xzvf serviio-0.5.2-linux.tar.gz
rm serviio-0.5.2-linux.tar.gz
cd serviio-0.5.2/bin
Now turn on your dlan enabled device
Then run
./serviio.sh
Then run following to add media directory
./serviio-console.sh
If you are not knowing what's happening take a look at serviio-0.5.2/log/serviio.log
I was tailing the log in seperate conosle to see which all media got added.

-remove unwated apps
sudo yum remove totem totem-mozplugin totem-nautilus orca evince evince-nautilus rhythmbox evolution sound-juicer cdparanoia
ran package-cleanup --leaves
and uninstalled unwanted apps from it.

-organize photos and upload to picasa. I used to install picasa and run it with wine installation, but no more now.
sudo yum install shotwell
shotwell has dependency on totem, waiting for 0.10 version which removes it. Till then totem needs to be installed.
If shotwell fails to upload, check upload limit on picasa web, we may have exceeded limit.
[Update: switched back to picasa since needed it for collage creation]
Downloaded the rpm from http://picasa.google.com/linux/download.html#picasa30
sudo yum localinstall picasa-3.0-current.i386.rpm
This installed all the dependency rpms too.
sudo yum install wine
Had to install wine since default picasa gives segmentation fault.
So to run picasa I use following:
wine "/opt/google/picasa/3.0/wine/drive_c/Program Files/Google/Picasa3/Picasa3.exe"


-Enable ssh
system-config-services was missing on fedora 15, so I manually installed it only to find that I cannot enable/disable services only start/stop them. So I uninstalled it and googled for more info and found this http://fedoraproject.org/wiki/Systemd#How_do_I_start.2Fstop_or_enable.2Fdisable_services.3F
So after reading that, it was easy
sudo systemctl enable sshd.service
sudo systemctl start sshd.service

-Enable remote desktop
sudo yum install x11vnc x11vnc-javaviewers
x11vnc -storepasswd
The above command creates /home/yourusername/.vnc/passwd file where yourusername is your usernmae
To run server
sudo /usr/bin/x11vnc -o /var/log/x11vnc.log -display :0 -rfbauth /home/bhupendra/.vnc/passwd -many -bg -http
access via java enabled browser using http://hostOrIP:5800
access via vnc client hostOrIP:5900
To disconnect all connected clients
x11vnc -R disconnect:all
To stop running x11vnc server
x11vnc -R stop
To autostart x11vnc server on logon
cd /etc/gdm/PostLogin
sudo cp Default.sample Default
Add following line to Default file
/usr/bin/x11vnc -o /var/log/x11vnc.log -display :0 -rfbauth /home/bhupendra/.vnc/passwd -many -bg -http

-make fast firefox 4 faster
in browser open about:config
Search and update following
network.http.max-connections change to 60 (default: 30)
network.http.max-connections-per-server change to 20 (default: 15)
network.http.max-persistent-connections-per-server change to 8 (default: 6)
network.http.pipelining change to true (default: false)
network.http.pipelining.ssl change to true (default: false)
-Added following firefox addons
fireftp
User Agent switcher
Download helper
Awesome screenshot
fast dial
firecookie
firebug
colorzilla
live http header
measureit
refcontrol
JSONview
poster
jsview
flashblock

-share media on dlna enabled devices [Samsung BD-6500]
#USING SERVIO
sudo yum install ffmpeg java-1.6.0-openjdk
Open TCP 8895 and UDP 1900 ports in firewall
Download serviio-0.5.2-linux.tar.gz from http://www.serviio.org/download
cp serviio-0.5.2-linux.tar.gz /home/bhupendra [where bhupendra is my home directory]
tar xzvf serviio-0.5.2-linux.tar.gz
rm serviio-0.5.2-linux.tar.gz
cd serviio-0.5.2/bin
Now turn on your dlan enabled device
Then run
./serviio.sh
Then run following to add media directory
./serviio-console.sh
If you are not knowing what's happening take a look at serviio-0.5.2/log/serviio.log
I was tailing the log in seperate conosle to see which all media got added.
Added shortcut for serviio
/etc/share/applications/serviio-start.desktop with following in it.
[Desktop Entry]
Name=Serviio-start
Comment=Starts serviio
Icon=Serviio
Exec=/home/bhupendra/serviio-0.5.2/bin/serviio.sh
Terminal=false
Type=Application
Categories=AudioVideo;Player;
StartupNotify=true
#USING TVMOBILI
I found video buffering issue with serviio and also intermittently the connection was breaking with my blue ray. So I downloaded rpm from http://www.tvmobili.com/download.php, installed it. And that's it - all done. It installs service which runs when my laptop starts. It picked up wifi and immediatly my Videos, PIctures, Music folders were available on my blue ray player.
Ensure 30888 port is enabled on firewall.
TVmobili comes with a web console which can be accessed as http://yourLocalNetworkIP:30888/__index?page=information

-Run ftp server
sudo yum install proftpd
sudo vi /etc/proftpd.conf
Change DefaultRoot to some specific directory. By default it opens up user's home directory. ftp credentials is same as user's login credentials on the machine.
to start ftp as service
sudo systemctl enable proftpd.service
sudo systemctl start proftpd.service

-Enable bluetooth
systemctl status bluetooth.service
systemctl enable bluetooth.service
systemctl start bluetooth.service
I still was unable to send files from my cell to laptop after pairing. Dmsg showed following
Parsing /etc/bluetooth/input.conf failed: No such file or directory
I am still looking at solutions, will post once I get.

Sunday, May 22, 2011

vnc to current session on fedora

Been using fedora 14 and wanted to set up vnc to current session on the running gnome desktop

#install server
sudo yum install x11vnc-javaviewers x11vnc

#set x11vnc password, it is written to /home/yourusername/.vnc/passwd where yourusername is your usernmae
x11vnc -storepasswd

#run server
#-forever so that it does not disconnect when client disconnets
#-display :0 so that client shadows current logged in session
#-usepw so that client uses password from /home/yourusername/.vnc/passwd on server
#-bg can be used for the x11vnc to go into into the background after screen setup.Messages to
stderr are lost unless -o logfile is used
x11vnc -forever -usepw -display :0


#set up x11vnc startup in xinetd for autostart
sudo yum install xinetd
sudo vi /etc/xinetd.d/x11vnc
Enter following in the file
service x11vnc
{
port = 5900
type = UNLISTED
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/x11vnc
server_args = -inetd -o /var/log/x11vnc.log -display :0 -rfbauth /home/yourusername/.vnc/passwd -many -bg
disable = no
}
Note here we are running the service as root so that it can access /var/log/x11vnc.log but use /home/yourusername/.vnc/passwd file created by yourusername

UPDATE:
my x11vnc server was sometimes giving error, probably it may be starting before x windows. So I removed inetd and it's config and instead added following to /etc/gdm/PostLogin/Default

#!/bin/sh
#Running x11vnc server
/usr/bin/x11vnc -o /var/log/x11vnc.log -display :0 -rfbauth /home/bhupendra/.vnc/passwd -many -bg

Saturday, December 4, 2010

Nokia N8 - loving it

Tips and tricks for nokia N8 for more battery life for daily use
-use default theme and screensaver since it's already loaded. The AMOLED display in your device consumes more power with white color. Therefore the themes with a lot of white colors (e.g. in wallpaper image) may consume more power than the other themes. Makes sense to use black wallpaper. When I go on vacation trips I use the black image as wallpaper.
-Turn off theme effects. This also speeds up homescreens. Settings -> Themes -> Options -> Theme Effects -> Off
-keep bluetooth off. Menu > Settings > Connectivity > Bluetooth > Bluetooth = Off)
-In the tone profile for normal:
--Set vibrating alert off
--Set volume to 6 bars or less (to reduce sound pollution :-) )
--Set touch screen vibration off instead of level 2
-turn off notification lights. Select Menu > Settings > Phone > Notification lights and disable the breathing light in Breathing light and adjust the light settings for different events in Notification light menu.
-close unused applications whenever possible. Leaving applications running in the background increases the demand on battery power. To close the applications you do not use, press and hold the menu key, swipe to the application in the list and close it by selecting X.

Tips to reduce battery usage under critical conditions
-Change the synchronisation frequency for your mailbox. Select Menu > Applications > Mail, your mailbox, and Options > Settings, and the relevant sync frequency settings.
-Deactivate the Big clock screen saver. Select Menu > Settings > Themes > Screen saver > None.
-Home screen widgets may periodically connect to internet if the home screen is in online mode. If you are not actively using the widgets, the automatic connection can be disabled by selecting Options > Widgets to offline mode on the home screen.
-Features that use wireless LAN (WLAN) increase the demand on battery power. WLAN on your Nokia device switches off when you are not trying to connect, not connected to another access point, or not scanning for available networks. To further reduce battery consumption, you can specify that your device does not scan, or scans less often, for available networks in the background. WLAN switches off in between background scans. When Menu > Settings > Connectivity > WLAN > Options > Settings > Show WLAN availability is set to Never, the WLAN availability icon is not shown in the standby mode. However, you can still manually scan for available WLAN networks and connect to WLAN networks as usual.

Let me know any more tips n tricks and I'll add up.


Updated: Got this link on nokia site, has more tips
http://www.nokiausa.com/get-support-and-software/product-support/n8-00/faq#00

Wednesday, August 18, 2010

Switched back to Fedora 13 Gnome


After playing a lot with lxde on fedora 12,13 I got bored of it's plain looks, gmixer issue and occasional lxpanel and FF crashes. After looking at kde vs gnome vs xfce vs lxde comparisions I decided to go back to gnome. Above is the screenshot of my system after everything was done.

Downloaded Fedora-13-i686-Live.iso and installed. After installation did following:

echo 'bhupendra ALL=(ALL) ALL' >> /etc/sudoers
After this we can logout as root and run sudo yum ...

vi /etc/selinux/config
Change SELINUX=enforcing to SELINUX=disabled

-Enable touchpag clicks
sudo yum install gconf-editor
Open gconf-editor (not as root) and goto /desktop/gnome/peripherals/touchpad
select tap_to_click
select horiz_scroll_enable
select disable_while_typing

-Download 'yum for linux rpm' from http://get.adobe.com/flashplayer/ for flash player in browser and adobe reader
yum install flash-plugin AdobeReader_enu

-Download and install skype rpm for fedora 10+
sudo rpm -ivh skype-2.1.0.81-fc10.i586.rpm

-Download picasa rpm from http://picasa.google.com/linux/download.html
sudo yum install lsb libgphoto2 openssl sane-backends audiofile esound-libs openssl-devel
sudo rpm -Uvh picasa-3.0-current.i386.rpm

-Install rpmfusion repos
sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

-Enable mp3 playback on rythmbox
sudo yum install gstreamer-plugins-ugly gstreamer-plugins-bad

-install java 6 and firefox java plugin for applet support
sudo yum install java-1.6.0-openjdk java-1.6.0-openjdk-plugin

-I tried microsoft office 2007 with wine and then with the trial version of code weaver's crossover. Let me tell you, crossover works great and seamless. However I later came to know that openoffice supports word 2007 formats (though partially). If I need full support and I my wish of using linux in my workplace comes true will definatly buy licensed copy of crossover for personal use as it's not at all expensive.
installed openoffice writer(word) and calc(excel)
sudo yum install openoffice.org-writer openoffice.org-calc
Install microsoft fonts for dealing with microsoft word documents
I always refer to mjwired for his excellent work on this. http://www.mjmwired.net/resources/mjm-fedora-f13.html

-removed unwated apps, also ran package-cleanup --leaves to see which packages are not being used
sudo yum remove pino gnome-games vinagre totem brasero sound-juicer

-Install other programs I need, vlc for videos, gimp for image manupulation and xboard as frontend to gnuchess
sudo yum install vlc mozilla-vlc gimp xboard gnuchess proftpd

-Update system
sudo yum update
I rebooted once done for sanity check

-Bluetooth
Bluetooth packages were installed by default
Enabled bluetooth service under services
to get services sudo yum install system-config-services
Bluetooth applet also sows up by default. Right click goto preferences, click 'recieve files' and check 'Recieve files in Downloads folder over bluetooth' and changed accpet files to 'always'.

-Virtual machines using virtualbox
Download Fedora repo file and move to /etc/yum.repos.d from http://www.virtualbox.org/wiki/Linux_Downloads
yum install dkms gcc kernel-headers kernel-devel VirtualBox-3.2
I already had images of windows exported from my previous virtual box so just imported them.
Dont forget to add your user to vboxuser group for usb support on guests.

Show desktop icon available in panel configuration. By default ctrl+alt+D toggles desktop
set top and bottom panels transparent
Enable compiz via system->preferences->desktop effects
Change background image by right click on desktop. Set it default so that it reflects on login screen also.
open terminal goto edit->profile preferences->colors
uncheck use colors from system theme
select white on black system theme
goto background tab, and set transparent background to 50%
I also changed background image to Aqua and made panels transparent.
speed up firefox page loading, type about:config, search for network.dns.disableIPv6 and set it to true


Downloaded screenlets rpm but eventually removed it all since screenlets kept on crashing. Following dependencies were required for it.
sudo yum install gnome-python2-rsvg gnome-python2-rsvg python-imaging python-dateutil

to connect to other machines
sudo yum install rdesktop vpnc NetworkManager-vpnc
I configured vpnc under network manager to connect to my office nw and created office.sh with following
rdesktop -u username -p password -f hostOrIp
Open nautilus, goto edit->preferences->behaviour tab
select 'Run executable text files when they are opened'
This way our script executes directly instead of opening dialog box telling what to do.