Tuesday, May 29, 2018

Flatpak Basic commands

Flatpak is a  packaging  format similar to exe files in  windows. With flatpak we don't have to hunt down libraries or having compilation nightmares. Apart from Flatpak there is also Appimage, Ubuntu Snap. So we will see some basic commands. 

i.First install flatpak for debian.

apt-get install flatpak

ii.   To install apps first we have to add a repository called flathub.

flatpak remote-add --if-not-exists  flathub 
https://dl.flathub.org/repo/flathub.flatpakrepo

iii. Before installing an  app we have to  install runtimes. Runtimes are basic libraries that are needed for an app to run. The available runtimes comes from freedesktop.org, GNOME  and Kde.

flatpak install flathub org.freedesktop.Platform
flatpak install flathub org.gnome.Platform
flatpak install flathub org.kde.Platform

For Gnome and Kde it will ask which version to install and always make sure you install the latest version. Also if you wish install the SDK

flatpak install flathub org.freedesktop.Sdk
flatpak install flathub org.gnome.Sdk
flatpak install flathub org.kde.Sdk 

See Flatpak available Runtimes

iv To list the apps in the remote directory

flatpak remote-ls  flathub

v. To list the apps installed in your system

flatpak list  --app

v[a]. To list the runtimes installed in your system

flatpak  list  --runtime

vi To install an app, for example VLCX
 
flatpak install org.com.videolan

vii. To uninstall an app 

flatpak uninstall org.com.videolan

viii. To update the apps

flatpak update

Flatpak command reference 

Saturday, May 12, 2018

Arch Linux Installation:What other web tutorials won't tell you.

Hey folks

If you are faithful to my blog you should know by now that i'm a great fan of  Debian, Slackware and OpenSuse. When i started linux i tried a bunch of  distros before settling into Debian and this cycle would start and end again. This past  week  I  wanted to try  Arch linux. I heard it was tougher than slackware; to people who still thinks slackware is tough lets just say they haven't tried Gentoo and by the way slackware is pretty straight forward than Arch is. So I  read some tutorials in the web about installing arch linux and here is what i found out.

0. Arch has a Rolling release model so download and use it at your own risk.
1. Download Arch linux iso
2. Create a bootable CD or USB drive.
3. Boot the installation.
4. Ping 8.8.8.8  [ or any random site you know]
5. If not run dhcpcd 

I don't know if its a problem with arch, every time i rebooted for a retry [yeah long story]  I had to reboot my modem router to get the internet working. The same problem occured also in Manjaro. Also make sure you have a wired connection not wifi we don't need to get frustrated now, do we?

5. So Rebooting your modem may help you a bit.
6. Again ping, if it works great, lets move on shall we
7. Run timedatectl status
8. set timedatectl set-ntp true
9. Now we need to partition our hard drive if your are a beginner use cfdisk
 even if you are not a beginner you can use cfdisk without getting judged.
run  the command cfdisk  you can set your partion and write the partition table

If you want to know the list of all partitions run fdisk -l 

10. Format our partition.: mkfs.ext4 /dev/sdaX  [X=1,2,3...]
11. mkswap  /dev/sdaX  [X=1,2,....]
12. swapon  /dev/sdaX  [X=1,2,....]
13. mount /dev/sdaX   /mnt

right now you should run the command pacman -Sy  
to those who don't know pacman is the package manager for archlinux just like apt-get or dpkg or slackpkg. This command will  update the package database. It will solve issues with packages integrity.
 
14. run pacstrap  /mnt base base-devel

Depending on your internet connection it will take a while. It will install all the basic packages you need. 

15.Create Fstab. genfstab >> /mnt/etc/fstab  check it with cat /mnt/etc/fstab

16. you need to chroot into your installed environment. run arch-chroot  /mnt

17.  edit /etc/locale.gen  run nano /etc/locale.gen  uncomment the necessary locales and run locale-gen

17.i. in /etc/locale.conf add the following line  LANG=en_US.UTF-8


18. run hwclock --systohc --utc

19. Make sure you are in correct time zone. for a list of time zones run  
 ls /usr/share/zoneinfo and run  
ln -sf /usr/share/zoneinfo/Region/City  /etc/localtime
this resulted in error telling me the file already exists
20. Create hostname in /etc/hostname run
                  echo hostname >> /etc/hostname

21. Install bootloader.

pacman  -S  grub os-prober fuse2

after installing run  grub-mkconfig -o /boot/grub/grub.cfg

grub-install /dev/sda

Install Fuse2 if you are dual booting. It will  detect windows  and also make sure you have enabled the boot flag enabled in windows boot partition [for win 7 or later]

22. Enable dhcpcd. systemctl enable dhcpcd

23.a set root passwd by running command passwd
If you forgot to set root passwd it is not the end of the world it will let you login automatically.  by entering your username, i.e root.
23. exit, umount /mnt, systemctl reboot 

24. After booting  you will be  in root shell. you now proceed to install GUI.

25. after you booted for the first time run
pacman -Syu 
pacman-key --init
pacman-key --populate archlinux
 The tutorials won't mention this step. But it is required to initialize the keyring.
25. Install Xorg. Pacman -S xorg

I later installed xfce4 including vlc,firefox,etc. and for the life of me  i couldn't correctly configure the display manager properly which led to successful failure [Operation success but the patient is dead] . After a while i gave up on configuring the display manager in arch and abandoned it. You just can't sit two days in a row and not have a fully functional system.So i again went back to Debian. Now i'm running Stretch.It's pretty smooth. I was reading about debootstrap method of installing debian and i'm reminded  archlinux installation is kind of like debootstrap. I think i'll give another shot another time after throughly reading about configuring about display managers.

Sunday, May 6, 2018

Thought: Candle and Candidate

Candles and Candidates have things  in common

one: Both have the same root word - cand

Two: A candle's purpose is to glow, to shine, to give light in the darkness
and a candidate's purpose is to glow in his success and to give light in the dark world [be a more positive influence in the world ]

Three: Both can be replaced.

candle (s) (noun), candles (pl)
1. A molded piece of wax, tallow, or other fatty substance, usually cylindrical in shape, encasing a wick that is burned to provide light: Before the days of gas and electricity, candles were the main sources of light at night.
2. A unit of luminous intensity, defined as a fraction of the luminous intensity of a group of 45 carbon-filament lamps; used from 1909 to 1948 as the international standard.
3. Etymology: from Ole English candel, early church-word borrowing from Latin candela, "a light, a torch"; from candere, "to shine". Candles were unknown in ancient Greece where oil lamps were used, but they were common from early times among Romans and Etruscans.

candidate (s) (noun), candidates (pl)
1. A person who seeks to run for a political office: The conservative candidate promised to eliminate high taxes while the liberal candidate said he would strive to eliminate unemployment.
2. Etymology: from Latin candidus, "white" and candidatus, "clothed in white" from the white togas, which were long, shining, white cloaks that were worn by Romans who were seeking political offices. 
When a man ran for public office in ancient Rome, he obtained a toga which was a long, shining, white cloak.
With this "shining white" outfit, the candidate stood out in a crowd and the people might have considered him to be associated with purity and goodness because of the symbolism of the garment.




Thursday, March 29, 2018

MEDITATION: THE IMPORTANCE OF PASSOVER

Passover the Jewish festival which symbolizes the liberation of Hebrews from Egypt to Israel as promised by God. How does it fit in this modern world? Have we not read in the bible that Egypt symbolizes slavery? when St Paul writes about Egypt and Zion he refers the former as the place of slavery and latter as the place of liberty.  
When Adam Sinned he sold himself and his progeny to Sin and Death and Through him the curse entered the world and is still in us and the whole world is still feeling the effects of the sin 
Therefore, just as sin came into the world through one man, and death through sin, and so death spread to all men because all sinned  Romans 5:12
 For the creation was subjected to futility, not willingly, but because of him who subjected it, in hope  that the creation itself will be set free from its bondage to decay and obtain the freedom of the glory of the children of God.For we know that the whole creation has been groaning together in the pains of childbirth until now. And not only the creation, but we ourselves, who have the first fruits of the Spirit, groan inwardly as we wait eagerly for adoption as sons, the redemption of our bodies. Romans 8: 20-23
In layman term we become Bad guys that is why St Paul says 
For one will scarcely die for a righteous person—though perhaps for a good person one would dare even to die   Romans 5:7
so What can we say about us? That we were some how the misunderstood bad guys but has good in his heart. No. The bible says that God created Man good  but humans discovered  evil ways. So what can we say, That while we are still bound to Death and sin that our Heavenly Father loved us so much He gave us his son Jesus Christ as the passover lamb to be slaughtered for our sins. 
For God so loved the world,that he gave his only Son, that whoever believes in him should not perish but have eternal life. John 3:16
 It is not our love to him but it his love that saved us from sin. 
 Christ redeemed us from the curse of the law by becoming a curse for us—for it is written, “Cursed is everyone who is hanged  on a tree” Galatians  3:13
 Christ took our Curse so that we may become free from Death and sin and become the passover lamb.  

So Let us pray to our Lord Jesus Christ that we may be liberated from Sin. In the name of the Father, The Son and The Holy Spirit, Amen.

Thursday, December 7, 2017

How to add image to audio file for uploading to youtube


1.First make sure you have FFmpeg installed.
2. Goto Terminal
3. Type the following command

ffmpeg -r 1 -loop 1 -i p1.jpg -i comp.mp3 -acodec copy -r 1 -shortest comp.flv

4. The output container may be Mp4, AVI,MOV,3GP, etc it depends on your choice.
5. Finally your output file will be in your working directory
6. Optionally you can use the -scale operator to crop or scale the image.

Tuesday, December 5, 2017

How to add album art to your audio using VLC

1. Start VLC.
2. Goto Tools -----------> Media information
3. Change the metadata
4. Goto the general tab and you will find the logo of VLC or it may have already downloaded the album art for you.
5. Right click the VLC image and select ------> Add cover art from File and click OK.
6. That's it Now you have changed your album art using VLC.

Tuesday, June 20, 2017

systemd; External hard drive time-out problem during boot.

If you have an external hard drive that is plugged in all the time but on one fine day you boot your system without the external hard  drive and  your system drops to a maintenance shell after looking through the syslog i.e journald  you find out your system got into a loop trying to mount the external hard disk. So what is the solution?
It lies in  the fstab file. In the /dev/sdb line add
nofail,x-systemd.device-timeout=1ms
and do not set it to zero it will go into infinte loop.

for more info check:
https://wiki.archlinux.org/index.php/fstab#External_devices

Thursday, February 18, 2016

Fixing NTFS partition in Debian using ntfsfix

Today my external hard drive suddenly become RAW meaning i couldn't mount it in windows or even in linux and worse I couldn't even run chkdsk utility in windows then i came across this utily called ntfsfix  while searching  for the solution.

The following is from the ntfsfix manpage:

ntfsfix  is a utility that fixes some common NTFS problems.ntfsfix is NOT a Linux version of chkdsk.  It only repairs some  fundamental  NTFS inconsistencies,  resets  the  NTFS  journal file and schedules an NTFS consistency check for the first boot into Windows. You may run ntfsfix on an NTFS volume if you think it  was  damaged  by Windows or some other way and it cannot be mounted.

so to run ntfsfix become root and give the following command

# ntfsfix -d /dev/sdb1

it will fix the most common errors in the NTFS partition.

sources:
1. http://askubuntu.com/questions/47700/fix-corrupt-ntfs-partition-without-windows
2. http://pclosmag.com/html/Issues/201205/page06.html

Sunday, December 27, 2015

Installing a custom Latex .cls

You had recently installed Latex from the repo  or from the upstream iso image. Now you want your own custom latex class file to be installed in your system. So how to install it? Just follow these instructions.

Create a directory called texmf in $HOME. Create  a  directory called  tex inside an another directory called  latex and then another directory with a name of your choice. So finally it should resemble something like this

$HOME/texmf/tex/latex/New* 

* -- Directory name of your choice.

copy your .cls and the .tex files to that directory. Open the terminial and run

mktexlsr  $HOME/texmf

that's it you have installed your very own  Latex class file.

To check if the *.cls file is installed run  kpsewhich *.cls  in the terminal as a normal user it should return the location  of the *.cls file in the terminal.

DIY: Debian from Barebones

Have you ever  wanted to build your own linux system from the ground up like arch linux or LFS if yes then read on: You know debian offers variety of builds for their users there are cd images,DVD images and even a blue-ray image then there is also the small images like netinstall images. The netinstall images downloads the packages from the internet during installation and installs the packages and conigures it. But you don't want the bleeding edge software, you want the stability of debian with the attractiveness and the ease of use you get with the other distros. So with that in mind we'll build our own debian linux system.

1. Download the netinstall image from the debian website. Burn the image to a cd or an pendrive.

2.  Start the installer and partition your hard drives and install the base system.[I assume you can deal with this stuff.]

3. After apt asks you to choose the mirror it will ask for the desktop environment to install, at that time uncheck every thing even the standard system utilities if you are installing it in a laptop choose laptop-utilities and standard system utilities and continue.

4. Then it will install the Grub boot loader and will reboot.

5. After reboot you will be presented with the command line login prompt.

6. Login as user. Become root, edit the Sources.list file. In the sources.list file remove all the lines and replace it with this

deb http://httpredir.debian.org/debian/ jessie main contrib non-free
deb http://httpredir.debian.org/debian/ jessie-updates main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free

save the file.  use the nano editor it is the easiest. httpredir is a new method of choosing your debian mirror automatically and also it results in faster downloads you can read more about it in http://httpredir.debian.org/

7. After changing your sources.list  reload apt with apt-get update.

8. Install  Xorg, Xfce4 and pulseaudio. [I'm choosing the xfce desktop because of it's ease of use and attractiveness and being lightweight] but if you prefer an another desktop environment it is your  choice.

apt-get install xorg
apt-get install pulseaudio pavucontrol
apt-get install xfce4

If you don't want pulseaudio just skip that step.

9. Install login manager. there are different login managers of choice they are gdm,kdm,xdm,lightdm and slim. I'm going with slim login manager because it's independent,lightweight and easy to configure in a single file. So,

apt-get install slim

10. Reboot with the following command 

systemctl reboot

11. Slim will configure your desktop environment and you will be presented with a  graphical login prompt.Login as user.

12. Open up the terminal. Become root, install synaptic package manager and xfce4-goodies.

apt-get install synaptic 
apt-get install xfce4-goodies

13. So we have a very skeletal desktop environment. We need to install applications to make it more functional. First let's start with graphics section. There are lot of image viewers such as gpicview,shotwell,ristretto,feh,etc. for our image viewer we'll install Shotwell image viewer. since we have installed synaptic package manager you can search for shotwell package manager.

14. So in synaptic search for font manager and install it. If you have a collection of fonts in your system you can use it to install it in your system.

15. Install  Vlc player [Necessary], Exaile music player[optional].

16. Install openjdk-7 and iced tea plugin.

17. Install Iceweasel,Icedove if you want email client,Transmission bit torrent client,Chromium web browser, flashplugin-nonfree and pepperflashplugin- nonfree. You may ask why you might need two browsers, one word: Flash.Since adobe is phasing out support for flash in linux platform and only Google is supporting flash with their own plugin you may as well get used to chromium. Chromium is the open source version of the google chrome web browser.

18. Install rar,unrar,lzma,lzip,zip and numlockx.

19. Install Atril document viewer, Fbreader. For office work you can use the kingsoft wps office  else you can install abiword for word processing and gnumeric for spreadsheet and for presentation install libreoffice-core and libreoffice impress.

20. Install Gparted for managing your partition and Ntfs-config for configuring your ntfs partition or your external hard drive.

21. If you open the VLC player at this point  it will look something that came from the  windows 98, its because VLC was written using qt library so to make it look beautiful go to tools->Preferences->force window style -> choose GTK+.

22. Install qt4-qtconfig and Gtk-chtheme.The qt4-qtconfig package will maintain GTK look and feel for all QT applications installed in your system. and the Gtk-chtheme will change the gtk themes for your apps.

23. Install all the Gtk themes and the Faenza icon theme. [I'm leaving the themes choice upto the user.]

24. Add the user to the group root. From the terminal type the following command 

usermod -a -G  root  user 

25. Install sudo and  make the user member of group sudo and add the following line in /etc/sudoers   under the heading user privilege specification.

user     ALL=(ALL:ALL) ALL

26. Download slim themes from here and here.
a.  Extract the downloaded archive.
b.  Become root  and copy the extracted folder to  /usr/share/slim/themes 
c.  Edit /etc/slim.conf
d.  Goto to the section current theme and change  the name of the theme to the one you like.
e.  In the numlock section make sure to change the value to 'on'

27. Install ttf-mscorefonts-installer from the synaptic package manager.

28. To improve your security install gufw firewall from the synaptic package manager.

29. If you have multimedia keyboard chances are that you have a lot of buttons in your keyboard that isn't mapped by default so we have to configure it. Go to settings -> keyboard ->Application shortcut  click add  a dialog box will open in the command box enter the command to perform click ok and then press the key it will mapped to that key.
For example if I want to map the print screen key to do a screenshot of my computer then goto settings -> keyboard ->application shortcut -> click add -> in the command box type \usr\bin\scrot [you must have installed scrot] click  ok and then press the print screen key in the keyboard and that's it  your shortcut is mapped to the key.
OPTIONAL:

1.If you are a fan of Manga or comics then install Comix.

2.If you need a Bible software install Xiphos.

3.If you need phonetic transliteration then install ibus,m17n-imconfig and m17n-db. And add the following lines in your .bashrc

export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus

Goto settings -> Session and Startup ->Application auto start -> name [ibus] command [/usr/bin/ibus] then go to advanced and check the boxes for gnome and kde services to start at startup.

4.  Install Geany IDE if you are learning a programing language. It supports  C, C++, Python and perl.
5. Install gnuplot,plotdrop and Rlplot [if you want the easy way].

6. If you want MATLAB alternative install Scilab.

7. For data analysis install R programming language. There is an IDE specifically for R called R-studio it is not in the repo but you can download it from their website

8. Install TeXLive2015 or from the repo and install Texmaker  if you really want to use latex.[Install perl-tk first]

9. If you are intrested in research and will be publishing papers then Install Mendeley.It can be used as an reference manager , download your papers if is open-access and can also search for papers.
  
10. If you like to play old Nintendo games then install  Nestopia.

11. If you have online storage  such as dropbox  then you can install it  by adding the following line to your sources.list.

deb http://linux.dropbox.com/debian jessie main

To import the  GPG keys of Dropbox into your apt repository, perform the following command from your terminal shell:
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 1C61A2656FB57B7E4DE0F4C1FC918B335044912E
 
reload the repo in the synaptic package manager and install dropbox from synaptic.

12 . There are  some third party repositories available for Debian.

13. Deb-multimedia hosts newer versions of multimedia packages that is shipped with debian. to add the deb-multimedia repo to your sources.llist follow these instructions.
  
wget  https://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2015.6.1_all.deb 
sudo dpkg -i deb-multimedia-keyring_2015.6.1_all.deb
apt-get update  

become root and open a file called /etc/apt/preferences using nano and add the following lines

Package: *
Pin: release a=deb-multimedia
Pin-Priority: 800

Package: *
Pin: release a=jessie
Pin-Priority: 750
 

save the file. what I did was I gave deb-multimedia repo higher priority over debian  repo when installing multimedia packages.

when you open synaptic package manager click reload then click mark all upgrades it should list upgrades install them and you are done. Also don't forget to install libdvdcss2.

 16. Some people  just want  to have Mozilla Firefox  they can dowload it from the Mozilla firefox website. Extract the package and run firefox.

17. If you are ok with iceweasel but want to have latest  version of it then follow these instructions. 

a. Install pkg-mozilla-archive-keyring from the synaptic package manager.

b. Edit your sources.list file and add  the   following lines

deb http://mozilla.debian.net/ jessie-backports iceweasel-release
 
You can install it with the following commands:
apt-get update 
apt-get install -t jessie-backports iceweasel
 
For more information you can read it in mozilla debian team's website.

18 For Indian  Languages fonts install the fonts-indic metapackage from the synaptic package manager to install  fonts Indian languages.

19. If you want oracle java for your system then do the following.

a. Install java-package from the synaptic package manager and exit.
b.Download oracle java jdk from the oracle java website.
c. Download the tar.gz version of oracle java for your architecture. 
d. open terminal and as normal user give the following commands
make-jpkg jdk-8u51-linux-x64.tar.gz
Become root and install java with the following command.  
dpkg -i oracle-java8-jdk_8u51_amd64.deb
If you need more information about goto Debian wiki.   

And that's it your very own Debian system. Here's a preview of my desktop
and my login screen.


Popular Posts