Showing posts with label yaourt. Show all posts
Showing posts with label yaourt. Show all posts

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> -->