Snippets Collections
sudo truncate -s 0 $(docker inspect --format='{{.LogPath}}' x)
# Reset
Color_Off='\033[0m'       # Text Reset

# Regular Colors
Black='\033[0;30m'        # Black
Red='\033[0;31m'          # Red
Green='\033[0;32m'        # Green
Yellow='\033[0;33m'       # Yellow
Blue='\033[0;34m'         # Blue
Purple='\033[0;35m'       # Purple
Cyan='\033[0;36m'         # Cyan
White='\033[0;37m'        # White

# Bold
BBlack='\033[1;30m'       # Black
BRed='\033[1;31m'         # Red
BGreen='\033[1;32m'       # Green
BYellow='\033[1;33m'      # Yellow
BBlue='\033[1;34m'        # Blue
BPurple='\033[1;35m'      # Purple
BCyan='\033[1;36m'        # Cyan
BWhite='\033[1;37m'       # White

# Underline
UBlack='\033[4;30m'       # Black
URed='\033[4;31m'         # Red
UGreen='\033[4;32m'       # Green
UYellow='\033[4;33m'      # Yellow
UBlue='\033[4;34m'        # Blue
UPurple='\033[4;35m'      # Purple
UCyan='\033[4;36m'        # Cyan
UWhite='\033[4;37m'       # White

# Background
On_Black='\033[40m'       # Black
On_Red='\033[41m'         # Red
On_Green='\033[42m'       # Green
On_Yellow='\033[43m'      # Yellow
On_Blue='\033[44m'        # Blue
On_Purple='\033[45m'      # Purple
On_Cyan='\033[46m'        # Cyan
On_White='\033[47m'       # White

# High Intensity
IBlack='\033[0;90m'       # Black
IRed='\033[0;91m'         # Red
IGreen='\033[0;92m'       # Green
IYellow='\033[0;93m'      # Yellow
IBlue='\033[0;94m'        # Blue
IPurple='\033[0;95m'      # Purple
ICyan='\033[0;96m'        # Cyan
IWhite='\033[0;97m'       # White

# Bold High Intensity
BIBlack='\033[1;90m'      # Black
BIRed='\033[1;91m'        # Red
BIGreen='\033[1;92m'      # Green
BIYellow='\033[1;93m'     # Yellow
BIBlue='\033[1;94m'       # Blue
BIPurple='\033[1;95m'     # Purple
BICyan='\033[1;96m'       # Cyan
BIWhite='\033[1;97m'      # White

# High Intensity backgrounds
On_IBlack='\033[0;100m'   # Black
On_IRed='\033[0;101m'     # Red
On_IGreen='\033[0;102m'   # Green
On_IYellow='\033[0;103m'  # Yellow
On_IBlue='\033[0;104m'    # Blue
On_IPurple='\033[0;105m'  # Purple
On_ICyan='\033[0;106m'    # Cyan
On_IWhite='\033[0;107m'   # White
#!/bin/bash

# Once you have inputted your projects directory, it gives you the option to choose which project to run.

# - It will start Docker if it's available
# - It will start Vue.js if it's available
# - It will just simply open VSCode if neither of the above is available

# Commands to run (assuming the script is in a file called 'go')

# Run the script: ./go
# Re-run the setup ./go setup
# Reset the config: ./go reset

DefaultProjectsLocation="/var/www/sites/" # Default working path
SaveFile=~/bin/.go_config # Config file name

# Colours
Reset='\033[0m'
Black='\033[0;30m'
Red='\033[0;31m' 
Green='\033[0;32m'
Blue='\033[0;34m'
BRed='\033[41m'
BGreen='\033[42m'

#() readFile - Function to make a file readable and use its variables
readFile() {
	set -a
		source <(cat $1 | sed -e '/^#/d;/^\s*$/d' -e "s/'/'\\\''/g" -e "s/=\(.*\)/='\1'/g")
	set +a
}

#() reset - Delete the config file
reset() {
	if [ -f $SaveFile ]; then
		# Delete the config file
		rm $SaveFile
	fi
	echo -e "\n${Blue}Configuration has been reset.${Reset}\n"
	exit 0
}

#() configCheck - Checking if the config exists
configCheck() {
	# Create the bin directory if it doesn't exist
	if [ ! -d ~/bin/ ]; then
		mkdir ~/bin/
		exit 0
	fi

	# Create the file or skip
	if [ ! -f ${SaveFile} ]; then
		# Create a new config file
		touch ${SaveFile}
	fi
}

#() setProjectsPath - User input for setting the projects path
setProjectsPath() {
	
	echo -e "\n${Green}Where are your projects located?${Reset}\n"
	echo -e "----------------------------------------------------------\n"
	# User Input: Enter a directory path
	read -p "Projects directory path [press Enter for ${DefaultProjectsLocation}]: " I_ProjectLocation

	# Check for user input an d assign a variable
	if [ $I_ProjectLocation ]; then
		NewProjectLocation=$I_ProjectLocation
	else
		NewProjectLocation=$DefaultProjectsLocation
	fi

	# Function for user feedback
	SaveFileUpdates() {
		echo -e "${Green}Great.${Reset}"
		echo -e "\n${Blue}Projects directory path saved as${Reset} ${Red}${NewProjectLocation}${Reset}"
		echo -e "\nIf that's incorrect, run ${Green}'./go setup'${Reset} to change the directory path.\n"
	}

	configCheck

	# Make the file readable
	readFile $SaveFile

	# Check if the config file exists and create or update it
	if [ ! ${PROJECT_LOCATION} ]; then
		# Save the location to the config file
		echo "PROJECT_LOCATION=${NewProjectLocation}" >> ${SaveFile}
		SaveFileUpdates
	else
		# Update the config file with the new location
		sed -i "s!PROJECT_LOCATION=${PROJECT_LOCATION}!PROJECT_LOCATION=${NewProjectLocation}!" ${SaveFile}
		SaveFileUpdates
	fi
}

#() setName - User input for setting their name
setName() {
	echo -e "\n"
	read -p "What's your name? [press Enter to skip]: " I_name
	echo -e "\n"

	# Check for user input an d assign a variable
	if [ $I_name ]; then
		NewName=$I_name
	else
		NewName=
	fi

	if [ $I_name ]; then
		echo -e "${Green}Hi, ${I_name}!${Reset}"

		configCheck

		readFile $SaveFile

		if [ ${USER_NAME} ]; then
			sed -i "s!USER_NAME=${USER_NAME}!USER_NAME=${NewName}!" ${SaveFile}
		else
			echo "USER_NAME=${I_name}" >> ${SaveFile}
		fi
		
		echo -e "\n${Blue}Your name has been saved.${Reset}\n"
	else
		configCheck
		readFile $SaveFile
		if [ ${USER_NAME} ]; then
			sed -i "s!USER_NAME=${USER_NAME}!!" ${SaveFile}
		fi
		echo -e "${Blue}No problem, We don't have to be friends.${Reset}\n"
	fi
}

#() setup - Setup menu
setup() {
	clear
	PS3=$'\nWhat would you like to do? '
	select options in "Set your name" "Set directory path" "Reset configuration" "Exit"
	do
			if [ "$REPLY" == "1" ]; then
				echo -e "\n${Green}$options${Reset}\n"
				setName
				exit 0
			elif [ "$REPLY" == "2" ]; then
				echo -e "\n${Green}$options${Reset}\n"
				setProjectsPath
				exit 0
			elif [ "$REPLY" == "3" ]; then
				echo -e "\n${Green}$options${Reset}\n"
				reset
			else
				echo -e "\n${Blue}$options${Reset}"
				echo -e "\n${Green}Goodbye.${Reset}"
				exit 0
			fi
	done
}

#() fullSetup - Full setup that runs through steps
fullSetup() {
	clear
	echo -e "\n${Black}${BGreen} 1. Hi there, what do you want to be called? ${Reset}"
	setName
	echo -e "\n${Black}${BGreen} 2. Enter your working directory path. ${Reset}"
	setProjectsPath
	echo -e "\nYou're all setup! Run ${Green}'./go'${Reset} to get started."
	exit 0
}

#() go - Startup script
go() {

	# Check if config file exists then run the script or setup
	if [ -f ${SaveFile} ]; then
		# Make variables readable in bash
		readFile $SaveFile
		# Get path location
		ProjectsPath=${PROJECT_LOCATION}
		# Clear screen
		clear

		if [ -d $ProjectsPath ]; then

			readFile $SaveFile

			# Custom greeting
			if [ ${USER_NAME} ]; then
				Greet="Hi ${USER_NAME}, "
			else
				Greet=
			fi

			echo -e "\n${Green}${Greet}Choose which project you want to start:${Reset}"
			echo -e "\n----------------------------------------------------------\n"

			# Get a list of projects to select
			cd ${ProjectsPath}
			IFS= mapfile -t files < <(ls -t -d */)
			PS3=$'\nEnter the project number: '

			select dir in "${files[@]}"
			do
				test -n "$dir" && break
				echo -e "\n${Red}Whoops, that input isn't quite right. Put your glasses on and try again, perhaps?${Reset}"
				exit 0
			done

			# Set working path
			WorkPath=${ProjectsPath}${dir}/

			echo -e "\n${Green}Hold your horses, checking for ${Red}${dir}${Reset}\n"

			# Check if the inputted directory exists
			if [ -d ${WorkPath} ]; then

					echo -e "${Green}Looks good, starting ${Red}${dir}${Reset}\n"

					# Change directory
					cd ${ProjectsPath}${dir}

					# Check if a yml file exists
					if [ -f *"docker"* ]; then
						echo -e "${Blue}Docker detected${Reset}\n"

						# Run Docker
						docker-compose start
						echo -e "\n"

						# Open in browser if .env file exists
						ENVFILE=./.env
						if test -f "$ENVFILE"; then

							# Make env variables readable in bash
							readFile ".env"
							
							# Check if port exist
							if [ ! -z ${PORT} ]; then
								LocalPort=":${PORT}"
							else
								LocalPort=""
							fi
							echo -e "Opening http://localhost${LocalPort}"

							# Open in default browser
							xdg-open http://localhost${LocalPort}
							echo -e "${Green}done${Reset}\n"
						fi

					# Check if it's Vue
					elif [ -f ${WorkPath}/*/*.vue ]; then
						echo -e "${Blue}Vue.js detected${Reset}\n"

						# Open in VSCode
						echo -e "Opening VSCode..."
						code .
						echo -e "${Green}done${Reset}"

						echo -e "\n${Green}Starting Vue.js${Reset}"
						# Run Vue
						npm run serve
					else
						echo -e "${Blue}Nothing to run${Reset}\n"
					fi

				# Open in VSCode
				echo -e "Opening VSCode..."
				code .
				echo -e "${Green}done${Reset}"

			fi

			echo -e "\n----------------------------------------------------------\n"
		else
			echo -e "\n\n${Black}${BRed} Argh. ${Reset}"
			echo -e "\n${Red}It's all gone to pot. Your projects directory doesn't seem to exist.${Reset}\n"
			
			read -r -p "Would you like to re-enter your path? [Y/n]: " I_answer

			# Check user's input
			if [ "$I_answer" == "y" ] || [ "$I_answer" == "Y" ]; then
				setProjectsPath
			else
				echo -e "\n${Green}Fair enough, safe travels."
				exit 0
			fi
		fi

	else
		fullSetup
	fi

}

# Run setup if the user has inputted the setup variable
if [ "$1" == "setup" ]; then
	setup
elif [ "$1" == "name" ]; then
	clear
	setName
	exit 0
elif [ "$1" == "reset" ]; then
	clear
	reset
fi

go # Run the script
1. Restore DB from a snapshot on AWS console.
2. Test connection and data need to restore
    mysql -h vpc-olivia-prod-2022-06-10-05-31.coeq9p2f0vzm.us-east-1.rds.amazonaws.com -u apply -pakGbvgzeEy applydb -A
3. Dump the ai_company_areas, ai_areas_users, ai_conversation_locs, ai_leads by company_id
    mkdir restore_1351 && cd restore_1351
    mysqldump --no-tablespaces --single-transaction --set-gtid-purged=OFF -h vpc-olivia-prod-2022-06-10-05-31.coeq9p2f0vzm.us-east-1.rds.amazonaws.com -u apply -pakGbvgzeEy applydb ai_company_areas --where="company_id=1351" > ai_company_areas.sql
    mysqldump --no-tablespaces --single-transaction --set-gtid-purged=OFF -h vpc-olivia-prod-2022-06-10-05-31.coeq9p2f0vzm.us-east-1.rds.amazonaws.com -u apply -pakGbvgzeEy applydb ai_areas_users --where="company_id=1351" > ai_areas_users.sql
    # select GROUP_CONCAT(id SEPARATOR ",") from ai_conversations where company_id=1351;
    mysqldump --no-tablespaces --single-transaction --set-gtid-purged=OFF -h vpc-olivia-prod-2022-06-10-05-31.coeq9p2f0vzm.us-east-1.rds.amazonaws.com -u apply -pakGbvgzeEy applydb ai_conversation_locs --where="conversation_id IN (2388,3024,3025,3090,3126,3139,3206,3207,3232,3283,3316,3576,3626,3949,4126,4653,5084,5166,10084,11524,11530,11536,11551,11554,19566,19624,23390,23391,23392,23393,23394,23395,23396,23397,23398,23399,23400,43780,43785,52626,52627,52628,52629,52630,52631,58514,58515,58516,58520,70029,71744,76284,80728,80729,88485,88489,99004,99005,99846,99859,99861,99864,99870,126219,126221,139283,139284,196286,196288,196289,210399,210400,372433,372434)" > ai_conversation_locs.sql
    mysqldump --no-tablespaces --single-transaction --set-gtid-purged=OFF -h vpc-olivia-prod-2022-06-10-05-31.coeq9p2f0vzm.us-east-1.rds.amazonaws.com -u apply -pakGbvgzeEy applydb ai_leads --where="company_id=1351 AND job_loc_id>0" -f > ai_leads.sql
4. Rename to temp tables with the suffix is `_r` in the dumped files
    sed -i 's/ai_company_areas_restore/ai_company_areas_r/g' ai_company_areas.sql
    sed -i 's/ai_areas_users/ai_areas_users_r/g' ai_areas_users.sql
    sed -i 's/ai_conversation_locs/ai_conversation_locs_r/g' ai_conversation_locs.sql
    sed -i 's/ai_leads/ai_leads_r/g' ai_leads.sql
5. Load restore data to the temp tables
    mysql -h vpc-olivia-prod.coeq9p2f0vzm.us-east-1.rds.amazonaws.com -u apply -pakGbvgzeEy applydb < ai_company_areas.sql
    mysql -h vpc-olivia-prod.coeq9p2f0vzm.us-east-1.rds.amazonaws.com -u apply -pakGbvgzeEy applydb < ai_areas_users.sql
    mysql -h vpc-olivia-prod.coeq9p2f0vzm.us-east-1.rds.amazonaws.com -u apply -pakGbvgzeEy applydb < ai_conversation_locs.sql
    mysql -h vpc-olivia-prod.coeq9p2f0vzm.us-east-1.rds.amazonaws.com -u apply -pakGbvgzeEy applydb < ai_leads.sql
6. Insert restore data from temp tables to the main tables
    SET foreign_key_checks = 0;
    # verify the number of restore rows
    SELECT count(*) FROM ai_company_areas_r;
    SELECT count(*) FROM ai_areas_users_r;
    SELECT count(*) FROM ai_conversation_locs_r;
    SELECT count(*) FROM ai_leads_r;

    # Restore
    INSERT IGNORE INTO ai_company_areas SELECT * FROM ai_company_areas_r;
    INSERT IGNORE INTO ai_areas_users SELECT * FROM ai_areas_users_r;
    INSERT IGNORE INTO ai_conversation_locs SELECT * FROM ai_conversation_locs_r;
    UPDATE ai_leads t1 INNER JOIN ai_leads_r t2 ON t1.id = t2.id SET t1.job_loc_id = t2.job_loc_id WHERE t1.company_id = 1351;
    SET foreign_key_checks = 1;
7. Drop restore tables (!!!!!!!!!!!!!!!!Be careful!!!!!!!!!!!!!!!!)
    drop table ai_company_areas_r;
    drop table ai_areas_users_r;
    drop table ai_conversation_locs_r;
    drop table ai_leads_r;
8. Drop the DB instance from snapshot via AWS console.
a=(a b c); x=`echo ${!a[@]}` ;echo ${x: -1} # ArrayMaxIdxNo
Press CTRL + V to enable Visual Mode.

Using the up and down arrow key, highlight the lines you wish to comment out.

Once you have the lines selected, press the SHIFT + I keys to enter insert mode.

Enter your command symbol, for example, # sign, and press the ESC key. Vim will comment out all the highlighted lines.
timezsh() {
  shell=${1-$SHELL}
  for i in $(seq 1 10); do /usr/bin/time $shell -i -c exit; done
}
#!/bin/bash

set -eu -o pipefail # fail on error and report it, debug all lines

sudo -n true
test $? -eq 0 || exit 1 "you should have sudo privilege to run this script"

echo installing the must-have pre-requisites
while read -r p ; do sudo apt-get install -y $p ; done < <(cat << "EOF"
    perl
    zip unzip
    exuberant-ctags
    mutt
    libxml-atom-perl
    postgresql-9.6
    libdbd-pgsql
    curl
    wget
    libwww-curl-perl
EOF
)

echo installing the nice-to-have pre-requisites
echo you have 5 seconds to proceed ...
echo or
echo hit Ctrl+C to quit
echo -e "\n"
sleep 6

sudo apt-get install -y tig
$ git clone https://github.com/username/repo.git
Username: your_username
Password: your_token
curl -u my_client_id:my_client_secret 'https://api.github.com/user/repos'
$ curl -H "Authorization: token OAUTH-TOKEN" https://api.github.com
$ curl -u "username" https://api.github.com
#!/usr/bin/env sh

which() {
    local path

    if [ $# -gt 0 ]; then
        for path in $(IFS=: && echo ${PATH}); do
            [ -x "${path}/${1}" ] && echo -n "${path}/${1}" && return 0
        done

        return 1
    else
        echo >&2 "Usage: which COMMAND"
        echo >&2 "Writes the full path of COMMAND to standard output"

        return 255
    fi
}
#!/usr/bin/env sh

__git_ps1() {
    git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'
}
#!/usr/bin/env bash
#
# Returns Magento document root if sourced or prints if launched as standalone
#

mageRoot="$(dirname $(realpath "${0}"))"

while [[ ! -e ${mageRoot}/app/Mage.php && ! -e ${mageRoot}/bin/magento ]]
do
    mageRoot="$(dirname $(realpath ${mageRoot}))"
done

return "${mageRoot}" 2>/dev/null || printf '%s' "${mageRoot}" && exit
kubectl exec --stdin --tty <<PODNAME>>> -n cnext-di-tst  -- /bin/bash
#!/bin/bash
# Bash Menu Script Example

PS3='Please enter your choice: '
options=("Option 1" "Option 2" "Option 3" "Quit")
select opt in "${options[@]}"
do
    case $opt in
        "Option 1")
            echo "you chose choice 1"
            ;;
        "Option 2")
            echo "you chose choice 2"
            ;;
        "Option 3")
            echo "you chose choice $REPLY which is $opt"
            ;;
        "Quit")
            break
            ;;
        *) echo "invalid option $REPLY";;
    esac
done
platform :ios, '___VARIABLE_VERSION___'

target '___PACKAGENAME___' do
  use_frameworks!

  pod 'SwiftGen'
  pod 'SwiftLint'
  
end
/*
 * select Clone or Download and Use SSH
 * You will get a URL for the SSH protocol in the form git@github.com:<user>/<repo>.git
 * Then run the following command in your working tree to tell Git to use this URL instead of the current one
 */ 
git remote set-url origin git@github.com:<user>/<repo>.git
sudo docker build . -t vitesse
from ai_jobs.models import CandidateJobJourney
from ai_api.services import Utils
job_jns = CandidateJobJourney.objects.filter(company_id=1038, journey_id=8747)
#job_jns = CandidateJobJourney.objects.filter(company_id=4318, journey_id=11941)
for jj in job_jns:

    jj_stage_settings = Utils.safe_jsonloads(jj.stage_settings)
    for k, v in jj_stage_settings.items():
        if v.get("interviewers"):
            v.update(interviewers='["r_5"]')
            jj_stage_settings[k] = v
    jj.stage_settings = Utils.safe_json_dumps(jj_stage_settings)
    jj.save()
from ai_jobs.models import Job
from ai_jobs.services import HiringTeamService
from ai_jobs.services.job_management import JobManagementService
from ai_jobs.constants.constants import JobRoleType
for job in jobs:
    try:
        hiring_manage_job_perms = HiringTeamService.get_hiring_manage_job_perms(job)
        hiring_manage_user_job_perms = hiring_manage_job_perms.get(JobRoleType.USER_ID, {})
        hiring_manage_user_job_perms.update({uid: True for uid in user_ids})
        hiring_manage_job_perms.update({JobRoleType.USER_ID: hiring_manage_user_job_perms})
        JobManagementService.update_hiring_team(
            job, users=hiring_manage_user_job_perms.keys(), hiring_manage_job_perms=hiring_manage_job_perms
        )

                             
for job in company_jobs:
    hiring_manage_job_perms = HiringTeamService.get_hiring_manage_job_perms(job)
    hiring_manage_role_job_perms = hiring_manage_job_perms.get(JobRoleType.ROLE_ID, {})
    hiring_manage_role_job_perms.update({uid: True for uid in user_ids})
    hiring_manage_job_perms.update({JobRoleType.ROLE_ID: hiring_manage_role_job_perms})
    JobManagementService.update_hiring_team(
        job, roles=hiring_manage_role_job_perms.keys(), hiring_manage_job_perms=hiring_manage_job_perms
    )
Normal Version: 
echo 'nice12343game' | sed -n 's/nice\(.*\)game/\1/p'

Jenkins Version:
sed -n 's/.*exited with code \\(.*\\)/\\1/p' stdout
export JAVA_HOME=/Users/kenmiya/workspace/Unity/2021.1.1f1/PlaybackEngines/AndroidPlayer/OpenJDK/jre
echo $JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
echo $PATH
RegistryKey key;
key = Registry.ClassesRoot.CreateSubKey(@"*\shell\UniSendTo");
string MUIVerb = "Universal Send To";
string ExtendedSubCommandsKey = @"*\shell\UniSendTo\MainMenu";         
key.SetValue("MUIVerb", MUIVerb);
key.SetValue("ExtendedSubCommandsKey",ExtendedSubCommandsKey);
RegistryKey  key1 = Registry.ClassesRoot.CreateSubKey(@"*\shell\UniSendTo\MainMenu");
key1 = Registry.ClassesRoot.CreateSubKey(@"*\shell\UniSendTo\MainMenu\shell");
RegistryKey  key2 = Registry.ClassesRoot.CreateSubKey(@"*\shell\UniSendTo\MainMenu\shell\HomePC");
string MUIVerb1 = "Home PC";
key2.SetValue("MUIVerb",MUIVerb1);
string ip = "192.168.1.22";
key2.SetValue("IP",ip);
RegistryKey key3 = Registry.ClassesRoot.CreateSubKey(@"*\shell\UniSendTo\MainMenu\shell\HomePC\command");
key3.SetValue("",@"H:\ERT\FileTransfer.exe");
alias co_today="git hist | grep 'Alex' | grep $(date +"%Y-%m-%d") | grep -v "Merge" | sed -e 's/\[[^][]*\]//g' | sed -e 's/\((^())*\)//g' | sed 's@.*|@@'"
$ duti -x R
RStudio.app
/Applications/RStudio.app
org.rstudio.RStudio
rsync через docker'овский туннель гонять вот так: rsync -e 'docker exec -i' --blocking-io -rv CONTAINER_NAME:/data ., главное не забыть добавить --blocking-io.
Restricted : aucun script ne peut être exécuté.

AllSigned : seuls les scripts signés peuvent être exécutés.

RemoteSigned : les scripts téléchargés depuis Internet doivent être signés pour être exécutés. 
	Les scripts présents sur votre poste de travail ne sont pas concernés et peuvent être exécutés.

Unrestricted : pas de restrictions. Les scripts peuvent être exécutés.

connaitre le mode d'execution
	Get-ExecutionPolicy
   
changer le mode d'execution
	Set-ExecutionPolicy <mode>

cree un utilisateur 
	New-ADUser 
		-Name <login> 
		-SamAccountName <login> 
		-UserPrincipaleName <mail> 
		-AccountPassword (ConvertTo-SecureString -AsPlainText <mdp> -Force ) 
		-PasswordNeverExpires $true
		-CannotChangePassword $true

activer Utilisateur
	Enable-ADAccount <samaccountname>
	Desable-ADAccount <samaccountname>

lancer script 
	powershell .\PATH

rechercher des utilisateur
	Get-ADUser -Filter *
	Get-ADUser -Filter * | select samAccountName, Name, UserPrincipalName | Export-Csv UserAdUTF8.csv -Encoding UTF8


cree un groupe 
	New-ADGroup $groupe -GroupScope Global

inserer des utilisateur dans un groupe
	Add-ADGroupMember -identity $groupe -Members <samAccountName>

recherche groupe
	Get-ADGroup -Filter *

afficher les utilisateur dans un groupe
	 Get-ADGroupMember $group | Select-Object name  | Export-Csv SEC.csv -Encoding UTF8

ide for powershell
	Notepad.exe	
star

Mon Jun 20 2022 04:25:03 GMT+0000 (UTC)

#shell
star

Sat Jun 18 2022 07:30:02 GMT+0000 (UTC)

#bash #shell
star

Tue Jun 14 2022 03:49:01 GMT+0000 (UTC)

#shell
star

Fri Jun 10 2022 00:38:38 GMT+0000 (UTC)

#bash #shell #cli
star

Sun Jun 05 2022 23:43:21 GMT+0000 (UTC) https://linuxhint.com/comment-multiple-lines-vim/

#shell #bash #zsh
star

Mon May 30 2022 18:16:52 GMT+0000 (UTC) https://github.com/microsoft/vscode/issues/113869

#shell #bash #zsh
star

Wed Mar 16 2022 02:14:12 GMT+0000 (UTC) https://askubuntu.com/questions/519/how-do-i-write-a-shell-script-to-install-a-list-of-applications

#bash #shell
star

Wed Jan 26 2022 14:29:32 GMT+0000 (UTC) https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

#shell
star

Wed Jan 26 2022 14:22:57 GMT+0000 (UTC) https://docs.github.com/en/rest/overview/resources-in-the-rest-api

#shell
star

Wed Jan 26 2022 14:21:53 GMT+0000 (UTC) https://docs.github.com/en/rest/overview/resources-in-the-rest-api

#shell
star

Wed Jan 26 2022 14:21:49 GMT+0000 (UTC) https://docs.github.com/en/rest/overview/resources-in-the-rest-api

#shell
star

Sat Jan 08 2022 07:33:03 GMT+0000 (UTC) https://gist.github.com/juliyvchirkov/d2c7ff01846157f58b1fc1f3a3b1e36c

#shell #sh #which
star

Sat Jan 08 2022 06:27:13 GMT+0000 (UTC) https://gist.github.com/juliyvchirkov/883a050c34e23f4b4fba6ecaeb050c3b

#sh #git #ps1 #shell
star

Sat Jan 08 2022 06:07:58 GMT+0000 (UTC) https://gist.github.com/juliyvchirkov/2c5c8d54b182528e39d4565d1632f8ee#file-magentodocumentroot-sh

#bash #magento #document_root #resolve #shell
star

Thu Nov 04 2021 13:18:02 GMT+0000 (UTC) https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/

#k8s #shell #pod
star

Mon Oct 18 2021 07:57:50 GMT+0000 (UTC) https://askubuntu.com/questions/1705/how-can-i-create-a-select-menu-in-a-shell-script

#bash #sh #script #shell #shellscript
star

Mon Sep 20 2021 09:46:36 GMT+0000 (UTC)

#shell
star

Wed Sep 15 2021 19:22:09 GMT+0000 (UTC) https://www.google.com/search?q

#shell #github
star

Tue Aug 17 2021 13:18:20 GMT+0000 (UTC)

#shell #mysql
star

Fri Jul 30 2021 13:35:57 GMT+0000 (UTC)

#shell #mysql
star

Fri Jul 30 2021 11:22:00 GMT+0000 (UTC)

#shell #mysql
star

Sun Jul 18 2021 19:18:06 GMT+0000 (UTC)

#bash #shell
star

Sun Jun 20 2021 02:03:51 GMT+0000 (UTC)

#shell #unity
star

Tue Feb 23 2021 18:17:46 GMT+0000 (UTC) https://social.msdn.microsoft.com/Forums/en-US/0397ed6f-ce8f-4bfa-9934-3246d374c128/how-to-fetch-the-value-on-the-click-of-context-menu-item-and-pass-the-same-as-a-parameter-to-the?forum

#c# #shell #registry #contextmenu
star

Wed Dec 09 2020 05:38:51 GMT+0000 (UTC) https://rud.is/b/2020/02/06/prying-r-script-files-away-from-xcode-et-al-on-macos/

#shell
star

Wed Dec 09 2020 05:38:48 GMT+0000 (UTC) https://rud.is/b/2020/02/06/prying-r-script-files-away-from-xcode-et-al-on-macos/

#shell
star

Wed Dec 09 2020 05:38:43 GMT+0000 (UTC) https://rud.is/b/2020/02/06/prying-r-script-files-away-from-xcode-et-al-on-macos/

#shell
star

Wed Oct 14 2020 17:12:11 GMT+0000 (UTC) https://habr.com/ru/post/277699/

#docker #shell
star

Sun Oct 04 2020 00:52:52 GMT+0000 (UTC)

#shell #bash

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension