Thursday, 26 June 2014

Weather Widget for KDE

The weather widget available for KDE in the official archlinux repositories does not work for me but there is an alternative in the aur that works and is great see this page for more details.
To install it use yaourt:
yaourt -S kdeplasma-applets-yawp

Wednesday, 25 June 2014

Blocking a website for all client IPFire gateway

Via ssh log into ipfire and run the following command to block a website for all clients using that gateway.

# iptables -I FORWARD  -m string --string "example.com" --algo bm --from 1 --to 600 -j REJECT
P.S. I just created this post for me to remember it.

Tuesday, 10 June 2014

Commands I run on Arch Linux install

An update version where I've used plasma 5 instead of kde4 can be found here.

First Connect to the internet
Next is partitioning and mounting
After that installing
Note: in partitioning and mounting step you should have mounted the partition you want to have as root on /mnt for the following commands to be right:
# pacstrap -i /mnt base base-devel
Generate an fstab
# genfstab -U -p /mnt >> /mnt/etc/fstab 
Make sure fstab looks right
# nano /mnt/etc/fstab 
Chroot And configure the base system
# arch-chroot /mnt /bin/bash
Locale
Edit locale.gen and uncomment en_US.UTF-8 UTF-8
nano /etc/locale.gen
Generate the locale(s) specified in /etc/locale.gen:
# locale-gen
Create the /etc/locale.conf file substituting your chosen locale:
# echo LANG=en_US.UTF-8 > /etc/locale.conf
Export substituting your chosen locale:
# export LANG=en_US.UTF-8
Create a symbolic link /etc/localtime to your subzone file /usr/share/zoneinfo/Zone/SubZone using this command:
# ln -s /usr/share/zoneinfo/Zone/SubZone /etc/localtime
I use:
# ln -s /usr/share/zoneinfo/America/Belize /etc/localtime
Hardware clock
Use either UTC (recommended):
# hwclock --systohc --utc
localtime (discouraged; used by default in Windows):
# hwclock --systohc --localtime
Hostname
# echo myhostname > /etc/hostname
Add the same hostname to /etc/hosts:
# nano /etc/hosts

---------------------------------------------------
#
# /etc/hosts: static lookup table for host names
#

#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost myhostname
::1  localhost.localdomain localhost

# End of file
Set the root password
Set the root password with:
# passwd
Install and configure a bootloader
I use either syslinux or grub.
See syslinux or grub for details or check the beginners guide

Users and groups Add a user. examples:
# useradd -m -G wheel -s /bin/bash archie
# useradd -m -g users -G wheel -s /bin/bash archie
Read more about users and groups here.
Display server
Install xorg-server
Display Driver
First, identify your card:
$ lspci | grep VGA
Note: if you don't get any output, try looking for a 3D controller instead:
$ lspci | grep 3D
Then install an appropriate driver. You can search the package database for a complete list of open-source video drivers:
$ pacman -Ss xf86-video
Or check this page.
You might also want to install touchpad drivers if you have laptop.
$ pacman -S xf86-input-synaptics
Installing kdebase and NetworkManager
To install kdebase and NetowrkMangager I use this command.
pacman -S kdebase kdemultimedia-kmix kdeplasma-applets-plasma-nm firefox
Enable KDM and NetworkManager with:
# systemctl enable kdm; systemctl enable NetworkManager
Exit out of chroot:
# exit
Unmount partitions:
# umount -R /mnt
Reboot:
# reboot

Useful Programs you might install

Install software:
# pacman -S exfat-utils fuse-exfat ntfs-3g kio-mtp dosfstools gparted thunderbird firefox ktorrent smplayer amarok gstreamer0.10-plugins kdesdk-kate gimp kdegraphics-okular kdegraphics-gwenview digikam blender kdenlive p7zip unrar unzip zip kdeutils-ark kdeutils-kcalc cups cups-pdf gutenprint kdeutils-print-manager system-config-printer flashplugin networkmanager-openvpn openssh libreoffice hunspell hunspell-en k3b cdrdao dvd+rw-tools oxygen-gtk3 oxygen-gtk2 kde-gtk-config wget ntp firefox-adblock-plus
Cups and ssh you need to enable yet with:
# systemctl enable org.cups.cupsd; systemctl enable sshd
Then reboot or run the following command for it to work:
# systemctl start cups; systemctl start sshd
You might want to install additional printer drivers:
pacman -S gutenprint foomatic-db foomatic-db-engine foomatic-db-nonfree hplip splix foo2zjs
Speed Up applications startup in kde
User Rob wrote on his blog this "magic trick" to improve application start-up time by 50-150ms. To enable it, create this folder in your home:
$ mkdir -p ~/.compose-cache/
Install extra fonts
pacman -S ttf-bitstream-vera ttf-dejavu ttf-freefont ttf-linux-libertine ttf-oxygen ttf-droid ttf-liberation ttf-ubuntu-font-family

Saturday, 7 June 2014

Nice Music Widget/Plasmoid for KDE on Arch Linux

There is a KDE applet called nowplaying that is pretty cool. Below is a screenshot of it:

To install use either yaourt or pacman:
yaourt -S kdeplasma-addons-applets-nowplaying
pacman -S kdeplasma-addons-applets-nowplaying

Installing yaourt on archlinux

You can use the following commands to install yaourt:
curl -O https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz
tar zxvf package-query.tar.gz
cd package-query
makepkg -si
cd ..
curl -O https://aur.archlinux.org/packages/ya/yaourt/yaourt.tar.gz
tar zxvf yaourt.tar.gz
cd yaourt
makepkg -si
cd ..
Another method to install yaourt is to add the repository to /etc/pacman.conf:
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch
And then use pacman to install yaourt:
pacman -Sy yaourt
Sources: http://archlinux.fr/yaourt-en

Unified KDE look for user and root applications

To have unified look for root and user applications you can do this
On the new Arch Linux with KDE you can run these following commands to set it up. Note if you run the commands as root you don't need to use sudo.

Create the directories if needed or not present:
sudo mkdir /root/.kde4/; sudo mkdir /root/.kde4/share/ ; sudo mkdir /root/.kde4/share/config/
Or remove the configuration files if present:
sudo rm /root/.kde4/share/config/kdeglobals
sudo rm /root/.kde4/share/config/kwinrc
Create links to your KDE settings file:
sudo ln -s ~/.kde4/share/config/kdeglobals /root/.kde4/share/config/kdeglobals

sudo ln -s ~/.kde4/share/config/kwinrc /root/.kde4/share/config/kwinrc
For GTK applications if you have oxygen-gtk package installed run the following command:
sudo ln -s ~/.gtkrc-2.0 /root/.gtkrc-2.0
Edit: For the .gtkrc-2.0 file to be there I had to install kde-gtk-config then switch to a different theme under the gtk settings and switch back for the config file to be created and even if the config file is there it may be needed for the right configuration options to be present.