Snippets Collections
#!/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

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