Tagged: Slackware

Building My Work Environment (Part 2)

Part 2 - Getting Some Utilities Installed

Now, we've got a base system configured and ready to go. It's time to install some useful utilities.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

Here is the list of items to be instaled.

File Manager:
  • pcmanfm
  • ranger
  • highlight (for ranger)
  • My customized ranger/rc.conf (~/.config/ranger/)

Music:
  • cmus

Terminal:
Text Editor:
  • nvim
  • My customized nvim/init.vim (~/.config/nvim/)

Virtualization:
  • virtualbox-kernel
  • virtualbox

Web Browser:
  • chromium

Others:
  • python3
  • scrot - Command line screen capture

The above list may grow in the future but these are the absolute minimum software that I need to do my daily tasks.

All of these can be downloaded from Slackbuilds.org, and follow the usual procedure to get them installed.

Now move onto the next step to install/configure my favorite window manager.

In next article, let's talk about my favorite window manager, i3.

That's all!
-gibb

Building My Work Environment (Part 1)

Part 1 - Base System

I have been a long time Slackware Linux user, probably since Slackware 9 or so. Because of its UNIX-like architecture and stability, Slackware has always been the main OS for my workstation (although I do distro hoppings on my laptop among Debian, FreeBSD, and Arch Linux).

This is just my notes for a list of steps/software I need to install to create my work environment from fresh install of Slackware.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

Partition Scheme:

On my current system, I have 16GB of RAM. So, theoretically, I don't think I need a swap partition; however, just in case my system goes haywire, I reserve 1GB of swap partition.

/dev/sda1 - swap (1GB)
/dev/sda2 - / (around 80GB)
/dev/sda3 - /backup (Rest of space)

Installation of Slackware:

Nothing needs to be noted. Follow its instruction.

Post Installation:

After rebooting the system, there are some tasks need to be done.

Create a user
A regulsr user to do daily tasks. # adduser ... follow the instructions ...

Switch to a generic kernel
Run the following script to output the mkinitrd command with customized options. In my case it was below: # /usr/share/mkinitrd/mkinitrd_command_generator.sh # # mkinitrd_command_generator.sh revision 1.45 # # This script will now make a recommendation about the command to use # in case you require an initrd image to boot a kernel that does not # have support for your storage or root filesystem built in # (such as the Slackware 'generic' kernels'). # A suitable 'mkinitrd' command will be: mkinitrd -c -k 4.4.14 -f ext4 -r /dev/sda2 -m usb-storage:ehci-hcd:ehci-pci:xhci-pci:ohci-pci:xhci-hcd:uhci-hcd:hid:usbhid:i3c-hid:hid_generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jdb2mbcache:ext4 -u -o /boot/initrd.gz

Update lilo.conf
Since I have LILO installed (the default bootloader of Slackware), its configuration file needs to be updated to boot into the generic kernel. But first run below command to output example sections that need to be updated: # /usr/share/mkinitrd/mkinitrd_command_generator.sh -l /boot/vmlinuz-generic-4.4.14 ... image = /boot/vmlinuz-generic-4.4.14 initrd = /boot/initrd.gz root = /dev/sda2 label = 4.4.14 read-only ...

While editing /etc/lilo.conf, insert lba32, uncomment compact options, and change the timeout value to 0 (zero):# vim /etc/lilo.conf ... lba32 compact ... timeout = 0 ...

Then, run below command to update LILO:# lilo -v

Black listing nouveau video driver
I have rather old video card from NVIDIA which complains about nouveau video driver during its installation. So, the nouveau driver needs to be black listed before installing the video driver from NVIDIA.

To view the name of video driver:# lspci | grep -i vga 01:00.0 VGA compatible controller: NVIDIA Corporation GF106 [GeForce GTS 450] (rev a1)

Then, download xf86-video-nouveau-blacklist-noarch-1.txz from the extra directory in the source tree:# installpkg xf86-video-nouveau-blacklist-noarch-1.txz ... Package xf86-video-nouveau-blacklist-noarch-1.txz installed.

Run the NVIDIA video driver script that's downloaded from the NVIDIA site:# ./NVIDIA-Linux-x86_64-390.48.run

Download Security Patches from slackware.com:

No need to explain:# mkdir /tmp/patches # cd /tmp/patches # wget ftp://ftp.slackware.com/pub/slackware/slackware64-14.2/patches/packages/*.txz ... # upgradepkg *.txz

In next article, let's talk about installing other utilities.

Things To Be Installed:

Fonts:
Icons:
  • Faenza (Slackbuilds.org)

File Manager:
  • pcmanfm
  • ranger
  • highlight (for ranger)
  • My customized ranger/rc.conf (~/.config/ranger/)

Music:
  • cmus

Terminal:
Text Editor:
  • nvim
  • My customized nvim/init.vim (~/.config/nvim/)

Themes:
Version Control:
  • git

Virtualization:
  • virtualbox-kernel
  • virtualbox

Web Browser:
  • chromium

Window Manager:
  • i3
  • i3status
  • i3pystatus
  • My customized i3/conf (~/.config/i3/)
  • My customized i3pystatusconf.py (~/.config/i3/)

Others:
  • rofi - Replacement for dmenu
  • scrot - Command line screen capture
  • My customized rofi/config (~/.config/rofi/)

That's all!
-gibb

Ricty Fonts on Slackware 14.2

Ricty font is a Japanese True Type font for developers created from mixing Inconsolata and Mig 1M fonts.

To install Ricty font, follow below steps to generate.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

  1. Install fontforge from slackbuilds.org
  2. Download Inconsolata fonts from Google Fonts
  3. Download Inconsolata.otf from my github.com
  4. Download Mig 1M font from OSDN
  5. Generate Ricty fonts # cp Inconsolata.otf /usr/share/fonts/OTF # cp migu-1p-regular.ttf migu-1p-bold.ttf /usr/share/fonts/TTF # mkfontdir /usr/share/fonts/{TTF,OTF} # mkfontscale /usr/share/fonts/{TTF,OTF} # fc-cache -f -v # git clone https://github.com/metalefty/Ricty # cd Ricty # sh ricty_generator.sh auto ... # cp Ricty*.ttf /usr/share/fonts/TTF # mkfontdir /usr/share/fonts/TTF # mkfontscale /usr/share/fonts/TTF # fc-cache -f -v
  6. Restart X
  7. That's all!
    -gibb

/usr/lib/libjpeg.so: could not read symbols: File in wrong format collect2: error: ld returned 1 exist status

I was in need of installing software on my Slackware64 14.1 on the other day and got a following error message: ... /bin/sh ../libtool --tag=CC --mode=link gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -fPIC -module -avoid-version -o export_jpg.la -rpath /usr/lib64/transcode export_jpg_la-export_jpg.lo -L/usr/lib -ljpeg -lm -lm -lz -ldl libtool: link: gcc -shared -fPIC -DPIC .libs/export_jpg_la-export_jpg.o -L/usr/lib /usr/lib/libjpeg.so -lm -lz -ldl -O2 -Wl,-soname -Wl,export_jpg.so -o .libs/export_jpg.so /usr/lib/libjpeg.so: could not read symbols: File in wrong format collect2: error: ld returned 1 exit status make[2]: *** [export_jpg.la] Error 1 make[2]: Leaving directory `/tmp/SBo/transcode-1.1.7/export' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/SBo/transcode-1.1.7' make: *** [all] Error 2

From the error message, I can tell that it has something to do with linker and libraries, perhaps using 32-bit library on my 64-bit Slackware. I checked the LDFLAGS variable in its MakeFile and it was empty.

Ok, is there a way to force the compiler to use 64-bit libraries with SlackBuild scripts?

YES! A variable can be passed to SlackBuild script. To force the SlackBuild script to use 64-bit library, simply add variable with its value before executing a SlackBuild script.

$ LDFLAGS="-L/usr/lib64" ./[SlackBuildScript_name]

VoilĂ . The compilation went through without any more errors!

Disclaimer: The information in this site is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others. I will NOT take any responsibility of end result after following these steps (although I will try to help if you send me your questions/problems).

That's all!
-gibb

Copying Files From Android Kitkat (4.4.4) to Slackware

I didn't know until I tried myself but when I connected my Samsung Galaxy Note 4 to my slacky64 (Slackware Linux) via USB, I no longer had an option to connect it as USB Mass Storage (UMS) like it did with other flash drives. In stead, it gave me two options: MTP and PTP. Hmm... what the heck are these?

mtp_php

Apparently, the old way of accessing the storage device had several drawbacks. One being how it was making its storage partition available to foreign systems. Whenever another system accessed the phone's storage area, it needed exclusive access to there, which means the entire storage partition was dedicated to that system and as long as that system was accessing there, the phone itself couldn't access any files or apps stored in that area. Also, this could easily mess up (or corrupt) the storage partition.

Another reason was the type of its file system. Because its storage partition needed to be available to various systems, mostly for Windows devices, it was formatted as the FAT file system (Duh...). FAT is an older and slower file system without the concept of file ownership. Not to mention Microsoft holds patents for which they demand royalties from OEM's for long file name support on the FAT file system, etc...

So what are MTP and PTP?

MTP (Media Transfer Protocol) is a subset of PTP (Picture Transfer Protocol) communication protocols that allow transferring media files from and to portable devices. These protocols have been around for a while but they are new to Android. They are considered better solutions to the problems UMS had. When a foreign system accesses the phone via MTP, it sends queries to Android and Android returns with the list of files requested. Then it downloads files. This allows access to file levels rather than exclusively opens up the entire storage portion and also allows Android choose which files to present.

This also enables Android format its storage device with ext3/ext4 or any other file systems - no longer limited to FAT!

PTP works the similar way and is mostly used by digital cameras.

For more information, please refer to Android USB Connections explained MTP, PTP, and USB Mass Storage

Now, some terminologies are out of the way, I tried transferring some photos from my Note 4 to slacky64 using MTP. Hm? It's very slow loading photos and it's even slower transferring them. Also, after photos were copied over, not only were their timestamp changed to current date and time instead of date and time taken but my photo viewer program also couldn't display them. That's not good...

I was hoping PTP would work better but no luck. It was even worse; I couldn't even get photos listed in my file manager.

Now, I went on a hunt for better ways to transfer photos.

I tried sftp and scp (with an option to retain the original timestamp) but its process kept dying on me while in the middle of transferring files.

I was kind of frustrated with this. Then, I found dukto in Google Play. It had good reviews and high rating points. I was a bit concerned about this program needing be installed on all devices, but, what the heck, as long as it'll transfer photos, I would be happy at this point.

Installation on the Android device was breeze. There were some extra steps needed to install it on my Slackware system because dukto was available in binary packages for CentOS, Fedora, OpenSUSE, RHEL, and Ubuntu and no source. This means the rpm package needs to be converted to the tgz format with the rpm2tgz command.

Converting rpm with rpm2tgz

Slackware comes with a handy utility to convert rpm files to tgz files. All you need is to run rpm2tgz with rpm file: # cd /tmp # rpm2tgz dukto-6.0-13.1.x86_64.rpm ... Slackware package /tmp/dukto-6.0-13.1.x86_64.tgz created # installpkg /tmp/dukto-6.0-13.1.x86_64.tgz Verifying package dukto-6.0-13.1.x86_64.tgz. Installing package dukto-6.0-13.1.x86_64.tgz: PACKAGE DESCRIPTION: Package dukto-6.0-13.1.x86_64.tgz installed. #

VoilĂ ! The conversion and installation went successful. To run the program, execute dukto: $ dukto

dukto_slacky64

Transferring Files

To transfer file from the Android device to PC:

  1. Open dukto on both devices
  2. On the Android device, click on the icon you want to send your files
  3. Choose Send some files and folders if you are sending files
  4. Locate files you wish to send
  5. Check files
  6. Click on the Send icon

Once selected files have been transferred, the confirmation message is displayed.

dukto_send

Transferring files was snap. In my opinion, the best way to transfer files for Android devices. Although this was the best method by far, I should note that the timestamp of transferred files was still changed. At this point, it's no longer a big issue because file name contains the date taken and this info as well as the time were embedded to file itself.

There are some drawbacks of this program:

  • There is no "select all" button. If you want to copy 100 files, you need to select all those files manually (or you could select a folder)
  • dukto needs to be running on both devices simultaneously
  • dukto must be active while transferring files; otherwise, it halts the process. This means no screensaver as well

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others. I will NOT take any responsibility of end result after following these steps (although I will try to help if you send me your questions/problems).

That's all!
-gibb