Snippets Collections
                            
curl --request GET --url https://pdfmatrix.com/api/v1/get \
    ? api_token = mcZNtIwQKgOnx7zPgz1WVkqGXeaejktZqr4E7IKYaA13UE0LLfctNIdfsV2Mgx0srz7nf9XHugUy4Yyz \
    & url = https://google.com



                            
start chrome --auto-open-devtools-for-tabs
google-chrome --auto-open-devtools-for-tabs
start chrome --auto-open-devtools-for-tabs
open -a "Google Chrome" --args --auto-open-devtools-for-tabs
$ git push -u origin feature


# Before pushing, make sure to pull the changes from the remote branch and integrate them with your current local branch.

$ git pull

$ git checkout my-feature

$ git merge origin/feature

$ git push origin my-feature:feature
shell
{
    dynamic
    {
        item(title='Hello, World!')
    }
}
httpClient() {
    curl --silent \
    	# everything in between
         --write-out "\n%{http_code}"
}

response=`httpClient #args #args .....`

http_code=`tail -n1 <<< "$response"`
body=`sed '$ d' <<< "$response"`
minikube start --driver=docker
start chrome --auto-open-devtools-for-tabs
# Use the --prefix or -p option to specify where to write the environment files. For example:
conda create --prefix /tmp/test-env python=2.7
# Delete remote branch
git push origin -d remote_branch_name

# Delete local branch
git branch -d local_branch_name

# Force delete if getting merge error
git branch -D local_branch_name
pip freeze > requirements.txt

# OR

conda list -e > requirements.txt
# windows
curl.exe https://webi.ms/shfmt | powershell

# linux
curl -sS https://webi.sh/shfmt | sh
chmod u+w /usr/local/Homebrew /usr/local/etc/bash_completion.d
sudo chown -R $(whoami) /usr/local/Homebrew /usr/local/etc/bash_completion.d
ssh-keygen -t rsa

//copy to clipboard
pbcopy < ~/.ssh/id_rsa.pub
git --version
git version 2.30.2.windows.1
start chrome --auto-open-devtools-for-tabs
# In Crosh
# Ctrl + Alt + t
vmc start termina
 lxc launch ubuntu:18.04 owo
  lxc file pull owo/usr/bin/lxc /tmp/lxc
  lxc file push /tmp/lxc penguin/usr/local/bin/
  lxc delete owo -f
  lxc config set core.https_address :8443
  lxc config set core.trust_password "a'really,good;password:^)"

# in container terminal
  lxc remote add chronos $(ip route show | awk '{print $3}' | head -n 1)
  lxc remote set-default chronos

# have fun
lxc exec container_name -- bash
# Deal with sudo authentication errors on back up
# two write permissions errors on backup restore:
# 1. check chown and chmod of sudo 
# 2. sudo: /usr/bin/sudo must be owned by uid 0 
# 3. and have the setuid bit set

# 1. sudo ownership
chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo

# 2. UID ownership
grep root /etc/passwd
# the default root should be set to:
# root:x:0:0:root:/root:/bin/bash
# if not sudoedit as above.

# 3. setuid bit
# check /usr/bin for setuid bit errors (vs. clean normal installation of distro)
# (for debian 11) incorrect configuration includes su and sudo and 8 other executables
# Incorrect format is (compare first 4 permsissions) 
# -rwxr-xr-x 1 root root 179K Feb 27 2021 sudo
# correct format is 
# -rwsr-xr-x 1 root root 182600 Feb 27  2021 /usr/bin/sudo
# prefer pkexec to nake changes 
pkexec chmod a=rx,u+ws /usr/bin/sudo
pkexec chmod a=rx,u+ws /usr/bin/su
# compare vs. a unmodified fresh virtual install of your system
# in Debian 11 8 further files need modifying

# bonus. on your way out check permissing in  /usr/lib/sudo/ and compare with base install.
sudo apt-get --only-upgrade install google-chrome-stable
git add `git ls-files --deleted`
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
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
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

Fri Apr 28 2023 17:10:03 GMT+0000 (UTC) https://pdfmatrix.com/documentation

#shell
star

Mon Apr 24 2023 06:02:03 GMT+0000 (UTC) https://developer.chrome.com/docs/devtools/open/

#shell
star

Mon Apr 24 2023 05:59:43 GMT+0000 (UTC) https://developer.chrome.com/docs/devtools/open/

#shell
star

Mon Apr 24 2023 05:59:38 GMT+0000 (UTC) https://developer.chrome.com/docs/devtools/open/

#shell
star

Mon Apr 24 2023 05:59:23 GMT+0000 (UTC) https://developer.chrome.com/docs/devtools/open/

#shell
star

Tue Apr 04 2023 04:16:03 GMT+0000 (UTC) https://devconnected.com/how-to-push-git-branch-to-remote/

#bash #shell #git
star

Thu Feb 23 2023 00:08:09 GMT+0000 (UTC) https://nilesoft.org/docs/get-started

#shell
star

Mon Jan 23 2023 21:30:02 GMT+0000 (UTC) https://minikube.sigs.k8s.io/docs/drivers/docker/

#shell
star

Thu Dec 15 2022 22:55:54 GMT+0000 (UTC) https://developer.chrome.com/docs/devtools/open/

#shell
star

Tue Dec 13 2022 19:48:40 GMT+0000 (UTC) https://devconnected.com/how-to-push-git-branch-to-remote/

#shell #git #bash
star

Tue Dec 13 2022 06:30:42 GMT+0000 (UTC) https://stackoverflow.com/questions/37926940/how-to-specify-new-environment-location-for-conda-create

#shell #bash #conda
star

Tue Dec 13 2022 06:24:01 GMT+0000 (UTC) https://www.freecodecamp.org/news/git-delete-branch-how-to-remove-a-local-or-remote-branch/

#shell #bash #git
star

Tue Dec 13 2022 06:21:47 GMT+0000 (UTC) https://iqcode.com/code/python/create-requirementstxt-conda

#shell #bash #pip #conda
star

Mon Dec 05 2022 12:47:11 GMT+0000 (UTC) https://superuser.com/questions/1723668/how-to-update-snap-store-linux-how-to-update-this

#shell
star

Fri Dec 02 2022 05:21:06 GMT+0000 (UTC) https://webinstall.dev/shfmt/

#shell #formatting #lint
star

Tue Nov 29 2022 11:23:31 GMT+0000 (UTC)

#shell
star

Tue Nov 29 2022 11:23:12 GMT+0000 (UTC)

#shell
star

Tue Nov 29 2022 11:06:31 GMT+0000 (UTC) https://www.google.com/search?q

#shell
star

Fri Nov 25 2022 09:40:33 GMT+0000 (UTC) https://www.w3schools.com/git/git_getstarted.asp

#shell
star

Sat Nov 05 2022 09:57:38 GMT+0000 (UTC) https://developer.chrome.com/docs/devtools/open/

#shell
star

Tue Oct 11 2022 13:56:28 GMT+0000 (UTC) https://itsfoss.com/apt-key-deprecated/

#shell #bash #zsh
star

Mon Oct 03 2022 15:50:07 GMT+0000 (UTC) https://github.com/edeloya/ChromeOS-Terminal-LXC-LXD

#permissions #shell #backup #chromeos
star

Thu Aug 18 2022 12:40:35 GMT+0000 (UTC) https://www.google.com/search?q

#shell #lsof
star

Wed Jul 13 2022 04:59:51 GMT+0000 (UTC) https://www.google.com/search?q

#shell
star

Thu Jul 07 2022 09:37:51 GMT+0000 (UTC) https://www.google.com/search?q

#shell #go #install
star

Sat Jul 02 2022 15:14:00 GMT+0000 (UTC) https://www.google.com/search?q

#shell
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

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 #vim #nvim
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

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