Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Saturday, February 11, 2017

How to mount QNAP shared folder in Linux

QNAP is the popular Network Attached Storage(NAS) are systems that consist of one or more hard drives. For more information about QNAP refer to this link here.
In this how to am going to show you how to mount a shared folder in QNAP in your machine running Linux. To mount the shared folder follow the steps below:

1. Log in to your NAS and create a shared folder.

a. Login to your NAS and go to Control Panel --> Previlege Settings --> Shared Folders


b. Create a shared folder by clicking Create then select Shared Folder, give a folder any name of your preference then create.


c. After creating the folder edit Folder Shared Permission which is found on Action section.
On select permission type choose NFS host access then access rights choose No Limit, on Host/IP/Network you may specify your network or leave it black.


Click Apply to save your settings.


2. Login to your linux machine and mount the shared folder.

a. Create a mount folder in your computer

$cd /home/james/Documents/
$ mkdir MyBackup
I have created a folder in my Document named MyBackup. 

 b. Install nfs helper program by command below.

$sudo apt-get install nfs-common 

 c.Mount the partition by running below command.

$sudo mount -t nfs A.B.C.D:/MyData /home/james/Documents/MyBackup 

 where: A.B.C.D is IP address of QNAP server.

 After running the command go your computer and you will see the shared folder mounted with exactly size.

Which means anything saved in this shared folder in your computer will be uploaded directly to your NAS.

3.To unmount the shared folder anytime run the following command.

$sudo umount -t nfs A.B.C.D:/MyData /home/james/Documents/MyBackup

Enjoy.

Friday, April 15, 2016

How to stream movies on Samsung smart TV using Popcorn Time in Linux

If you're movies and torrent lovers, you might have heard of Popcorn Time. For those new to this technology Popcorn Time is  a multi-platform, free software BitTorrent client that includes an integrated media player. The applications provide a free alternative to subscription-based video streaming services (such as Netflix). Popcorn Time uses sequential downloading to stream video listed by several torrent websites (although other trackers can be added and used manually).
The software has been closed several times due to copyright issues, but now is available again, am going to explain step by step on how to stream movies on smart TV from Popcorn Time software running on Linux Machine (Deepin Linux which is based on Ubuntu 14) in the following easy steps.

a. Download the Popcorn software from its current offical site.

The current site is  https://popcorntime.sh/


Save the file in any of your preferred place, for mine it goes to Downloads.

b. Extract the downloaded file.

The extracted file will be called Linux but you may name it to any name of your preference.

c. Open the extracted folder and run the file called Popcorn-Time.

Inside the extracted folder you're going to find 3 folders and 8 files as seen below.


Below is the next screen after running Popcorn-Time file.

d. Choose movie,series, anime etc of your choice and start streaming.

Below is what i choose for demonstration.


e. Connect Popcorn-Time to To Samsung smart TV.

If your smart TV is connected in the same network where your computer is connected, you will see it when you click Watch now icon on selected movie as seen below,


As you can see above the watch now icon shows which media you can stream the movie from, which are TV (my Samsung LED smart TV), VLC (because is installed on my machine) and butter (default Popcorn Time media) players.Choose Samsung TV for streaming and press Watch now.

f. Allow Popcorn-Time to stream on your TV and Enjoy.

If it the first time to connect Popcorn to your TV you may have to allow it to access your TV.


After connecting and while the downloading is on progress also the streaming will be on progress.

  
Endelea kumovika, tuonane mara nyingine.



Monday, July 27, 2015

How to mount/connect usb drive in Linux server

If you want to copy something from/to the server from usb drive, your required to connect it or simply mounting the usb, below are steps

a. Connect the usb drive to the server

b. Check if it is connected by running the following command

  #fdisk -l

eg.

root@myserver:/home/admin# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000cff3c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   312580095   156039169    5  Extended
/dev/sda5          501760   312580095   156039168   8e  Linux LVM

Disk /dev/mapper/cpvirt--vg-root: 155.6 GB, 155604484096 bytes
255 heads, 63 sectors/track, 18917 cylinders, total 303915008 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/cpvirt--vg-root doesn't contain a valid partition table

Disk /dev/mapper/cpvirt--vg-swap_1: 4177 MB, 4177526784 bytes
255 heads, 63 sectors/track, 507 cylinders, total 8159232 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/cpvirt--vg-swap_1 doesn't contain a valid partition table
Note: sector size is 4096 (not 512)

Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 45600 cylinders, total 732566646 sectors
Units = sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000b061a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *         256   732566591  2930265344   83  Linux



c. Create a new mount point/directory where the usb disk will be mounted

# mkdir /mnt/sdb1


d.  Mount /dev/sdb1 which is the location of our usb disk to the new created mount point

#mount -t ext4 /dev/sdb1 /mnt/sdb1

e. To make the change permanent edit /etc/ftab with the new mount point

# echo ''/dev/sdb1 /mnt/sdb1 ext4 defaults 0 0'' >> /etc/fstab


f. Mount all entries in /etc/fstab in not already mounted

# mount -a

g. Check if the usb drive is mounted

#mount | grep sdb1

h. The mounting is done, to access usb drive content, you may run the following command

# cd /mnt/sdb1



Enjoy!



Friday, July 17, 2015

How to repair filesystem in Linux after power failure

For some of the countries, its normal to have power fluctuations and you find your linux server goes down due to power failure, when it comes up, it good linux administration practice to repair incase there is any corrupted file system due to power failure, below is the command


$ sudo Shutdown -Fr now

Only that command will make your life good after power failure. Enjoy!

Saturday, July 11, 2015

Ubuntu 14.04 Lost Password recovery

There are cases when you forget the login password of your Linux machine, as this case which happens to my friend who is new to Linux, after installing the Linux server he didn't remember the password of the user he created during installation, so he was planning to re-install the server, there is no need for doing re-installation, just follow the following procedure to recover your password.


  1. Boot your system and choose Advanced Options for Ubuntu,


    2.   Then, choose Recovery mode,


   3. It will take you to different recovery mode options,

  4. From Recovery Menu Options, choose to Drop to root shell prompt


  5. It is going to drop you on shell prompt, you need to run the following         
      commands to change you password.

       i. First is to mount root file system
           # mount -rw -o remount /
  
       ii. In case you don't remember the user you created during installation, 
           check the created users in the system by running the following
            # ls  /home/

          Output may differ, according to the user created, for this case of mine,   there was only one user called silas

       iii. Change the password of the existed user
             # passwd silas

        iv. After changing the password your done, now reboot your system
              # reboot


Hope is going to help someone, Enjoy!