crontab for all users – linux

To check crontab contents of all users:

  • Become root user
  • cd /var /spool
  • ls – lists all the crontab
Advertisements

Tiger VNC server in Linux distributions

Installation:

  • yum install tigervnc-server

Configure for Single/Multiple users:

  • Edit vi /etc/sysconfig/vncservers and add the following
  • VNCSERVERS=”<<display_number>>:<<user_name>>”
  • Login to each user and set VNC password using command : vncpasswd
  • Then from the user login, start the server using command : vncserver :<<display_number>>

List all running VNC servers;

  • vncserver -list

Kill VNC display:

  • vncserver -kill :2

 

Multiple python versions – Anaconda create virtual environment

Install Anaconda on Linux – Last post we saw how to install Anaconda in Linux.

Now lets see how to create multiple python versions on same machine using Anaconda and using them with any compatibility issues.

Creating a new python version:

  • conda create –name <> python=<>
  • E.g : conda create –name py36 python=3.6

Using particular Python version:

There are multiple ways you can use the desired python versions.

  1. source activate <>
    • This activates the desired python env and you can install any python packages which reflects only for the activated version.
    • Also any python code you execute will use the activated version.
    • To exit this virtual env, type : source deactivate <>
  2. You can invoke directly from installed directory like below:
    • /opt/anaconda/py36/bin/python – (This invokes python 3.6)
  3. Add to PATH environmental variable and add inn bashrc:
    • export PATH=/opt/anaconda/py36/bin:$PATH
    • After adding to bashrc, type : source ~/.bashrc

List Installed Python Versions:

  • conda list

How To Install Anaconda on Linux (Ubuntu, CentOS, Fedora) – Multiple Python versions on same machine

Download Link : https://repo.continuum.io/archive/Anaconda2-4.3.1-Linux-x86_64.sh

Instructions:

  1. Download the appropriate installer in the above links
  2. Execute the following bash Anaconda<<version>>-Linux-x86_64.sh
  3. Follow the instructions and complete the installation process

Testing Anaconda installation

Alright, we are done with the installation of Anaconda, let’s see how to verify that it is working as desired, run following command on your terminal and it should show output as list.

  • conda list

You can update the installed conda / anaconda packages by using following command.

  • conda update conda

In order to uninstall Anaconda, you need to remove its installation directory completely.

 

HDFS copy/move commands

  • Copying files from HDFS to Local file system:
    • hadoop fs -get <source hdfs location> <destination local location>
  • Copying files from Local file system to HDFS:
    • hadoop fs -put <source local location> <destination hdfs location>
  • Copying from HDFS to S3 and Vice versa:
    • hadoop distcp -Dfs.s3a.awsAccessKeyId=<<access_key>> -Dfs.s3a.server-side-encryption-algorithm=AES256 -Dmapreduce.map.memory.mb=6192  -Dmapred.job.queue.name=<<queue>> -Dmapred.reduce.tasks=20 -overwrite <<hdfs://>> <<s3a://>>
    • (access_key, encryption, memory, queue, tasts, overwrite are optional)
  • Copying inside HDFS locations:
    • hadoop fs -cp <source hdfs loc> <dest hdfs loc>
  • Moving inside HDFS locations:
    • hadoop fs -mv <source hdfs loc> <dest hdfs loc>