Sunday, June 19, 2022

Adding Intel-microcode to your bootloader

 1. Install intel-microcode and its dependency from slackbuilds.org using the sbopkg package manager.

2.  Generate the initrd for the generic kernel by running the pkgtool command and select setup and select the mkinitrd script to generate initrd.

3.  Change into /boot directory

4.  Rename the initrd.gz as initrd-1.gz with mv -v /boot/initrd.gz /boot/initrd-1.gz

5.  now run the command 

 cat /boot/intel-ucode.cpio /boot/initrd-1.gz > /boot/initrd-intel.gz 

6. Remove the old initrd by rm -rvf /boot/initrd-1.gz

7.  Create a symlink ln -sv /boot/initrd-intel.gz /boot/initrd.gz

8. Update Lilo with lilo -v

9. The above steps are for the generic kernel in slackware. For the huge kernel

add the line intird=/boot/initrd-ucode.cpio in the  /etc/lilo.conf 

    image = /boot/vmlinuz
    initrd = /boot/intel-ucode.cpio
    root = /dev/sdaX                          #[X being the linux partition ]
    label = Linux
    read-only 

10. Run lilo -v 

11. To check if the intel-microcode has been applied download the 

spectre-meltdown-checkup script from 

https://github.com/speed47/spectre-meltdown-checker

Run this script as root it should  show STATUS: NOT VULNERABLE 

This how to is from 

https://forum.salixos.org/viewtopic.php?t=8171 


Tips to upgrade kernel in slackware

1. Never update your working kernel.

2. For upgrading the kernel download the patches.

3. Download your kernel with the command slackpkg download kernel*

4. The Downlaoded packages will be in /var/cache/packages/patches/linux-*

5. Change in to the directory as root.

6. In the terminal as root run the pkgtool command.

7. Choose the option to install packages in the current directory.

8. After installing run lilo -v

9. Reboot.

10. Uninstall the old kernel by running the pkgtool command and 

go to the uninstall section and uninstall the old kernel packages.

11. To create the generic kernel run the pkgtool command and goto setup 

and choose the first option "mkinitrd" it will create initrd and will place it in 

/boot.

12. Make a backup of /etc/lilo.conf and then edit the file to add the 

following section for generic kernel.

                    image=/boot/vmlinuz-generic-5.15.*

                    initrd=/boot/initrd.gz

                    root=/dev/sdaX    #[X being the partition no]

                    label=linux-generic

                    read-only

13. Run lilo -v 

14. Now you will have another kernel apart from the Kernel-huge that 

comes by default so if you botch one of them you will have another 

kernel to boot into.

                    


Saturday, June 18, 2022

Things to do after installing slackware

 

1.Install bash-completion from the Extra packages in the official repo. To install google-chrome download the
deb package and run the chrome slackbuild script to create the slackware package and then install with installpkg

2. Install slackpkg+ and use it to enable additional repos
Uncomment mirror you want to use in /etc/slackpkg/mirrors and run
  slackpkg update gpg
  slackpkg update
  slackpkg upgrade-all
  
3. To Install more software in slackware install sbopkg 
4. To optimize the usage of disk space automatically delete unwanted files in /tmp at shutdown. Create a 
file in /etc/rc.d called rc.local_shutdown and add the following line
  
    /usr/bin/find /tmp -mindepth 1 -maxdepth 1 -exec /bin/rm -rf {} +; 
save it and mark it as executable. 
4. Make sure your joystick does not control your mouse by creating a file in /etc/X11/xorg.conf.d called
51-joystick.conf with the following content
          
Section "InputClass"
        Identifier "joystick catchall"
        MatchIsJoystick "on"
        MatchDevicePath "/dev/input/event*"
        Driver "joystick"
        Option "StartKeysEnabled" "False"       #Disable mouse
        Option "StartMouseEnabled" "False"      #support
EndSection
5. Do not use the full Wayland display use X11 for Seamless working of software.

6. For IBus integration in KDE
 
 edit /etc/environment
 add the lines 
 GTK_IM_MODULE=ibus
 QT_IM_MODULE=ibus
 XMODIFIERS=@im=ibus

 edit ~/.bashrc and add the following lines
 
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=ibus
export XMODIFIERS=@im=ibus

To Start IBus at use login create an autostart script with the following contents

      #!/usr/bin/bash
      
      sleep 5;
      /usr/bin/ibus-autostart 
7. If you want to use virtualbox you can use Cristiano urban's shell script to install, update and uninstall
virtual box. As root run the following command other wise it would crash on startup
 
    VBoxManage setextradata global GUI/UpdateDate never
    
Link to Virtual box auto install script
 
      https://github.com/crish4cks/Bash/blob/master/vbox-autoinstall
      
8. Install the Intel-Microcode or the Amd-microcode package from slackbuild to mitigate the spectre 
vulnerability. 
 
By default you would be using the huge kernel so add the following line in /etc/lilo.conf
 
# Linux bootable partition config begins
image = /boot/vmlinuz
initrd = /boot/intel-ucode.cpio
root = /dev/sda1
label = Linux
read-only

and run lilo -v

9. To manage Appimages  download and use the Application manager program from github. Here is the link 

    https://github.com/IVAN-HC/AM-APPLICATION-MANAGER
    
10. Install Xtreme Download Manager for better integration with Firefox and Chrome. the link below

    https://github.com/subhra74/xdm
11. To install more fonts in slackware install the program fnt. This is not in the repo we have to compile it ourselves but the upshot is 
    it will download and install fonts from google and debian repo. Link below 
    https://github.com/alexmyczko/fnt  

Sunday, December 13, 2020

Aksharamukha: An Open Source Transliteration Tool

 We probably might have used the google transliteration or many other transliteration services, There is a new open source transliteration tool in town, its called Aksharamukha. This tools main objective is to transliterate the languages primarily in the South Asia ,South East Asia to Romanized scripts. Currently it supports 85 Languages. We can use either online or you can install this tool as a python package. 

To use it as an online tool goto this website.   Select the source langue and its target language and you are good to go. If you want to use it in our  computer you can use it as an python package. Run the following command 

pip3 install aksharamukha
 
Now start python3 and type 

from aksharamukha import transliterate
transliterate.process('HK', 'Telugu', 'buddhaH')

Your transliterated word will now appear in the console. Thats it.

Typesetting in Tamil Brahmi in XeLaTeX

         Recently I found that Tamil Brahmi which is the precursor to the modern Tamil Language was included in the Unicode Standard. It is encoded in the range 11000-1107F. So I thought if its encoded in Unicode I wondered if I could typeset in Latex.This is my experiment. First we need the fonts for Brahmi and fortunately there is a font called Adinatha Tamil Brahmi and also its font manual.  and another font from Google Noto-Fonts called Noto Sans Brahmi.

         I Checked if I could type freely using IBus but unfortunately you can only enter characters one at a time this would be very time consuming, Luckily for us there is a transliteration tool from the authors of the font called Aksharamukha. To transliterate, set the base as Tamil and the output as Tamil Brahmi and you are good to go. Don't set the base as Tamil extended it doesn't work. Remember Aksharamukha is not a Translation tool.  Type your work and transliterate and copy the Tamil Brahmi letters. 

       Download and install the font. Run the following commands 
 
sudo fc-cache -v
sudo mkfontscale
sudo mkdir  
 
 IF you are using LuaLaTex run the following command to load the font 
 
luaotfload-tool --find "Adinatha Tamil Brahmi"
 
This  will load the font. Now you can typeset in either XeLaTex or LuaLaTex. Since both Polyglossia and  Babel don't support the Tamil Brahmi language natively we are turning to the fontspec package.  Here is the minimal working example. 

\RequirePackage[orthodox]{nag}
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{fontenc}
\usepackage{fontspec}
\usepackage{ClearSans}
\newfontfamily{\TACtam}{Lohit Tamil}
\newfontfamily{\bram}{Adinatha Tamil Brahmi}
\begin{document}
Hello.{\TACtam{வணக்கம்}}.{\bram{𑀯𑀡𑀓𑁆𑀓𑀫𑁆}}.
\end{document} 
 
Here is the screenshot.  

Image showing containg the word hello in three languages

Well my document compiled perfectly. Once again kudos to
Vindodh Rajan, Shriramana Sharma and Udhaya Sankar for the Font and Vindoh Rajan For maintaining the Aksharamuka transliteration tool. 




 

Saturday, December 12, 2020

Some Essential difference in Writing a letter in Tamil using XeLaTeX

 
Typesetting  a Tamil letter in XeLaTeX is essentially the same as typesetting a letter in  English.But it has some significant difference. I will list it out below. 

1. Load the Polyglossia or Babel Package

To typeset in Tamil  one has to load either the polyglossia or Babel package. 
Add the following to your preamble.

\usepackage[babelshorthands=true]{polyglossia}
\enablehyphenation
\setmainlanguage{tamil}
% if you need English
\setotherlanguage{english}
\setmainfont{TAU-Barathi}[Renderer=Harfbuzz,Ligatures=TeX,Script=Tamil]
% if you need English then set the font
\newfontfamily\englishfont{Times New Roman}[Scale=MatchLowercase,Renderer=Harfbuzz,Ligatures=TeX]  
 
OR if you are using the Babel Package then add the following to your preamble 

\usepackage{babel}
\babelprovide[main, import]{tamil}
% if you need English
 \babelprovide[import]{english}
\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{TAU-Barathi}[Renderer=Harfbuzz,Ligatures=TeX,Script=Tamil]

% if you need English then set the font
\newfontfamily\englishfont{Georgia}[Scale=0.98,Renderer=Harfbuzz,Ligatures=TeX]

2. Date is Messed up. 

If you want the date to print automatically it follows Year-Month-date format Since  most people Follow either dd/mm/yyyy or month-date-year format. So you have to set manually the date, to do this load the datetime package
 
\usepackage{datetime}
\date{dd/mm/yyyy}   or
\date{month date, year} 

3. You Can't use \cc or \encl command  

Unless you create your own class and style it is impossible to use the native \cc and \encl command in the letter class. However we can do it manually in the letter class. Since CC and Enclosures are placed after the signature we manually  typeset them.
In Tamil cc is typed as நகல்  and enclosures as இணைப்புகள்.You can use the following commands after the signature in letter.

\par
நகல்:{\par\hspace{10mm}{1. அ \par\hspace{10mm} 2. ஆ}}
\par
இணைப்புகள்:{\par\hspace{10mm}
{2. அ \par\hspace{10mm} 2.ஆ}}
 

Positioning a image at the top of the page in LaTeX

 
To position an image at the top of the page first begin the page with that image and use the following packages 
  • seqsplit
  • textpos
  • graphicx   
 
To position the image as a text block, it follows the syntax

\textblockorigin{x}{y} % co-ordinates for  origin
 \begin{textblock*}{x}{x,y}% co-ordinates
\end{textblock*}
 
Now type the following code  in  your document

\begin{center}
        \textblockorigin{-18pt}{-2pt}
        \begin{textblock*}{10cm}(3cm,1cm)
            \centering
            \includegraphics[width=16.2cm]{front.jpg}
            %\noindent\hfill{\rule{\textwidth}{0.8pt}}
                \line(1,0){450}
        \end{textblock*} ~\\[3em]
    \end{center}


Popular Posts