Labels

Showing posts with label LINUX. Show all posts
Showing posts with label LINUX. Show all posts

Sunday, December 10, 2023

combine pdf in linux

PDF Arranger is a small python-gtk application, which helps the user to merge or split PDF documents and rotate, crop and rearrange their pages using an interactive and intuitive graphical interface. 


https://github.com/pdfarranger/pdfarranger

Friday, December 30, 2022

Install Slurm on my personal Fedora laptop

Slurm (Simple Linux Utility for Resource Management) is a group utilities used for managing workloads on computer clusters. It can also be sued in your personal laptop. 


  $sudo dnf install slurm slurm-slurmd slurm-slumrctld
  $sudo -u munge /usr/sbin/mungekey -v
  $sudo systemctl start munge
  $sudo systemctl status munge
  $sudo systemctl enable munge
  $munge -n | unmunge // check munge works
  $hostname -f // find out hostname
  $sudo vi  /etc/slurm/slurm.conf
  


ClusterName=localcluster
SlurmctldHost=localhost  // or hostname
MpiDefault=pmix
ProctrackType=proctrack/cgroup
ReturnToService=1
SlurmctldPidFile=/var/run/slurm/slurmctld.pid
SlurmctldPort=6817
SlurmdPidFile=/var/run/slurm/slurmd.pid
SlurmdPort=6818
SlurmdSpoolDir=/var/spool/slurm/d
SlurmUser=root
StateSaveLocation=/var/spool/slurm/ctld
SwitchType=switch/none
InactiveLimit=0
KillWait=30
MinJobAge=300
SlurmctldTimeout=120
SlurmdTimeout=300
Waittime=0

SchedulerType=sched/backfill
SelectType=select/linear
AccountingStorageType=accounting_storage/none
AccountingStoreFlags=job_comment
JobCompType=jobcomp/none
JobAcctGatherFrequency=30
JobAcctGatherType=jobacct_gather/none
SlurmctldDebug=info
SlurmctldLogFile=/var/log/slurm/slurmctld.log
SlurmdDebug=info
SlurmdLogFile=/var/log/slurm/slurmd.log
NodeName=localhost CPUs=12 Sockets=1 CoresPerSocket=6 ThreadsPerCore=2 RealMemory=10000 State=UNKNOWN
PartitionName=sbatch Nodes=ALL Default=YES MaxTime=INFINITE State=UP


change the Node information (marked as red color) to your laptop configuration. 

$ sudo systemctl start slurmctld
$ sudo systemctl status slurmctld
$ sudo systemctl enable slurmctld
$ sudo systemctl status slurmd
$ sudo systemctl enable slurmd

// test the installation
$ srun ls 


Reference:

https://src.fedoraproject.org/rpms/munge

http://docs.nanomatch.de/technical/SimStackRequirements/SingleNodeSlurm.html

https://blog.llandsmeer.com/tech/2020/03/02/slurm-single-instance.html


Sunday, May 30, 2021

SSH free password login

step1 :  Create public and private keys using ssh-key-gen on local-host

$ssh-keygen

step 2: Copy the public key to remote-host using ssh-copy-id

$ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host

step 3: login remote host and change file permission

Change the permissions of .ssh to 700

$chmod 700 .ssh

Change the permissions of .ssh/authorized_keys to 640

$chmod 640 .ssh/authorized_keys

step 4: login from local host
ssh remote-host

(Optional) Alias for remote-host name
In local host
$vi .ssh/config
and add following lines
    Host short-name
    Hostname remote-host-name
    User your_user_name
    Port your_remote_host _port

Friday, December 4, 2020

Display figure in remote machine

 

import matplotlib matplotlib.use('tkagg') import matplotlib.pyplot as plt plt.plot([1, 2, 3]) plt.show()

ssh -p port_number -X user@xxxx

Reference: https://stackoverflow.com/questions/3453188/matplotlib-display-plot-on-a-remote-machine

Sunday, November 15, 2020

Linux resource management tool Slurm

Slurm is a group utilities used for managing workloads on computer clusters.

Some clusters use Slurm as the batch queuing system and the scheduling mechanism.

Jobs are submitted to Slurm from a login node and Slurm handles scheduling these jobs on nodes.

sinfo -l command displays information about nodes and partitions.

sbatch job.sh submit a job where job.sh is the script you want to run.

scancel jobID cancels a job

squeue -u userID shows state of jobs


An example for job submit script, e.g., job.slurm 


Execute script

$ sbatch job.slurm


two examples interactive shell
$srun -n 1 --pty bash -i

$srun --mem=4096 --pty  /bin/bash --time=01:00:00

Wednesday, November 11, 2020

Show logged users in Linux

 There are few simple commands which can display who are logged in the Linux.

w

who

users

last

Typing one of these commands in the terminal, it will display the logged in users information.

Thursday, September 17, 2020

Play open red alert on chromebook

 

Command & Conquer: Red Alert is a real-time strategy game of the Command & Conquer franchise.

It is easy to play the classic open red alert game on Chromebook once you get the Linux beta.

method 1

  sudo apt update
  sudo apt install snapd
  sudo snapd install openra
  
method 2
wget https://github.com/OpenRA/OpenRA/releases/download/release-20200503/OpenRA-Red-Alert
-x86_64.AppImage
sudo chmod +x OpenRA-Red-Alert-x86_64.AppImage
./OpenRA-Red-Alert-x86_64.AppImage
enjoying your game!

Friday, August 28, 2020

Image viewer feh

feh is a light-weight, configurable and versatile image viewer.

It is very small, and good for your disk.

Example:

feh -Z -x. file_name.png

vi .bashrc and add

alias feh='feh -Z -x.'


Reference:

https://man.finalrewind.org/1/feh/