Skip to main content

Posts

Showing posts with the label Linux

Script to get Disabled users in IICS

 Script to get Disabled users in IICS   This script user Informatica Cloud APIs to get user details and pulls disabled and locked users even if SAML is integrated. You need to replace username, password, send email, receiver email and SMPT server so that it generated disabled users list for that org in the same path from where you are running the script.  import requests import json import sys import datetime import smtplib, ssl from email.mime.base import MIMEBase from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart filename= "userslist.txt" username = "username" password = "Password" current_timestamp = datetime.datetime.utcnow().strftime( '%Y-%m-%d %H:%M:%S' ) with open (filename, 'w' ) as f: f.write(current_timestamp+ ' \n ' ) username = username password = password url = "https://dm-us.informaticacloud.com/saas/public/core/v3/login" payload = json.dumps({ "username" : user...

Tableau Linux External File Store Configuration

1. Mount EFS Mount point on all the nodes and provide the user id for tableau run the ownership on the mount.  2. stop the services using tsm stop   3. stop Administrative services on all nodes using below command.                /opt/tableau/tableau_server/packages/scripts.2021x.xx.xxxx.x/stop-administrative-services  4.Contact your infra team to change all tableau user id to same on all servers and change the ownership of files where the old UID and GID is the owner of them. IG GID is 991       U pdate UID and GID manually in /etc/passwd and /etc/group file      find / -group 991 -exec chgrp -h tableau {} \;         find / -user 991 -exec chown -h tableau {} \;         cd /etc/systemd/system/         cp -p user@ .service user@new_gid.service         chmod +x user@new_gid.service    ...

Directory File Size on Linux

 To find Mount points size on the servers. : df -k To find current directory size : du -sh To find the current subdirectories and file sizes of current directory: du -h To find the current subdirectories and file sizes of current directory with sort: du -h |sort -h

Change Permissions in Numeric Code in Linux

Change Permissions in Numeric Code in Linux You may need to know how to change permissions in numeric code in Linux, so to do this you use numbers instead of “r”, “w”, or “x”. 0 = No Permission 1 = Execute 2 = Write 4 = Read Basically, you add up the numbers depending on the level of permission you want to give. example of changing permissions in numeric code in Linux Permission numbers are: 0 = --- 1 = --x 2 = -w- 3 = -wx 4 = r- 5 = r-x 6 = rw- 7 = rwx For example: chmod 777 foldername will give read, write, and execute permissions for everyone. chmod 700 foldername will give read, write, and execute permissions for the user only. chmod 327 foldername will give write and execute (3) permission for the user, w (2) for the group, and read, write, and execute for the users.

Basics of VI editor

VI Editor In Unix or Linux Operating systems, we use VI editor to create scripts or make changes to configuration files or programs. Below commands might be useful for you at the initial stages. Procedure to create or edit file is as shown below. Open the terminal application in Linux or Unix Next, open a file or create a file in  vi, type: vi filename To save a file in  vi, press Esc key, type :w and hit Enter key One can save a file and quit  Vi by pressing Esc key, type :x or :wq! and hit Enter key. If you do not want to save any changes, first press Esc key. To exit Vi without saving changes press :q! followed by ENTER key Summary of vim/vi commands Command Description Press the  ESC  key Type  :q! Press the  ENTER  key Exit vim without saving changes i.e. discards any changes you made. Press the  ESC  key Type  :wq Press the  ENTER  key Save a file and exit. Press the  ESC  key T...

Understanding Crontab

Crontab Cron is utility to schedule commands at specific time.Cron is generally used for running scheduled backups, monitoring disk space, deleting files (for example log files) periodically which are no longer required, running system maintenance tasks and a lot more. Format of Crontab: Minute(0-59) Hour(0-24) Day_of_month(1-31) Month(1-12) Day_of_week(0-6) Command_to_execute Commands to remember for Cron #Display contents of crontab $ crontab -l #edit cron jobs $ crontab -e #edit the crontab of a different user $ crontab -u <User> -e #To remove all cron jobs for the current user $ crontab -r Example: To run a cron job at every minute * * * * * <command-to-execute> To run cron job at every 5th minute */5 * * * * <command-to-execute> To run a cron job every hour at minute 30 30 * * * * <command-to-execute> To run a cron job every 2 hours 0 */2 * * * <command-to-execute> To run a cron job every day at 2 PM 0  14 * * ...