Snippets Collections
pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org flask-wtf
sudo mkdir /mnt/z
sudo mount -t drvfs Z: /mnt/z
git branch --merged | egrep -v "(^\*|release|dev)" | xargs git branch -d
# Set URL for your scoped packages.
# For example package with name `@foo/bar` will use this URL for download
npm config set @my-org:registry https://private-gitlab.com/api/v4/projects/<your_project_id>/packages/npm/

# Add the token for the scoped packages URL. Replace <your_project_id>
# with the project where your package is located.
npm config set '//private-gitlab.com/api/v4/projects/<your_project_id>/packages/npm/:_authToken' "<your_token>"
defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "Router" "Interactor" "Builder" && killall Xcode
defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View" && killall Xcode
defaults write com.apple.screencapture include-date -bool true
wget https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer -O - -q | php -- --quiet
sudo nano /etc/default/grub

# There is a line in that: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" (like this), replace with: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"
# Save it (CTRL+O)

sudo update-grub
sudo reboot
firebase functions:config:set stripe.secret="STRIPE_SECRET_KEY_HERE"
// BASH
mkdir src
mkdir build
touch src/index.ts
touch .gitignore
touch README.md
tsc -y
npm init -y
npm install nodemon concurrently @types/express --save-dev

// package.json
...
"scripts": {
  "start:build": "tsc -w",
  "start:run": "nodemon ./build/index.js",
  "start": "concurrently npm:start:*"
},
...

// tsconfig.json
...
"outDir": "./build",
"rootDir": "./src",
...

// .gitignore
node_modules
*.env

// README.md
### Start
```bash
npm run start
```

// src/index.ts
import express from 'express'
const port = 3000
const app = express()

console.log("Hello, World!!!")

logSomething("This is a string that I'm logging")

app.listen(port, () => {
  console.log(`Listening on port ${port}`)
})
touch index.ts
mkdir src
mv index.ts ./src
//Error

PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar

//Fix

/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/bin/chmod 0600 /var/swap.1
/sbin/swapon /var/swap.1
hello@nobo-prod-server:~$ sudo lsof -i:8082
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node\x20/ 2993 root   20u  IPv6  30271      0t0  TCP *:8082 (LISTEN)
hello@nobo-prod-server:~$ ps 2993
  PID TTY      STAT   TIME COMMAND
 2993 ?        Ssl   28:43 node /home/yasas/nobo-angular/server.js
hello@nobo-prod-server:~$
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	
git rev-parse --show-toplevel

could be enough if executed within a git repo.
From git rev-parse man page:

--show-toplevel
# WARNING: This will LOCK ALL PUBLIC REPOSITORIES ON YOUR GITHUB ACCOUNT
#
# dependencies hub and jq
# - hub: hub.github.com
# - jq: https://stedolan.github.io/jq/
#
# A better alternative would be to pipe the repos into a temporary file:
# $ hub api --paginate users/amingilani/repos | jq -r '.[]."full_name"' > repos.txt
# Then manually remove your active repositories
# And archive the remaining:
# $ cat repos.txt | xargs -I {} -n 1 hub api -X PATCH -F archived=true /repos/{}
#
# Anyways, to archive all public repositories in your GitHub account:
#
hub api --paginate users/amingilani/repos | jq -r '.[]."full_name"' | xargs -I {} -n 1 hub api -X PATCH -F archived=true /repos/{}
 https://cronhub.io/ping/1f5e3410-254c-11e8-b61d-55875966d031
star

Mon Feb 15 2021 16:00:50 GMT+0000 (UTC)

#bash #python
star

Mon Feb 15 2021 09:18:48 GMT+0000 (UTC)

#bash
star

Mon Feb 15 2021 09:17:53 GMT+0000 (UTC)

#bash
star

Mon Feb 08 2021 16:11:59 GMT+0000 (UTC)

#bash
star

Tue Dec 29 2020 20:45:20 GMT+0000 (UTC)

#bash
star

Sat Dec 12 2020 01:14:26 GMT+0000 (UTC) https://macos-defaults.com/xcode/ideadditionalcounterpartsuffixes.html

#bash
star

Sat Dec 12 2020 01:14:26 GMT+0000 (UTC) https://macos-defaults.com/xcode/ideadditionalcounterpartsuffixes.html

#bash
star

Sat Dec 12 2020 01:13:52 GMT+0000 (UTC) https://macos-defaults.com/screenshots/include-date.html

#bash
star

Wed Dec 09 2020 00:38:46 GMT+0000 (UTC) https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md

#bash
star

Sun Dec 06 2020 21:15:55 GMT+0000 (UTC) https://askubuntu.com/questions/761706/ubuntu-15-10-and-16-04-keep-freezing-randomly

#bash #ubuntu
star

Wed Dec 02 2020 19:20:04 GMT+0000 (UTC)

#bash
star

Sun Nov 29 2020 16:44:07 GMT+0000 (UTC) https://forums.docker.com/t/start-a-gui-application-as-root-in-a-ubuntu-container/17069

#bash #docker #ubuntu
star

Wed Nov 18 2020 12:29:43 GMT+0000 (UTC) https://blog.sodifrance.fr/nmap-commandes-utiles/

#bash
star

Wed Nov 18 2020 00:08:27 GMT+0000 (UTC) https://youtu.be/1__Leh5MBEM

#bash
star

Sun Nov 08 2020 17:58:52 GMT+0000 (UTC)

#bash
star

Tue Oct 27 2020 05:59:09 GMT+0000 (UTC) https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors

#bash
star

Thu Oct 08 2020 05:35:47 GMT+0000 (UTC)

#bash
star

Tue Oct 06 2020 09:30:19 GMT+0000 (UTC)

#bash
star

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

#shell #bash
star

Sat Jun 13 2020 08:20:55 GMT+0000 (UTC) https://www.computerhope.com/unix/signals.htm

#bash #linux
star

Sat Jun 06 2020 16:35:29 GMT+0000 (UTC) chrome-extension://annlhfjgbkfmbbejkbdpgbmpbcjnehbb/images/saveicon.png

#bash
star

Thu Jun 04 2020 19:50:21 GMT+0000 (UTC) https://stackoverflow.com/questions/12293944/how-to-find-the-path-of-the-local-git-repository-when-i-am-possibly-in-a-subdire

#bash
star

Wed Jun 03 2020 13:35:00 GMT+0000 (UTC)

#bash
star

Fri May 22 2020 13:55:18 GMT+0000 (UTC) https://docs.cronhub.io/

#bash

Save snippets that work with our extensions

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