Soluții

How to set Environment variables in Linux

To set an environment variable the export command is used. We give the variable a name, which is what is used to access it in shell scripts and configurations and then a value to hold whatever data is needed in the variable.

export NAME=VALUE

For example, to set the environment variable for the home directory of a manual OpenJDK 11 installation, we would use something similar to the following.

export JAVA_HOME=/opt/openjdk11

To output the value of the environment variable from the shell, we use the echo command and prepend the variable’s name with a dollar ($) sign.

echo $JAVA_HOME

And so long as the variable has a value it will be echoed out. If no value is set then an empty line will be displayed instead.

Unsetting an Environment Variable

To unset an environment variable, which removes its existence all together, we use the unset command. Simply replace the environment variable with an empty string will not remove it, and in most cases will likely cause problems with scripts or application expecting a valid value.

To following syntax is used to unset an environment variable

unset VARIABLE_NAME

For example, to unset the JAVA_HOME environment variable, we would use the following command.

unset JAVA_HOME
Listing All Set Environment Variables

To list all environment variables, we simply use the set command without any arguments.

set

An example of the output would look something similar to the following, which has been truncated for brevity.

BASH=/bin/bash
BASHOPTS=checkwinsize:cmdhist:complete_fullquote:expand_aliases:extglob:extquote:force_fignore:globasciiranges:histappend:interactive_comments:login_shell:progcomp:promptvars:sourcepath
 BASH_ALIASES=()
 BASH_ARGC=([0]="0")
 BASH_ARGV=()
 BASH_CMDS=()
 BASH_COMPLETION_VERSINFO=([0]="2" [1]="8")
 BASH_LINENO=()
 BASH_SOURCE=()
 BASH_VERSINFO=([0]="5" [1]="0" [2]="3" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")
 BASH_VERSION='5.0.3(1)-release'
 COLUMNS=208
 DIRSTACK=()
 EUID=1000
 GROUPS=()
 HISTCONTROL=ignoreboth
 HISTFILE=/home/ubuntu/.bash_history
 HISTFILESIZE=2000
 HISTSIZE=1000
 HOME=/home/ubuntu
 HOSTNAME=ubuntu1904
 HOSTTYPE=x86_64
 IFS=$' \t\n'
 LANG=en_US.UTF-8
 LESSCLOSE='/usr/bin/lesspipe %s %s'
 LESSOPEN='| /usr/bin/lesspipe %s'
 LINES=54
Persisting Environment Variables for a User

When an environment variable is set from the shell using the export command, its existence ends when the user’s sessions ends. This is problematic when we need the variable to persist across sessions.

To make an environment persistent for a user’s environment, we export the variable from the user’s profile script.

  1. Open the current user’s profile into a text editor
    vi ~/.bash_profile
  2. Add the export command for every environment variable you want to persist.
    export JAVA_HOME=/opt/openjdk11
  3. Save your changes.

Adding the environment variable to a user’s bash profile alone will not export it automatically. However, the variable will be exported the next time the user logs in.

To immediately apply all changes to bash_profile, use the source command.

source ~/.bash_profile
Export Environment Variable

Export is a built-in shell command for Bash that is used to export an environment variable to allow new child processes to inherit it.

To export a environment variable you run the export command while setting the variable.

export MYVAR="my variable value"

We can view a complete list of exported environment variables by running the export command without any arguments.

export
SHELL=/bin/zsh
SHLVL=1
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.1pB5Pry8Id/Listeners
TERM=xterm-256color
TERM_PROGRAM=vscode
TERM_PROGRAM_VERSION=1.48.2

To view all exported variables in the current shell you use the -p flag with export.

export -p
Setting Permanent Global Environment Variables for All Users

A permanent environment variable that persists after a reboot can be created by adding it to the default profile. This profile is loaded by all users on the system, including service accounts.

All global profile settings are stored under /etc/profile. And while this file can be edited directory, it is actually recommended to store global environment variables in a directory named /etc/profile.d, where you will find a list of files that are used to set environment variables for the entire system.

  1. Create a new file under /etc/profile.d to store the global environment variable(s). The name of the should be contextual so others may understand its purpose. For demonstrations, we will create a permanent environment variable for HTTP_PROXY.
    sudo touch /etc/profile.d/http_proxy.sh
  2. Open the default profile into a text editor.
    sudo vi /etc/profile.d/http_proxy.sh
  3. Add new lines to export the environment variables
    export HTTP_PROXY=http://my.proxy:8080
    export HTTPS_PROXY=https://my.proxy:8080
    export NO_PROXY=localhost,::1,.example.com
  4. Save your changes and exit the text editor.
[mai mult...]

How to create a Distribution List in Outlook

  1. Alegeți imaginea Persoane din partea de jos.

Choose the People image at the bottom

2. Faceți click pe săgeata mică de lângă Contact nou și selectați opțiunea Grup de contacte

Click the small arrow next to New Contact and select the Contact Group option

3. Denumiți noul grup de contacte și faceți dublu-clic pe lista goală de mai jos pentru a adăuga cât de mulți destinatari doriți.
4. Faceți click pe Salvare și închidere.

Click Save & Close

[mai mult...]

How to Power Automate a flow to add a DL as a member of a Team on a schedule

  1. Accesați https://make.powerautomate.com/environments/
  2. Faceți click pe Flux cloud programat

3.Introduceți numele „adăugați în echipă”. Setați repetarea la fiecare la 1 zi. Faceți click pe Creare.

4. Faceți click pe Pas nou.

5. Tastați Obțineți membrii grupului Azure AD. Derulați în jos și faceți click pe Obțineți membrii grupului Azure AD.

6.Faceți click pe Conectare

7.Introduceți numele dvs. de utilizator și apoi faceți click pe Următorul. Finalizați procesul de conectare. În pagina Permisiuni solicitate, faceți click pe Accept.

8.Luați ID-ul listei de distribuție accesând https://admin.microsoft.com/?source=applauncher#/groups și faceți clic pe Listă de distribuție. Faceți click pe lista de distribuție pentru care doriți să obțineți membri. Apoi copiați ID-ul de la adresa URL. În cazul nostru este d04bd6da-e32a-44b9-b0ac-3dc65da9b4c6.

9. Reveniți la pagina Power Automate și puneți ID-ul în câmpul Group Id. Faceți click pe Pas nou.

10. Căutare Adăugați un membru într-o echipă. Apasa pe acesta.

[mai mult...]

Add a schedule or automation on your iPhone

You can schedule a Focus to activate at certain times, when you’re at a particular location, or when you open specific apps.

iPhone screen show New Automation settings for Focus

To set a schedule based on certain times, locations, or apps:

  1. Go to Settings > Focus, then tap the Focus that you want to schedule
  2. Under Turn on Automatically, tap Add Schedule
  3. Choose when you want the automation to happen, then follow the onscreen steps.

To use Smart Activation, which will automatically apply your Focus at relevant times throughout the day:

  1. Go to Settings > Focus, then tap the Focus that you want to activate automatically
  2. Tap Smart Activation
  3. Turn on Smart Activation

When you turn on Smart Activation, it automatically turns on the Focus at relevant times throughout the day based on location, time, or app usage.

[mai mult...]