Showing posts with label Paltas. Show all posts
Showing posts with label Paltas. Show all posts

Sunday, January 26, 2025

Mounting a HFS+ hard drive

Mount an external hard drive with a HFS+ filesystem:

 # mount -t hfsplus -o force,rw /dev/sdb2 /mnt/tmp

Saturday, March 24, 2018

NFS share in OSMC

To configure a NFS server to share a folder.

1. Fix the IP address to a static one. This can be done directly in the network menu of the 'My OSMC' application. The configuration is stored in the file: /var/lib/connman/[interface]/settings

2. Create a mount point in /mnt for the directory from a USB drive. 
$ sudo mkdir ./TheBlackHole

$ sudo chmod 777 ./TheBlackHole

3. Mount the drive at the boot time. Edit fstab file adding the following line.
LABEL=TheBlackHole      /mnt/TheBlackHole       ext4    defaults,users,exec     0       0

4. Download server: sudo apt-get install nfs-kernel-server portmap

5. Edit the /etc/exports file adding the following line:
/mnt/TheBlackHole        192.168.1.0/255.255.255.0(rw,sync,no_root_squash,no_subtree_check)


Saturday, November 26, 2016

Kernel upgrade

As I mention in another post, Kaby Lake processors are not supported by the kernel version currently used in Slackware 14.2 and -current (4.4.x). So, in order to use Slackware in a system using this architecture, it is need to upgrade the kernel to someone above 4.5. In this case I used the version 4.8.10, the last stable available in that moment.
In general the upgrading was done by following the procedure explained in Aliens Bob's wiki. In simple, it is as follow:

- Configure the EFI boot loader to show two options, one with the old kernel and other with the new one. This is a bit different at what is explained in the Alien's wiki, because he uses lilo instead of elilo (it is an old post), but the situation is almost the same, even easier. I did this before compiling because I wanted to be sure that the configuration and both booting options were working properly (I loaded the same kernel in both option).

- Download the Kernel sources.
$ wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.8.10.tar.xz

- Check the source authenticity.
# wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.8.10.tar.sign
# gpg --keyserver wwwkeys.pgp.net --recv-keys 38DBBDC86092693E
# gpg2 --verify linux-4.8.10.tar.sign

- Extract the source to a local directory.
# tar -Jxvf linux-4.8.10.tar.xz

- Download an initial .config file from a Slackware mirror.
$ wget http://mirrors.slackware.com/slackware/slackware64-current/testing/source/linux-4.6-configs/config-generic-4.6.x64

- Configure the Kernel compilation.
# make oldconfig
# make menuconfig

- Make and Install.
# make bzImage modules
# make modules_install

- Add the new Kernel to elilo.
# cp arch/x86/boot/bzImage /boot/efi/EFI/Slackware/vmlinuz-custom-4.8.10
And edit to image=vmlinuz-custom-4.8.10 the second boot option in elilo.conf.

- Reboot.

Wednesday, July 27, 2016

Fine tuning

There was several acctions I had to take in order to configure the system better.

- I forgot to set the network during the installation, and I like to use a differnt hostname than the default. To run the network configuration program run the command:

# netconfig


- I changed the kernel from Huge to generic, I did it by following this procedure stated in SlackDocs. The only one difference was the configuration of lilo, in my case, I'm ussing elilo, so the procedure is a bit different.
I copyed the Slackware bootloader folder in EFI partition (/boot/efi/EFI/Slackware) and I renamed as Slackware-generic (/boot/efi/EFI/Slackware-generic), then I copyed the files /boot/vmlinuz-generic-4.4.14 and the RAM disk /boot/initrd.gz which were created previously into the Slackware-generic folder. Then, it is needed to modify the elilo configuration file to:

# /boot/efi/EFI/Slackware-generic/elilo.conf

chooser=simple
delay=1
timeout=1
default=Slackware-generic
#
image=vmlinuz-generic-4.4.14
    initrd=initrd.gz
    label=Slackware-generic
    root=/dev/sda3
  append="resume=/dev/sda2"
    read-only

This configuration includes the line that enables hibernation ("resume=/dev/sda2").

To finish I added the Slackware-generic boatloader to the UEFI boot configuration using the computer's firmware menu


- In Windowmaker, I used nm-applet to connect to a wifi network. The application loads in the system tray, so first it is needed to install and load wmsystemtray.


- I set the network time protocol script to run at starting the computer.

# chmod 755 /etc/rc.d/rc.ntpd

and I used the confuguration file:

# /etc/ntp.conf

driftfile /etc/ntp/drift
logfile /var/log/ntp.log

server 0.nl.pool.ntp.org
server 1.nl.pool.ntp.org
server 2.nl.pool.ntp.org
server 3.nl.pool.ntp.org

server 127.127.1.0
fudge 127.127.1.0 stratum 10

restrict default nomodify nopeer notrap
restrict 127.0.0.1 mask 255.0.0.0

Keyboard layout

My current laptop uses a German keyboard (QWERTZ), also I use to use another US-international, so I have to configure the system to use both.

I need to write in Spanish frequently. The default German layout (no death keys) works fine but it doesn't allow to write the ñ letter. The legacy version uses death keys and allows to write the lovely ñ.

Linux console:
To change the default keyboard layout, create the file:
# /etc/rc.d/rc.keymap

#!/bin/sh
# Load the keyboard map.  More maps are in /usr/share/kbd/keymaps.
if [ -x /usr/bin/loadkeys ]; then
 /usr/bin/loadkeys de-latin1.map
fi

Xorg
This settings will affect all the Xorg application, thats include KDE and Window Maker. Just create the following config file.

# /etc/X11/xorg.conf.d/90-keyboard-layout.conf

Section "InputClass"
Identifier "keyboard-all"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "XkbLayout" "de"
Option "XkbVariant" "legacy"
Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

KDE
Normaly KDE will use the keymap defined by Xorg, but in the case you want to set it again in KDE, just choose the German variant German (legacy) as keyboard layout in the Input devices section of the System Settings.

There still a problem prowling around. It is the special keys, most of them works ok with the exception of the airplane mode and the increase and decrease brightness. They doesn't work, I think they are not visible in linux, but I have to check this.

Also I have to try what happens with the second keyboard, I have not tried yet.

Saturday, March 26, 2016

Office 2010 in Wine + winetricks

It is possible to run Office 2010 (Professional Plus, x86) in Linux using Wine (1.8 Staging, 64 bits, -compat32). Its performance is good enough but it needs some tweaks. I followed the following procedure to install it and make it functional.

Installation
1. Create a new WINEPREFIX:
$ WINEARCH=win32 WINEPREFIX=~/.wine/Office2010_32  winecfg

2. Configure
a) Leave the Windows version as Windows XP.
b) Change the screen dpi in order to improve the fonts and GUI visualization. 
$ WINEPREFIX=~/.wine/Office2010_32 winecfg 
Graphics > Screen resolution: 160 dpi > OK
c) To allow Powerpoint to run properly, set 'riched20' to (native,builtin)

3. Mount the Office 2010 ISO file:
# mkdir -p /run/media/userx/dvd
# mount -t iso9660 -o loop ./officeproplus2010uk32.iso /run/media/userx/dvd

4. Run the installer:
I use to install only Word, Excel, Powerpoint, Publisher and its shared tools. Nothing about web sites, Access or SharePoint.
 $ WINEPREFIX=~/.wine/Office2010_32 wine /run/media/userx/dvd/setup.exe

5. Register and play.

6. To solve the window resizing problem:
I tried the solutions given in WineHQ, the first two worked but I didn't like the final behaviour. The third didn't work directly but I found the solution. This settings allows PowerPoint to show in full screen.
a) Go to System Settings > Window Management > Window Rules.
b) Create a new rule.
c) Give it a description such as MS Office.
d) Set Window class as Regular Expression.
e) As regex string use (without quotation marks): "\b(winword.exe|excel.exe|powerpnt.exe|mspub.exe)\b."
f) Check Match whole window class.
g) On tab Size & Position check Ignore requested geometry and set Force Yes.

7. Improve font rendering in Wine.
For more details check this, but I did not find a big difference in the visualisation.
a) Open regedit.
b) Go to [HKEY_CURRENT_USER\Control Panel\Desktop].
c) update the following entries:
    FontSmoothing=2
    FontSmoothingType=dword:00000002
    FontSmoothingGamma=dword:00000578
    FontSmoothingOrientation=dword:0000000

In case of problems or errors, try :
8. Configure the DLL:
$ WINEPREFIX=~/.wine/Office2010_32 winecfg
Libraries:
gdiplus (native)
msxml6 (native)
> OK

9. Install MS XML Core Service 6.0 sp1 (solves the problem of saving files):
$ WINEPREFIX=~/.wine/Office2010_32 winetricks 
Install and app > Cancel > Install a Windows DLL or Co/ mponent > OK > (check) msxml6 > OK
[I need to check the DLL configuration]

10. Create the folder ~/.wine/Office2010_32/drive_c/users/userx/Recent :
This avoids the creation of multiple .lnk files when you work in Office. The files will be created anyway, but inside the mentioned directory not in the office file's folder.
$ mkdir -/.wine/Office2010_32/drive_c/users/userx/Recent

Uninstalling
I couldn't make the uninstaller program work, first I tried with the wine uninstaller program, but I got an error after launching the Office uninstall application.
$ WINEPREFIX=~/.wine/Office2010_32 wine uninstaller

So, I uninstalled Office 2010 by brute force. 
1. Delete the wineprefix where it is installed:
$ rm -rf ~/.wine/Office2010_32

2. Remove the K menu and desktop entries:
$ rm -f ~/.config/menus/applications-merged/wine-Programs-Microsoft\ Office*
$ rm -rf ~/.local/share/applications/wine/Programs/Microsoft\ Office/
$ rm -f ~/.local/share/desktop-directories/wine-Programs-Microsoft\ Office*

3. Remove the Office applications icons:
Do it by hand looking in the folder: ~/.local/share/icons/

4. Remove the extensions .desktop definitions (remove from "Open With ..."):
Do it by hand looking in the folder: ~/.local/share/applications/



Sunday, June 23, 2013

Installing Slackware 14 from a USB drive

The following notes collect important tips to consider in the installation of Slackware 14.

Before any modification in my computer I use to load a USB drive with Slax, in case something goes wrong I can use it to fix problems or to find help on Internet.
  1. Download Slax
  2. Install it in a USB drive (this erase all data in it).
    1. Extract Slax inside it.
    2. Run the script xxxx.sh for make it bootable.
  3. Boot one time to try it and to verify all works fine.
Downloading Slackware by torrent.
I like download the DVD ISO by using torrent, you can find it in the Slackware official site (~2,3GiB).

Installing the complete distribution in the USB drive and do it bootable
  1. To mount Slackware iso image, it should be done by root user: # mount -t iso9660 -o loop /.../slackware-14.0-iso/slackware-14.0-install-dvd.iso /media/dvd
  2. Go to /../usb-and-pxe-installers folder: $ cd /media/dvd/usb-and-pxe-installers/
  3. Type $ sh usbimg2disk.sh -h to getting help.
  4. With the pendrive unmounted run this command as root: $ sh usbimg2disk.sh -f -s /media/dvd/ -o /dev/sdc where -s /media/dvd/ is the folder were Slackware tree is mounted, and /dev/sdc the path to the pendrive. -f is the parameter to format the pendrive. Note that pendrive shouldn't be mounted before run this script, if you do it, unplug it and plug it again but without mounting it.
Booting from the USB drive
If the computer doesn't boot automatically from the USB drive, you will have to find the correct configuration inside the BIOS setup. Usually you have to change the order of the devices that can boot the system, put the USB drive in the first place. In some systems the USB drive have to be plugged to appears in the devices list.

Kernel selection
After the Slackware installer boots it will ask you for witch kind of kernel should it use. You have two options: huge.s and hugesmp.s, the first should be used in computer with single processor while the second in multiprocessors computers. I have chose hugesmp.s.

Preparing the hard drive
This time I have change the partitions in the hard drive, I have created one for the / folder (20GiB, ext4), another for swap (2GiB, linux swap), a third for the /home folder (80GiB, ext4) and the rest available space in a fourth partition for a testing area (ext4).

Installing Slackware
I use to avoid the installation of games and FAQs, then I chose the complete installation without prompting.

A good practice is to mount the /home folder in a different partition. This helps when you do an update of the operating system conserving users files and configurations.

Sunday, October 07, 2012

Configuring Slackware 14

Lilo Configuration
By default Lilo gives two options of OS to start, Windows and Linux, and wait a minute to run automatically the first option. I just have Slackware in my PC so it is unnecessary that Lilo asks and wait.

To change the default Lilo behavior you have to change /etc/lilo.conf, this is what I have changed.

1. No waiting until systems starts. Comment prompt line
# Wait until the timeout to boot (if commented out, boot the
# first entry immediately):
#prompt


2. No Windows option. Comment or delete the Windows section at the end of the config file:
#other = /dev/sdb1
#label = Windows
#table = /dev/sdb


3. Use the command compact to skip memtest and start the system quickly.

To apply any modification to the boot loader it is necessary to run the command lilo.
# lilo


Configuring the system to multi user with session manager
Most of the time I use KDE, so I prefer start KDM it when the system goes up. To do that you have to change the default runlevel configuration in file /etc/initab to the option 4:
# 4 = X11 with KDM/GDM/XDM (session managers)
...
# Default runlevel. (Do not set to 0 or 6)
id:4:initdefault:

Problem:
After booting in runlevel 4 the computer showed an error with the sound card and didn't play any sound. This is because in runlevel 4 users don't belong the audio group, so you have to add your user to it.

# usermod -aG audio user_name

This problem can affect other resources, as scanners, printers, etc the solution should be adding the user to the appropriate group.

Network manager configuration
In this distribution KDE gets its own network manager, if you want to use it just changes permissions of rc.networkmanager:
# chmod 755 /etc/rc.d/rc.networkmanager

In case you prefer wicd, you have to install it from /extra/wicd folder in the Slackware installation DVD and change permission to /etc/rc.d/rc.wicd to 755 after installation.

Saturday, March 19, 2011

Managing users and groups

To add a new user:
# useradd -m user_name

To crate a user for a daemon

This is a system account (-r), with no access to a shell.
# useradd -r -s /bin/false user_name

To set or change a user password :
# passwd user_name

To modify an user account:
# usermod [options] user_name

To delete an user:
# userdel - Delete a user account and related files
# deluser - remove a user from the system

To add an user to a secondary group (append a group to a user):
# usermod -aG group_name user_name

To show the groups that belongs a user:
This show a reduced set of groups (maybe just the secondary groups)
# groups user_name

If the user uses the command groups without a user name, it will show an extended list of groups (maybe the primaries and secondaries groups)

The command id -nG user_name has the same behavior that group.

To remove a user from a group:
it is needed write all the groups the user belongs less the unwanted groups.
# usermod -G {groupname1,groupname2,...} user_name

To add a new group:
 # groupadd group_name

To modify a group:
 # groupmod [options] group_mane

To delete a group:
# groupdel - Delete a group
# delgroup - remove a group from the system

You can edit manually the OS groups file (needs logout-login):
# vi /etc/group

Example:
In KDE with HAL: The error that appears when I pugged a USB HDD was solved adding my user to the groups users and plugdev:
# usermod -aG users my_user
# usermod -aG plugdev my_user

Sunday, December 26, 2010

Listing just directories with "ls"

Basic but not so obvious for me:
For listing only the directories in, for example, /dev:

$ ls -d /dev/*/
/dev/block/ /dev/bsg/ /dev/bus/ /dev/char/ /dev/disk/ /dev/dri/ /dev/fd/ /dev/input/ /dev/mapper/ /dev/pts/ /dev/shm/ /dev/snd/

$ ls -adl /dev/*/
drwxr-xr-x 2 root root 720 2010-12-26 11:41 /dev/block/
drwxr-xr-x 2 root root 140 2010-12-26 11:41 /dev/bsg/
drwxr-xr-x 3 root root 60 2010-12-26 08:31 /dev/bus/
drwxr-xr-x 2 root root 4660 2010-12-26 11:41 /dev/char/
drwxr-xr-x 6 root root 120 2010-12-26 11:41 /dev/disk/
drwxr-xr-x 2 root root 80 2010-12-26 08:31 /dev/dri/
dr-x------ 2 felipe felipe 0 2010-12-26 12:21 /dev/fd/
drwxr-xr-x 3 root root 260 2010-12-26 08:31 /dev/input/
drwxr-xr-x 2 root root 60 2010-12-26 08:31 /dev/mapper/
drwxr-xr-x 2 root root 0 2010-12-26 08:31 /dev/pts/
drwxrwxrwt 2 root root 40 2010-12-26 11:31 /dev/shm/
drwxr-xr-x 3 root root 240 2010-12-26 11:32 /dev/snd/

$ ls -adl /dev/*/*/
drwxr-xr-x 6 root root 120 2010-12-26 08:31 /dev/bus/usb/
drwxr-xr-x 2 root root 300 2010-12-26 11:41 /dev/disk/by-id/
drwxr-xr-x 2 root root 80 2010-12-26 11:41 /dev/disk/by-label/
drwxr-xr-x 2 root root 220 2010-12-26 11:41 /dev/disk/by-path/
drwxr-xr-x 2 root root 120 2010-12-26 11:41 /dev/disk/by-uuid/
drwxr-xr-x 2 root root 100 2010-12-26 08:31 /dev/input/by-path/
drwxr-xr-x 2 root root 60 2010-12-26 08:31 /dev/snd/by-path/

For listing the current directory: ls -d */