forked from vincent/notebook
finish markdown linting
This commit is contained in:
parent
e39d6dcee3
commit
efbd8ba596
@ -4,3 +4,5 @@ MD009:
|
|||||||
strict: false
|
strict: false
|
||||||
|
|
||||||
MD013: false
|
MD013: false
|
||||||
|
MD033: false
|
||||||
|
MD024: false
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# lien
|
||||||
|
|
||||||
[site permettant d'avoir les prox d'achat de masion ou terrain](https://app.dvf.etalab.gouv.fr)
|
[site permettant d'avoir les prox d'achat de masion ou terrain](https://app.dvf.etalab.gouv.fr)
|
||||||
|
|
||||||
[liste api public](https://github.com/public-apis/public-apis)
|
[liste api public](https://github.com/public-apis/public-apis)
|
@ -1,4 +1,5 @@
|
|||||||
# Mental Model
|
# Mental Model
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
- [Ask HN: Which books teach mental models?](https://news.ycombinator.com/item?id=19895407)
|
- [Ask HN: Which books teach mental models?](https://news.ycombinator.com/item?id=19895407)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# hey hey my my
|
||||||
|
|
||||||
Hey hey, my my
|
Hey hey, my my
|
||||||
Rock and roll can never die
|
Rock and roll can never die
|
||||||
There's more to the picture
|
There's more to the picture
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
>Se vouloir libre, c'est aussi vouloir les autres libres
|
# citations
|
||||||
|
|
||||||
|
> Se vouloir libre, c'est aussi vouloir les autres libres
|
||||||
|
|
||||||
simone de beauvoir
|
simone de beauvoir
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# eldorado
|
||||||
|
|
||||||
Un chevalier
|
Un chevalier
|
||||||
sur son coursier,
|
sur son coursier,
|
||||||
jour et nuit au grand galop
|
jour et nuit au grand galop
|
||||||
@ -23,4 +25,3 @@ dans les profondeurs de la terre,
|
|||||||
chevauche sans repos,
|
chevauche sans repos,
|
||||||
dit l'ombre solitaire,
|
dit l'ombre solitaire,
|
||||||
si tu cherches El Dorado !
|
si tu cherches El Dorado !
|
||||||
"
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
|
# littanie contre la peur
|
||||||
|
|
||||||
Je ne connaîtrai pas la peur, car la peur tue l'esprit. La peur est la petite mort qui conduit à l'oblitération totale. J'affronterai ma peur. Je lui permettrai de passer sur moi, au travers de moi. Et lorsqu'elle sera passée, je tournerai mon œil intérieur sur son chemin. Et là où elle sera passée, il n'y aura plus rien. Rien que moi.
|
Je ne connaîtrai pas la peur, car la peur tue l'esprit. La peur est la petite mort qui conduit à l'oblitération totale. J'affronterai ma peur. Je lui permettrai de passer sur moi, au travers de moi. Et lorsqu'elle sera passée, je tournerai mon œil intérieur sur son chemin. Et là où elle sera passée, il n'y aura plus rien. Rien que moi.
|
||||||
|
|
||||||
I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration. I will face my fear. I will permit it to pass over me and through me. And when it has gone past I will turn the inner eye to see its path. Where the fear has gone there will be nothing. Only I will remain.
|
I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration. I will face my fear. I will permit it to pass over me and through me. And when it has gone past I will turn the inner eye to see its path. Where the fear has gone there will be nothing. Only I will remain.
|
||||||
|
|
||||||
|
@ -6,13 +6,14 @@
|
|||||||
- On n'est pas là pour sucer des glaçons
|
- On n'est pas là pour sucer des glaçons
|
||||||
|
|
||||||
## audiart
|
## audiart
|
||||||
|
|
||||||
- Le jour où on mettra les cons sur orbite, t'as pas fini de tourner
|
- Le jour où on mettra les cons sur orbite, t'as pas fini de tourner
|
||||||
- Les cons, ça ose tout. C'est même à ça qu'on les reconnaît
|
- Les cons, ça ose tout. C'est même à ça qu'on les reconnaît
|
||||||
- Dans la vie on partage toujours les emmerdes, jamais le pognon.
|
- Dans la vie on partage toujours les emmerdes, jamais le pognon.
|
||||||
|
|
||||||
## inspecteur harry
|
## inspecteur harry
|
||||||
|
|
||||||
> - Lorsque je vois un adulte du sexe masculin courir derrière une femelle avec l’intention évidente de la violer, je le descends avant, c’est ma politique.
|
> Lorsque je vois un adulte du sexe masculin courir derrière une femelle avec l’intention évidente de la violer, je le descends avant, c’est ma politique.
|
||||||
> - L’intention ? Elle restait à établir.
|
> L’intention ? Elle restait à établir.
|
||||||
> - Quand un gars à poil court derrière une fille la queue en l’air avec un couteau de boucher à la main, c’est drôle, j’ai peine à croire qu’il est en train de quêter pour la croix rouge.
|
> Quand un gars à poil court derrière une fille la queue en l’air avec un couteau de boucher à la main, c’est drôle, j’ai peine à croire qu’il est en train de quêter pour la croix rouge.
|
||||||
- les avis c'est comme les trous du cul tout le monde en a un
|
> les avis c'est comme les trous du cul tout le monde en a un
|
||||||
|
@ -1 +1,3 @@
|
|||||||
|
# République Alamo
|
||||||
|
|
||||||
République. J’aime le son de ce mot. Il signifie que les gens peuvent vivre libres, parler comme bon leur semble, aller et venir, acheter ou vendre, s’enivrer ou rester sobres, selon leurs désirs. Certains mots vous font vibrer. République est l’un de ces mots qui me nouent la gorge – la même sensation qui s’empare du père voyant voit son bébé faire ses premiers pas ou son premier enfant entreprendre de se raser et parler comme un homme. Certains mots vous réchauffent le cœur. République est l’un de ces mots.
|
République. J’aime le son de ce mot. Il signifie que les gens peuvent vivre libres, parler comme bon leur semble, aller et venir, acheter ou vendre, s’enivrer ou rester sobres, selon leurs désirs. Certains mots vous font vibrer. République est l’un de ces mots qui me nouent la gorge – la même sensation qui s’empare du père voyant voit son bébé faire ses premiers pas ou son premier enfant entreprendre de se raser et parler comme un homme. Certains mots vous réchauffent le cœur. République est l’un de ces mots.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# Voyez Cela (13 éme guerrier)
|
||||||
|
|
||||||
Voyez cela je vois mon père.
|
Voyez cela je vois mon père.
|
||||||
Voyez cela je vois ma mère et mes sœurs et mes frères.
|
Voyez cela je vois ma mère et mes sœurs et mes frères.
|
||||||
Voyez cela je vois tous mes ancêtres qui sont assis et me regardent.
|
Voyez cela je vois tous mes ancêtres qui sont assis et me regardent.
|
||||||
|
@ -1 +1,3 @@
|
|||||||
|
# JS
|
||||||
|
|
||||||
[Javascript without JQuery](https://github.com/nefe/You-Dont-Need-jQuery)
|
[Javascript without JQuery](https://github.com/nefe/You-Dont-Need-jQuery)
|
||||||
|
@ -706,7 +706,6 @@ deux conception:
|
|||||||
|
|
||||||
- journal de transactions: enregistre mes transactions qui ont eu lieu depuis la derniére sauvegarde
|
- journal de transactions: enregistre mes transactions qui ont eu lieu depuis la derniére sauvegarde
|
||||||
|
|
||||||
|
|
||||||
### mode de récupération
|
### mode de récupération
|
||||||
|
|
||||||
- full (par default) obligatoire en haute dispo
|
- full (par default) obligatoire en haute dispo
|
||||||
@ -755,7 +754,6 @@ RESTORE FILELISTONLY list les fichier restaurable pour l'in des sauvegarde conte
|
|||||||
|
|
||||||
RESTORE VERIFYONLY: controle la sauvegarde
|
RESTORE VERIFYONLY: controle la sauvegarde
|
||||||
|
|
||||||
|
|
||||||
## surveillance et performance
|
## surveillance et performance
|
||||||
|
|
||||||
### Historisation des données
|
### Historisation des données
|
||||||
@ -768,6 +766,7 @@ Tables temporelles:
|
|||||||
l'intervalle de temps est ouvert a droite fermée a gauche
|
l'intervalle de temps est ouvert a droite fermée a gauche
|
||||||
|
|
||||||
interrogation temporelle
|
interrogation temporelle
|
||||||
|
|
||||||
- as-of
|
- as-of
|
||||||
- from
|
- from
|
||||||
- between
|
- between
|
||||||
@ -777,8 +776,6 @@ interrogation temporelle
|
|||||||
### verrouillages et blocages
|
### verrouillages et blocages
|
||||||
|
|
||||||
mode de verrouillage pessimiste par default
|
mode de verrouillage pessimiste par default
|
||||||
|
|
||||||
- une écriture bloque la lecture et l'écriture d'autre processus
|
- une écriture bloque la lecture et l'écriture d'autre processus
|
||||||
- le verrouillafe peut entrainner des: wait,Blocage,deadlock
|
- le verrouillafe peut entrainner des: wait,Blocage,deadlock
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,41 +5,54 @@ if not done you can meet issue during request
|
|||||||
|
|
||||||
## action
|
## action
|
||||||
|
|
||||||
**need to have postgresqk-old-upgrade installed on arch**
|
need to have **postgresqk-old-upgrade** installed on arch
|
||||||
|
|
||||||
- stop service
|
- stop service
|
||||||
|
|
||||||
```systemctl stop postgresql.service```
|
```systemctl stop postgresql.service```
|
||||||
|
|
||||||
- rename cluster directory
|
- rename cluster directory
|
||||||
```mv /var/lib/postgres/data /var/lib/postgres/olddata
|
|
||||||
|
```bash
|
||||||
|
mv /var/lib/postgres/data /var/lib/postgres/olddata
|
||||||
mkdir /var/lib/postgres/data /var/lib/postgres/tmp
|
mkdir /var/lib/postgres/data /var/lib/postgres/tmp
|
||||||
chown postgres:postgres /var/lib/postgres/data /var/lib/postgres/tmp
|
chown postgres:postgres /var/lib/postgres/data /var/lib/postgres/tmp
|
||||||
```
|
```
|
||||||
|
|
||||||
- log in postgres account
|
- log in postgres account
|
||||||
```
|
|
||||||
|
```bash
|
||||||
sudo -iu postgres
|
sudo -iu postgres
|
||||||
cd /var/lib/postgres/tmp
|
cd /var/lib/postgres/tmp
|
||||||
|
```
|
||||||
|
|
||||||
```
|
|
||||||
- launch upgrade
|
- launch upgrade
|
||||||
```
|
|
||||||
|
```bash
|
||||||
pg_upgrade -b /opt/pgsql-PG_VERSION/bin -B /usr/bin -d /var/lib/postgres/olddata -D /var/lib/postgres/data
|
pg_upgrade -b /opt/pgsql-PG_VERSION/bin -B /usr/bin -d /var/lib/postgres/olddata -D /var/lib/postgres/data
|
||||||
```
|
```
|
||||||
|
|
||||||
- check both pg_hba.conf in new and old cluster
|
- check both pg_hba.conf in new and old cluster
|
||||||
- restart server `sc-start postgresql`
|
- restart server `sc-start postgresql`
|
||||||
|
|
||||||
# sequece manipulation
|
## sequece manipulation
|
||||||
|
|
||||||
sequence are use to generate uniq identifier
|
sequence are use to generate uniq identifier
|
||||||
|
|
||||||
- get sequence value
|
- get sequence value
|
||||||
|
|
||||||
```SQL
|
```SQL
|
||||||
select * from name_seq;
|
select * from name_seq;
|
||||||
```
|
```
|
||||||
|
|
||||||
- increment sequence value
|
- increment sequence value
|
||||||
|
|
||||||
```SQL
|
```SQL
|
||||||
select nextval(name_seq);
|
select nextval(name_seq);
|
||||||
```
|
```
|
||||||
|
|
||||||
- set sequence value:
|
- set sequence value:
|
||||||
|
|
||||||
```SQL
|
```SQL
|
||||||
select setval(name_seq,newvalue);
|
select setval(name_seq,newvalue);
|
||||||
```
|
```
|
@ -1,29 +1,36 @@
|
|||||||
# Quick SQL Cheatsheet
|
# SQL Cheatsheet
|
||||||
|
|
||||||
|
## Quick SQL Cheatsheet
|
||||||
|
|
||||||
A quick reminder of all relevant SQL queries and examples on how to use them.
|
A quick reminder of all relevant SQL queries and examples on how to use them.
|
||||||
|
|
||||||
This repository is constantly being updated and added to by the community.
|
This repository is constantly being updated and added to by the community.
|
||||||
Pull requests are welcome. Enjoy!
|
Pull requests are welcome. Enjoy!
|
||||||
|
|
||||||
# Table of Contents
|
## Table of Contents
|
||||||
1. [ Finding Data Queries. ](#find)
|
|
||||||
2. [ Data Modification Queries. ](#modify)
|
1. [Finding Data Queries.](#find)
|
||||||
3. [ Reporting Queries. ](#report)
|
2. [Data Modification Queries.](#modify)
|
||||||
4. [ Join Queries. ](#joins)
|
3. [Reporting Queries.](#report)
|
||||||
5. [ View Queries. ](#view)
|
4. [Join Queries.](#joins)
|
||||||
6. [ Altering Table Queries.](#alter)
|
5. [View Queries.](#view)
|
||||||
7. [ Creating Table Query.](#create)
|
6. [Altering Table Queries.](#alter)
|
||||||
|
7. [Creating Table Query.](#create)
|
||||||
|
|
||||||
<a name="find"></a>
|
<a name="find"></a>
|
||||||
# 1. Finding Data Queries
|
|
||||||
|
## 1. Finding Data Queries
|
||||||
|
|
||||||
### **SELECT**: used to select data from a database
|
### **SELECT**: used to select data from a database
|
||||||
|
|
||||||
* `SELECT` * `FROM` table_name;
|
* `SELECT` * `FROM` table_name;
|
||||||
|
|
||||||
### **DISTINCT**: filters away duplicate values and returns rows of specified column
|
### **DISTINCT**: filters away duplicate values and returns rows of specified column
|
||||||
|
|
||||||
* `SELECT DISTINCT` column_name;
|
* `SELECT DISTINCT` column_name;
|
||||||
|
|
||||||
### **WHERE**: used to filter records/rows
|
### **WHERE**: used to filter records/rows
|
||||||
|
|
||||||
* `SELECT` column1, column2 `FROM` table_name `WHERE` condition;
|
* `SELECT` column1, column2 `FROM` table_name `WHERE` condition;
|
||||||
* `SELECT` * `FROM` table_name `WHERE` condition1 `AND` condition2;
|
* `SELECT` * `FROM` table_name `WHERE` condition1 `AND` condition2;
|
||||||
* `SELECT` * `FROM` table_name `WHERE` condition1 `OR` condition2;
|
* `SELECT` * `FROM` table_name `WHERE` condition1 `OR` condition2;
|
||||||
@ -32,17 +39,20 @@ Pull requests are welcome. Enjoy!
|
|||||||
* `SELECT` * `FROM` table_name `WHERE EXISTS` (`SELECT` column_name `FROM` table_name `WHERE` condition);
|
* `SELECT` * `FROM` table_name `WHERE EXISTS` (`SELECT` column_name `FROM` table_name `WHERE` condition);
|
||||||
|
|
||||||
### **ORDER BY**: used to sort the result-set in ascending or descending order
|
### **ORDER BY**: used to sort the result-set in ascending or descending order
|
||||||
|
|
||||||
* `SELECT` * `FROM` table_name `ORDER BY` column;
|
* `SELECT` * `FROM` table_name `ORDER BY` column;
|
||||||
* `SELECT` * `FROM` table_name `ORDER BY` column `DESC`;
|
* `SELECT` * `FROM` table_name `ORDER BY` column `DESC`;
|
||||||
* `SELECT` * `FROM` table_name `ORDER BY` column1 `ASC`, column2 `DESC`;
|
* `SELECT` * `FROM` table_name `ORDER BY` column1 `ASC`, column2 `DESC`;
|
||||||
|
|
||||||
### **SELECT TOP**: used to specify the number of records to return from top of table
|
### **SELECT TOP**: used to specify the number of records to return from top of table
|
||||||
|
|
||||||
* `SELECT TOP` number columns_names `FROM` table_name `WHERE` condition;
|
* `SELECT TOP` number columns_names `FROM` table_name `WHERE` condition;
|
||||||
* `SELECT TOP` percent columns_names `FROM` table_name `WHERE` condition;
|
* `SELECT TOP` percent columns_names `FROM` table_name `WHERE` condition;
|
||||||
* Not all database systems support `SELECT TOP`. The MySQL equivalent is the `LIMIT` clause
|
* Not all database systems support `SELECT TOP`. The MySQL equivalent is the `LIMIT` clause
|
||||||
* `SELECT` column_names `FROM` table_name `LIMIT` offset, count;
|
* `SELECT` column_names `FROM` table_name `LIMIT` offset, count;
|
||||||
|
|
||||||
### **LIKE**: operator used in a WHERE clause to search for a specific pattern in a column
|
### **LIKE**: operator used in a WHERE clause to search for a specific pattern in a column
|
||||||
|
|
||||||
* % (percent sign) is a wildcard character that represents zero, one, or multiple characters
|
* % (percent sign) is a wildcard character that represents zero, one, or multiple characters
|
||||||
* _ (underscore) is a wildcard character that represents a single character
|
* _ (underscore) is a wildcard character that represents a single character
|
||||||
* `SELECT` column_names `FROM` table_name `WHERE` column_name `LIKE` pattern;
|
* `SELECT` column_names `FROM` table_name `WHERE` column_name `LIKE` pattern;
|
||||||
@ -54,26 +64,31 @@ Pull requests are welcome. Enjoy!
|
|||||||
* `LIKE` ‘[a-c]%’ (find any values starting with “a”, “b”, or “c”
|
* `LIKE` ‘[a-c]%’ (find any values starting with “a”, “b”, or “c”
|
||||||
|
|
||||||
### **IN**: operator that allows you to specify multiple values in a WHERE clause
|
### **IN**: operator that allows you to specify multiple values in a WHERE clause
|
||||||
|
|
||||||
* essentially the IN operator is shorthand for multiple OR conditions
|
* essentially the IN operator is shorthand for multiple OR conditions
|
||||||
* `SELECT` column_names `FROM` table_name `WHERE` column_name `IN` (value1, value2, …);
|
* `SELECT` column_names `FROM` table_name `WHERE` column_name `IN` (value1, value2, …);
|
||||||
* `SELECT` column_names `FROM` table_name `WHERE` column_name `IN` (`SELECT STATEMENT`);
|
* `SELECT` column_names `FROM` table_name `WHERE` column_name `IN` (`SELECT STATEMENT`);
|
||||||
|
|
||||||
### **BETWEEN**: operator selects values within a given range inclusive
|
### **BETWEEN**: operator selects values within a given range inclusive
|
||||||
|
|
||||||
* `SELECT` column_names `FROM` table_name `WHERE` column_name `BETWEEN` value1 `AND` value2;
|
* `SELECT` column_names `FROM` table_name `WHERE` column_name `BETWEEN` value1 `AND` value2;
|
||||||
* `SELECT` * `FROM` Products `WHERE` (column_name `BETWEEN` value1 `AND` value2) `AND NOT` column_name2 `IN` (value3, value4);
|
* `SELECT` * `FROM` Products `WHERE` (column_name `BETWEEN` value1 `AND` value2) `AND NOT` column_name2 `IN` (value3, value4);
|
||||||
* `SELECT` * `FROM` Products `WHERE` column_name `BETWEEN` #01/07/1999# AND #03/12/1999#;
|
* `SELECT` * `FROM` Products `WHERE` column_name `BETWEEN` #01/07/1999# AND #03/12/1999#;
|
||||||
|
|
||||||
### **NULL**: values in a field with no value
|
### **NULL**: values in a field with no value
|
||||||
|
|
||||||
* `SELECT` * `FROM` table_name `WHERE` column_name `IS NULL`;
|
* `SELECT` * `FROM` table_name `WHERE` column_name `IS NULL`;
|
||||||
* `SELECT` * `FROM` table_name `WHERE` column_name `IS NOT NULL`;
|
* `SELECT` * `FROM` table_name `WHERE` column_name `IS NOT NULL`;
|
||||||
|
|
||||||
### **AS**: aliases are used to assign a temporary name to a table or column
|
### **AS**: aliases are used to assign a temporary name to a table or column
|
||||||
|
|
||||||
* `SELECT` column_name `AS` alias_name `FROM` table_name;
|
* `SELECT` column_name `AS` alias_name `FROM` table_name;
|
||||||
* `SELECT` column_name `FROM` table_name `AS` alias_name;
|
* `SELECT` column_name `FROM` table_name `AS` alias_name;
|
||||||
* `SELECT` column_name `AS` alias_name1, column_name2 `AS` alias_name2;
|
* `SELECT` column_name `AS` alias_name1, column_name2 `AS` alias_name2;
|
||||||
* `SELECT` column_name1, column_name2 + ‘, ‘ + column_name3 `AS` alias_name;
|
* `SELECT` column_name1, column_name2 + ‘, ‘ + column_name3 `AS` alias_name;
|
||||||
|
|
||||||
### **UNION**: set operator used to combine the result-set of two or more SELECT statements
|
### **UNION**: set operator used to combine the result-set of two or more SELECT statements
|
||||||
|
|
||||||
* Each SELECT statement within UNION must have the same number of columns
|
* Each SELECT statement within UNION must have the same number of columns
|
||||||
* The columns must have similar data types
|
* The columns must have similar data types
|
||||||
* The columns in each SELECT statement must also be in the same order
|
* The columns in each SELECT statement must also be in the same order
|
||||||
@ -81,115 +96,147 @@ Pull requests are welcome. Enjoy!
|
|||||||
* `UNION` operator only selects distinct values, `UNION ALL` will allow duplicates
|
* `UNION` operator only selects distinct values, `UNION ALL` will allow duplicates
|
||||||
|
|
||||||
### **INTERSECT**: set operator which is used to return the records that two SELECT statements have in common
|
### **INTERSECT**: set operator which is used to return the records that two SELECT statements have in common
|
||||||
|
|
||||||
* Generally used the same way as **UNION** above
|
* Generally used the same way as **UNION** above
|
||||||
* `SELECT` columns_names `FROM` table1 `INTERSECT SELECT` column_name `FROM` table2;
|
* `SELECT` columns_names `FROM` table1 `INTERSECT SELECT` column_name `FROM` table2;
|
||||||
|
|
||||||
### **EXCEPT**: set operator used to return all the records in the first SELECT statement that are not found in the second SELECT statement
|
### **EXCEPT**: set operator used to return all the records in the first SELECT statement that are not found in the second SELECT statement
|
||||||
|
|
||||||
* Generally used the same way as **UNION** above
|
* Generally used the same way as **UNION** above
|
||||||
* `SELECT` columns_names `FROM` table1 `EXCEPT SELECT` column_name `FROM` table2;
|
* `SELECT` columns_names `FROM` table1 `EXCEPT SELECT` column_name `FROM` table2;
|
||||||
|
|
||||||
### **ANY|ALL**: operator used to check subquery conditions used within a WHERE or HAVING clauses
|
### **ANY|ALL**: operator used to check subquery conditions used within a WHERE or HAVING clauses
|
||||||
|
|
||||||
* The `ANY` operator returns true if any subquery values meet the condition
|
* The `ANY` operator returns true if any subquery values meet the condition
|
||||||
* The `ALL` operator returns true if all subquery values meet the condition
|
* The `ALL` operator returns true if all subquery values meet the condition
|
||||||
* `SELECT` columns_names `FROM` table1 `WHERE` column_name operator (`ANY`|`ALL`) (`SELECT` column_name `FROM` table_name `WHERE` condition);
|
* `SELECT` columns_names `FROM` table1 `WHERE` column_name operator (`ANY`|`ALL`) (`SELECT` column_name `FROM` table_name `WHERE` condition);
|
||||||
|
|
||||||
### **GROUP BY**: statement often used with aggregate functions (COUNT, MAX, MIN, SUM, AVG) to group the result-set by one or more columns
|
### **GROUP BY**: statement often used with aggregate functions (COUNT, MAX, MIN, SUM, AVG) to group the result-set by one or more columns
|
||||||
|
|
||||||
* `SELECT` column_name1, COUNT(column_name2) `FROM` table_name `WHERE` condition `GROUP BY` column_name1 `ORDER BY` COUNT(column_name2) DESC;
|
* `SELECT` column_name1, COUNT(column_name2) `FROM` table_name `WHERE` condition `GROUP BY` column_name1 `ORDER BY` COUNT(column_name2) DESC;
|
||||||
|
|
||||||
### **HAVING**: this clause was added to SQL because the WHERE keyword could not be used with aggregate functions
|
### **HAVING**: this clause was added to SQL because the WHERE keyword could not be used with aggregate functions
|
||||||
|
|
||||||
* `SELECT` `COUNT`(column_name1), column_name2 `FROM` table `GROUP BY` column_name2 `HAVING` `COUNT(`column_name1`)` > 5;
|
* `SELECT` `COUNT`(column_name1), column_name2 `FROM` table `GROUP BY` column_name2 `HAVING` `COUNT(`column_name1`)` > 5;
|
||||||
|
|
||||||
### **WITH**: often used for retrieving hierarchical data or re-using temp result set several times in a query. Also referred to as "Common Table Expression"
|
### **WITH**: often used for retrieving hierarchical data or re-using temp result set several times in a query. Also referred to as "Common Table Expression"
|
||||||
|
|
||||||
* `WITH RECURSIVE` cte `AS` (<br/>
|
* `WITH RECURSIVE` cte `AS` (<br/>
|
||||||
`SELECT` c0.* `FROM` categories `AS` c0 `WHERE` id = 1 `# Starting point`<br/>
|
`SELECT` c0.\* `FROM` categories `AS` c0 `WHERE` id = 1 `# Starting point`<br/>
|
||||||
`UNION ALL`<br/>
|
`UNION ALL`<br/>
|
||||||
`SELECT` c1.* `FROM` categories `AS` c1 `JOIN` cte `ON` c1.parent_category_id = cte.id<br/>
|
`SELECT` c1.\* `FROM` categories `AS` c1 `JOIN` cte `ON` c1.parent_category_id = cte.id<br/>
|
||||||
)<br/>
|
)<br/>
|
||||||
`SELECT` *<br/>
|
`SELECT` *<br/>
|
||||||
`FROM` cte
|
`FROM` cte
|
||||||
|
|
||||||
|
|
||||||
<a name="modify"></a>
|
<a name="modify"></a>
|
||||||
# 2. Data Modification Queries
|
|
||||||
|
## 2. Data Modification Queries
|
||||||
|
|
||||||
### **INSERT INTO**: used to insert new records/rows in a table
|
### **INSERT INTO**: used to insert new records/rows in a table
|
||||||
|
|
||||||
* `INSERT INTO` table_name (column1, column2) `VALUES` (value1, value2);
|
* `INSERT INTO` table_name (column1, column2) `VALUES` (value1, value2);
|
||||||
* `INSERT INTO` table_name `VALUES` (value1, value2 …);
|
* `INSERT INTO` table_name `VALUES` (value1, value2 …);
|
||||||
|
|
||||||
### **UPDATE**: used to modify the existing records in a table
|
### **UPDATE**: used to modify the existing records in a table
|
||||||
|
|
||||||
* `UPDATE` table_name `SET` column1 = value1, column2 = value2 `WHERE` condition;
|
* `UPDATE` table_name `SET` column1 = value1, column2 = value2 `WHERE` condition;
|
||||||
* `UPDATE` table_name `SET` column_name = value;
|
* `UPDATE` table_name `SET` column_name = value;
|
||||||
|
|
||||||
### **DELETE**: used to delete existing records/rows in a table
|
### **DELETE**: used to delete existing records/rows in a table
|
||||||
|
|
||||||
* `DELETE FROM` table_name `WHERE` condition;
|
* `DELETE FROM` table_name `WHERE` condition;
|
||||||
* `DELETE` * `FROM` table_name;
|
* `DELETE` * `FROM` table_name;
|
||||||
|
|
||||||
<a name="report"></a>
|
<a name="report"></a>
|
||||||
# 3. Reporting Queries
|
|
||||||
|
## 3. Reporting Queries
|
||||||
|
|
||||||
### **COUNT**: returns the # of occurrences
|
### **COUNT**: returns the # of occurrences
|
||||||
|
|
||||||
* `SELECT COUNT (DISTINCT` column_name`)`;
|
* `SELECT COUNT (DISTINCT` column_name`)`;
|
||||||
|
|
||||||
### **MIN() and MAX()**: returns the smallest/largest value of the selected column
|
### **MIN() and MAX()**: returns the smallest/largest value of the selected column
|
||||||
|
|
||||||
* `SELECT MIN (`column_names`) FROM` table_name `WHERE` condition;
|
* `SELECT MIN (`column_names`) FROM` table_name `WHERE` condition;
|
||||||
* `SELECT MAX (`column_names`) FROM` table_name `WHERE` condition;
|
* `SELECT MAX (`column_names`) FROM` table_name `WHERE` condition;
|
||||||
|
|
||||||
### **AVG()**: returns the average value of a numeric column
|
### **AVG()**: returns the average value of a numeric column
|
||||||
|
|
||||||
* `SELECT AVG (`column_name`) FROM` table_name `WHERE` condition;
|
* `SELECT AVG (`column_name`) FROM` table_name `WHERE` condition;
|
||||||
|
|
||||||
### **SUM()**: returns the total sum of a numeric column
|
### **SUM()**: returns the total sum of a numeric column
|
||||||
|
|
||||||
* `SELECT SUM (`column_name`) FROM` table_name `WHERE` condition;
|
* `SELECT SUM (`column_name`) FROM` table_name `WHERE` condition;
|
||||||
|
|
||||||
<a name="joins"></a>
|
<a name="joins"></a>
|
||||||
# 4. Join Queries
|
|
||||||
|
## 4. Join Queries
|
||||||
|
|
||||||
### **INNER JOIN**: returns records that have matching value in both tables
|
### **INNER JOIN**: returns records that have matching value in both tables
|
||||||
|
|
||||||
* `SELECT` column_names `FROM` table1 `INNER JOIN` table2 `ON` table1.column_name=table2.column_name;
|
* `SELECT` column_names `FROM` table1 `INNER JOIN` table2 `ON` table1.column_name=table2.column_name;
|
||||||
* `SELECT` table1.column_name1, table2.column_name2, table3.column_name3 `FROM` ((table1 `INNER JOIN` table2 `ON` relationship) `INNER JOIN` table3 `ON` relationship);
|
* `SELECT` table1.column_name1, table2.column_name2, table3.column_name3 `FROM` ((table1 `INNER JOIN` table2 `ON` relationship) `INNER JOIN` table3 `ON` relationship);
|
||||||
|
|
||||||
### **LEFT (OUTER) JOIN**: returns all records from the left table (table1), and the matched records from the right table (table2)
|
### **LEFT (OUTER) JOIN**: returns all records from the left table (table1), and the matched records from the right table (table2)
|
||||||
|
|
||||||
* `SELECT` column_names `FROM` table1 `LEFT JOIN` table2 `ON` table1.column_name=table2.column_name;
|
* `SELECT` column_names `FROM` table1 `LEFT JOIN` table2 `ON` table1.column_name=table2.column_name;
|
||||||
|
|
||||||
### **RIGHT (OUTER) JOIN**: returns all records from the right table (table2), and the matched records from the left table (table1)
|
### **RIGHT (OUTER) JOIN**: returns all records from the right table (table2), and the matched records from the left table (table1)
|
||||||
|
|
||||||
* `SELECT` column_names `FROM` table1 `RIGHT JOIN` table2 `ON` table1.column_name=table2.column_name;
|
* `SELECT` column_names `FROM` table1 `RIGHT JOIN` table2 `ON` table1.column_name=table2.column_name;
|
||||||
|
|
||||||
### **FULL (OUTER) JOIN**: returns all records when there is a match in either left or right table
|
### **FULL (OUTER) JOIN**: returns all records when there is a match in either left or right table
|
||||||
|
|
||||||
* `SELECT` column_names `FROM` table1 ``FULL OUTER JOIN`` table2 `ON` table1.column_name=table2.column_name;
|
* `SELECT` column_names `FROM` table1 ``FULL OUTER JOIN`` table2 `ON` table1.column_name=table2.column_name;
|
||||||
|
|
||||||
### **Self JOIN**: a regular join, but the table is joined with itself
|
### **Self JOIN**: a regular join, but the table is joined with itself
|
||||||
|
|
||||||
* `SELECT` column_names `FROM` table1 T1, table1 T2 `WHERE` condition;
|
* `SELECT` column_names `FROM` table1 T1, table1 T2 `WHERE` condition;
|
||||||
|
|
||||||
<a name="view"></a>
|
<a name="view"></a>
|
||||||
# 5. View Queries
|
|
||||||
|
## 5. View Queries
|
||||||
|
|
||||||
### **CREATE**: create a view
|
### **CREATE**: create a view
|
||||||
|
|
||||||
* `CREATE VIEW` view_name `AS SELECT` column1, column2 `FROM` table_name `WHERE` condition;
|
* `CREATE VIEW` view_name `AS SELECT` column1, column2 `FROM` table_name `WHERE` condition;
|
||||||
|
|
||||||
### **SELECT**: retrieve a view
|
### **SELECT**: retrieve a view
|
||||||
|
|
||||||
* `SELECT` * `FROM` view_name;
|
* `SELECT` * `FROM` view_name;
|
||||||
|
|
||||||
### **DROP**: drop a view
|
### **DROP**: drop a view
|
||||||
|
|
||||||
* `DROP VIEW` view_name;
|
* `DROP VIEW` view_name;
|
||||||
|
|
||||||
<a name="alter"></a>
|
<a name="alter"></a>
|
||||||
# 6. Altering Table Queries
|
|
||||||
|
## 6. Altering Table Queries
|
||||||
|
|
||||||
### **ADD**: add a column
|
### **ADD**: add a column
|
||||||
|
|
||||||
* `ALTER TABLE` table_name `ADD` column_name column_definition;
|
* `ALTER TABLE` table_name `ADD` column_name column_definition;
|
||||||
|
|
||||||
### **MODIFY**: change data type of column
|
### **MODIFY**: change data type of column
|
||||||
|
|
||||||
* `ALTER TABLE` table_name `MODIFY` column_name column_type;
|
* `ALTER TABLE` table_name `MODIFY` column_name column_type;
|
||||||
|
|
||||||
### **DROP**: delete a column
|
### **DROP**: delete a column
|
||||||
|
|
||||||
* `ALTER TABLE` table_name `DROP COLUMN` column_name;
|
* `ALTER TABLE` table_name `DROP COLUMN` column_name;
|
||||||
|
|
||||||
<a name="create"></a>
|
<a name="create"></a>
|
||||||
# 7. Creating Table Query
|
|
||||||
|
## 7. Creating Table Query
|
||||||
|
|
||||||
### **CREATE**: create a table
|
### **CREATE**: create a table
|
||||||
|
|
||||||
* `CREATE TABLE` table_name `(` <br />
|
* `CREATE TABLE` table_name `(` <br />
|
||||||
`column1` `datatype`, <br />
|
`column1` `datatype`, <br />
|
||||||
`column2` `datatype`, <br />
|
`column2` `datatype`, <br />
|
||||||
`column3` `datatype`, <br />
|
`column3` `datatype`, <br />
|
||||||
`column4` `datatype`, <br />
|
`column4` `datatype`, <br />
|
||||||
`);`
|
`);`
|
||||||
|
:q
|
||||||
|
:q
|
||||||
|
@ -5,23 +5,25 @@ voir version:
|
|||||||
`select @@version`
|
`select @@version`
|
||||||
|
|
||||||
passer une base en mode single user
|
passer une base en mode single user
|
||||||
` ALTER DATABASE [toto] SET SINGLE_USER WITH ROLLBACK IMMEDIATE`
|
|
||||||
|
`ALTER DATABASE [toto] SET SINGLE_USER WITH ROLLBACK IMMEDIATE`
|
||||||
|
|
||||||
passer en mode multi user
|
passer en mode multi user
|
||||||
|
|
||||||
`alter database [toto] set MULTI_USER`
|
`alter database [toto] set MULTI_USER`
|
||||||
|
|
||||||
|
|
||||||
voir la configuration
|
voir la configuration
|
||||||
`exec sp_configure`
|
`exec sp_configure`
|
||||||
|
|
||||||
activé affichage des option avancé
|
activé affichage des option avancé
|
||||||
|
|
||||||
```SQL
|
```SQL
|
||||||
exec sp_configure 'show advanced options', 1;
|
exec sp_configure 'show advanced options', 1;
|
||||||
REconfigure;
|
REconfigure;
|
||||||
```
|
```
|
||||||
|
|
||||||
autorisé la mise en autonomie partielle des bases
|
autorisé la mise en autonomie partielle des bases
|
||||||
|
|
||||||
```SQL
|
```SQL
|
||||||
exec sp_configure 'contained database authentication',1;
|
exec sp_configure 'contained database authentication',1;
|
||||||
reconfigure
|
reconfigure
|
||||||
@ -39,11 +41,13 @@ reconfigure
|
|||||||
```
|
```
|
||||||
|
|
||||||
Backup
|
Backup
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
BACKUP DATABASE [toto] TO DISK = 'c:\toto.bak' with Compression
|
BACKUP DATABASE [toto] TO DISK = 'c:\toto.bak' with Compression
|
||||||
```
|
```
|
||||||
|
|
||||||
ajouter filegroup
|
ajouter filegroup
|
||||||
|
|
||||||
```SQL
|
```SQL
|
||||||
USE [master]
|
USE [master]
|
||||||
GO
|
GO
|
||||||
@ -56,6 +60,7 @@ GO
|
|||||||
```
|
```
|
||||||
|
|
||||||
setter filegroup par default
|
setter filegroup par default
|
||||||
|
|
||||||
```SQL
|
```SQL
|
||||||
USE [DB_GRAND_HOTEL]
|
USE [DB_GRAND_HOTEL]
|
||||||
GO
|
GO
|
||||||
@ -64,6 +69,7 @@ GO
|
|||||||
```
|
```
|
||||||
|
|
||||||
modifier taille de fichier
|
modifier taille de fichier
|
||||||
|
|
||||||
```SQL
|
```SQL
|
||||||
USE [DB_GRAND_HOTEL]
|
USE [DB_GRAND_HOTEL]
|
||||||
GO
|
GO
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# CSS
|
# CSS
|
||||||
|
|
||||||
## link
|
## link
|
||||||
|
|
||||||
[Bulma style sheet](https://devhints.io/bulma)
|
[Bulma style sheet](https://devhints.io/bulma)
|
||||||
[Remove.bg](https://www.remove.bg/)
|
[Remove.bg](https://www.remove.bg/)
|
||||||
|
@ -6,20 +6,19 @@ Adapted from our book and video series, [Refactoring UI](moz-extension://3cbfa46
|
|||||||
|
|
||||||
Ever used one of those fancy color palette generators? You know, the ones where you pick a starting color, tweak some options that probably include some musical jargon like "triad" or "major fourth", and are then bestowed the five perfect color swatches you should use to build your website?
|
Ever used one of those fancy color palette generators? You know, the ones where you pick a starting color, tweak some options that probably include some musical jargon like "triad" or "major fourth", and are then bestowed the five perfect color swatches you should use to build your website?
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-01.png)
|
![pallette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-01.png)
|
||||||
|
|
||||||
This calculated and scientific approach to picking the perfect color scheme is extremely seductive, but not very useful.
|
This calculated and scientific approach to picking the perfect color scheme is extremely seductive, but not very useful.
|
||||||
|
|
||||||
Well, unless you want your site to look like this:
|
Well, unless you want your site to look like this:
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-02.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-02.png)
|
||||||
|
|
||||||
What you actually need
|
## What you actually need
|
||||||
----------------------
|
|
||||||
|
|
||||||
You can't build anything with five hex codes. To build something real, you need a much more comprehensive set of colors to choose from.
|
You can't build anything with five hex codes. To build something real, you need a much more comprehensive set of colors to choose from.
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-03.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-03.png)
|
||||||
|
|
||||||
You can break a good color palette down into three categories.
|
You can break a good color palette down into three categories.
|
||||||
|
|
||||||
@ -27,13 +26,13 @@ You can break a good color palette down into three categories.
|
|||||||
|
|
||||||
Text, backgrounds, panels, form controls — almost everything in an interface is grey.
|
Text, backgrounds, panels, form controls — almost everything in an interface is grey.
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-04.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-04.png)
|
||||||
|
|
||||||
You'll need more greys than you think, too — three or four shades might sound like plenty but it won't be long before you wish you had something a little darker than shade #2 but a little lighter than shade #3.
|
You'll need more greys than you think, too — three or four shades might sound like plenty but it won't be long before you wish you had something a little darker than shade #2 but a little lighter than shade #3.
|
||||||
|
|
||||||
In practice, you want 8-10 shades to choose from (more on this later). Not so many that you waste time deciding between shade #77 and shade #78, but enough to make sure you don't have to compromise too much .
|
In practice, you want 8-10 shades to choose from (more on this later). Not so many that you waste time deciding between shade #77 and shade #78, but enough to make sure you don't have to compromise too much .
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-05.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-05.png)
|
||||||
|
|
||||||
True black tends to look pretty unnatural, so start with a really dark grey and work your way up to white in steady increments.
|
True black tends to look pretty unnatural, so start with a really dark grey and work your way up to white in steady increments.
|
||||||
|
|
||||||
@ -43,7 +42,7 @@ Most sites need one, _maybe_ two colors that are used for primary actions, empha
|
|||||||
|
|
||||||
Just like with greys, you need a variety _(5-10)_ of lighter and darker shades to choose from.
|
Just like with greys, you need a variety _(5-10)_ of lighter and darker shades to choose from.
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-06.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-06.png)
|
||||||
|
|
||||||
Ultra-light shades can be useful as a tinted background for things like alerts, while darker shades work great for text.
|
Ultra-light shades can be useful as a tinted background for things like alerts, while darker shades work great for text.
|
||||||
|
|
||||||
@ -53,19 +52,19 @@ On top of primary colors, every site needs a few _accent_ colors for communicati
|
|||||||
|
|
||||||
For example, you might want to use an eye-grabbing color like yellow, pink, or teal to highlight a new feature:
|
For example, you might want to use an eye-grabbing color like yellow, pink, or teal to highlight a new feature:
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-07.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-07.png)
|
||||||
|
|
||||||
You might also need colors to emphasize different semantic _states_, like red for confirming a destructive action:
|
You might also need colors to emphasize different semantic _states_, like red for confirming a destructive action:
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-08.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-08.png)
|
||||||
|
|
||||||
...yellow for a warning message:
|
...yellow for a warning message:
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-09.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-09.png)
|
||||||
|
|
||||||
...or green to highlight a positive trend:
|
...or green to highlight a positive trend:
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-10.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/whats-in-a-color-palette-10.png)
|
||||||
|
|
||||||
You'll want multiple shades for these colors too, even though they should be used pretty sparingly throughout the UI.
|
You'll want multiple shades for these colors too, even though they should be used pretty sparingly throughout the UI.
|
||||||
|
|
||||||
@ -73,30 +72,27 @@ If you're building something where you need to use color to distinguish or categ
|
|||||||
|
|
||||||
All in, it's not uncommon to need as many as _ten_ different colors with _5-10 shades each_ for a complex UI.
|
All in, it's not uncommon to need as many as _ten_ different colors with _5-10 shades each_ for a complex UI.
|
||||||
|
|
||||||
Define your shades up front
|
## Define your shades up front
|
||||||
---------------------------
|
|
||||||
|
|
||||||
When you need to create a lighter or darker variation of a color in your palette, don't get clever using CSS preprocessor functions like "lighten" or "darken" to create shades on the fly. That's how you end up with 35 _slightly_ different blues that all look the same.
|
When you need to create a lighter or darker variation of a color in your palette, don't get clever using CSS preprocessor functions like "lighten" or "darken" to create shades on the fly. That's how you end up with 35 _slightly_ different blues that all look the same.
|
||||||
|
|
||||||
Instead, define a fixed set of shades up front that you can choose from as you work.
|
Instead, define a fixed set of shades up front that you can choose from as you work.
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/define-your-shades-up-front-01.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/define-your-shades-up-front-01.png)
|
||||||
|
|
||||||
So how do you put together a palette like this anyways?
|
So how do you put together a palette like this anyways?
|
||||||
|
|
||||||
Choose the base color first
|
## Choose the base color first
|
||||||
---------------------------
|
|
||||||
|
|
||||||
Start by picking a _base_ color for the scale you want to create — the color in the middle that your lighter and darker shades are based on.
|
Start by picking a _base_ color for the scale you want to create — the color in the middle that your lighter and darker shades are based on.
|
||||||
|
|
||||||
There's no real scientific way to do this, but for primary and accent colors, a good rule of thumb is to pick a shade that would work well as a button background.
|
There's no real scientific way to do this, but for primary and accent colors, a good rule of thumb is to pick a shade that would work well as a button background.
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/define-your-shades-up-front-02.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/define-your-shades-up-front-02.png)
|
||||||
|
|
||||||
It's important to note that there are no real rules here like "start at 50% lightness" or anything — every color behaves a bit differently, so you'll have to rely on your eyes for this one.
|
It's important to note that there are no real rules here like "start at 50% lightness" or anything — every color behaves a bit differently, so you'll have to rely on your eyes for this one.
|
||||||
|
|
||||||
Finding the edges
|
## Finding the edges
|
||||||
-----------------
|
|
||||||
|
|
||||||
Next, pick your darkest shade and your lightest shade. There's no real science to this either, but it helps to think about where they will be used and choose them using that context.
|
Next, pick your darkest shade and your lightest shade. There's no real science to this either, but it helps to think about where they will be used and choose them using that context.
|
||||||
|
|
||||||
@ -104,12 +100,11 @@ The darkest shade of a color is usually reserved for text, while the lightest sh
|
|||||||
|
|
||||||
A simple alert component is a good example that combines both of these use cases, so it can be a great place to pick these colors.
|
A simple alert component is a good example that combines both of these use cases, so it can be a great place to pick these colors.
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/define-your-shades-up-front-03.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/define-your-shades-up-front-03.png)
|
||||||
|
|
||||||
Start with a color that matches the hue of your base color, and adjust the saturation and lightness until you're satisfied.
|
Start with a color that matches the hue of your base color, and adjust the saturation and lightness until you're satisfied.
|
||||||
|
|
||||||
Filling in the gaps
|
## Filling in the gaps
|
||||||
-------------------
|
|
||||||
|
|
||||||
Once you've got your base, darkest, and lightest shades, you just need to fill in the gaps in between them.
|
Once you've got your base, darkest, and lightest shades, you just need to fill in the gaps in between them.
|
||||||
|
|
||||||
@ -119,25 +114,23 @@ Nine is a great number because it's easy to divide and makes filling in the gaps
|
|||||||
|
|
||||||
Start by picking shades _700_ and _300_, the ones right in the middle of the gaps. You want these shades to feel like the perfect compromise between the shades on either side.
|
Start by picking shades _700_ and _300_, the ones right in the middle of the gaps. You want these shades to feel like the perfect compromise between the shades on either side.
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/define-your-shades-up-front-04.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/define-your-shades-up-front-04.png)
|
||||||
|
|
||||||
This creates four more holes in the scale (_800_, _600_, _400_, and _200_), which you can fill using the same approach.
|
This creates four more holes in the scale (_800_, _600_, _400_, and _200_), which you can fill using the same approach.
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/define-your-shades-up-front-05.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/define-your-shades-up-front-05.png)
|
||||||
|
|
||||||
You should end up with a pretty balanced set of colors that provide just enough options to accommodate your design ideas without feeling limiting.
|
You should end up with a pretty balanced set of colors that provide just enough options to accommodate your design ideas without feeling limiting.
|
||||||
|
|
||||||
What about greys?
|
## What about greys?
|
||||||
-----------------
|
|
||||||
|
|
||||||
With greys the base color isn't as important, but otherwise the process is the same. Start at the edges and fill in the gaps until you have what you need.
|
With greys the base color isn't as important, but otherwise the process is the same. Start at the edges and fill in the gaps until you have what you need.
|
||||||
|
|
||||||
![](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/define-your-shades-up-front-06.png)
|
![palette](https://refactoring-ui.nyc3.cdn.digitaloceanspaces.com/previews/define-your-shades-up-front-06.png)
|
||||||
|
|
||||||
Pick your darkest grey by choosing a color for the darkest text in your project, and your lightest grey by choosing something that works well for a subtle off-white background.
|
Pick your darkest grey by choosing a color for the darkest text in your project, and your lightest grey by choosing something that works well for a subtle off-white background.
|
||||||
|
|
||||||
It's not a science
|
## It's not a science
|
||||||
------------------
|
|
||||||
|
|
||||||
As tempting as it is, you can't rely purely on math to craft the perfect color palette.
|
As tempting as it is, you can't rely purely on math to craft the perfect color palette.
|
||||||
|
|
||||||
@ -147,5 +140,4 @@ Once you actually start using your colors in your designs, it's almost inevitabl
|
|||||||
|
|
||||||
Just try to avoid adding _new_ shades too often if you can avoid it. If you're not dilligent about limiting your palette, you might as well have no color system at all.
|
Just try to avoid adding _new_ shades too often if you can avoid it. If you're not dilligent about limiting your palette, you might as well have no color system at all.
|
||||||
|
|
||||||
|
|
||||||
[Source](https://refactoringui.com/previews/building-your-color-palette/)
|
[Source](https://refactoringui.com/previews/building-your-color-palette/)
|
@ -1 +1,3 @@
|
|||||||
|
# email HTML
|
||||||
|
|
||||||
[Rock Solid HTML Emails ◆ 24 ways](https://24ways.org/2009/rock-solid-html-emails)
|
[Rock Solid HTML Emails ◆ 24 ways](https://24ways.org/2009/rock-solid-html-emails)
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
|
# HTML
|
||||||
|
|
||||||
[HTMl Reference](https://htmlreference.io/)
|
[HTMl Reference](https://htmlreference.io/)
|
||||||
[CSS References](https://cssreference.io/)
|
[CSS References](https://cssreference.io/)
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
# docker
|
# docker
|
||||||
|
|
||||||
## concept
|
## concept
|
||||||
@ -9,13 +7,13 @@
|
|||||||
|
|
||||||
## command
|
## command
|
||||||
|
|
||||||
- telecharger une image: ` docker pull debian:$tag`
|
- telecharger une image: `docker pull debian:$tag`
|
||||||
- crer et lancer un container en tty ` docker run -it bash `
|
- crer et lancer un container en tty `docker run -it bash`
|
||||||
- arreter container: `docker stop`
|
- arreter container: `docker stop`
|
||||||
- démarrer containeur: `docker start`
|
- démarrer containeur: `docker start`
|
||||||
- lister tous les conteneur `docker ps -a`
|
- lister tous les conteneur `docker ps -a`
|
||||||
- delete conteneur: `docker rm 2cdc
|
- delete conteneur: `docker rm 2cdc
|
||||||
- run a commad in container: `docker exec `
|
- run a commad in container: `docker exec`
|
||||||
- voir stdout d'un container: `docker logs`
|
- voir stdout d'un container: `docker logs`
|
||||||
- créer et lancer un conteneur `docker run -d --name node-app -p 3000:3000 -v $(pwd):/app node:0.12.4 node /app/server.js`
|
- créer et lancer un conteneur `docker run -d --name node-app -p 3000:3000 -v $(pwd):/app node:0.12.4 node /app/server.js`
|
||||||
- -d lance en tant que daemon
|
- -d lance en tant que daemon
|
||||||
@ -116,8 +114,6 @@ services:
|
|||||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- `docker-compose up` démarre les services décrits dans docker-compose.yml et ne rend pas la main.
|
- `docker-compose up` démarre les services décrits dans docker-compose.yml et ne rend pas la main.
|
||||||
- `docker-compose up -d` fait la même chose mais rend la main une fois que les services sont démarrés.
|
- `docker-compose up -d` fait la même chose mais rend la main une fois que les services sont démarrés.
|
||||||
- `docker-compose up –build` reconstruit les services avant de les lancer.
|
- `docker-compose up –build` reconstruit les services avant de les lancer.
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
- need mosquito broker for mqtt
|
- need mosquito broker for mqtt
|
||||||
|
|
||||||
|
|
||||||
## Cheatsheet
|
## Cheatsheet
|
||||||
|
|
||||||
- [icon material](https://cdn.materialdesignicons.com/4.5.95/)
|
- [icon material](https://cdn.materialdesignicons.com/4.5.95/)
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
[Hack Xiaomi gateway V2](https://easydomoticz.com/forum/viewtopic.php?t=8397)
|
[Hack Xiaomi gateway V2](https://easydomoticz.com/forum/viewtopic.php?t=8397)
|
||||||
|
|
||||||
## jeedom
|
## jeedom
|
||||||
|
|
||||||
- install docker avec database sur host
|
- install docker avec database sur host
|
||||||
|
|
||||||
``` docker run --net host --name jeedom-server --privileged -v /opt/jeedom:/var/www/html -e ROOT_PASSWORD=toto -e APACHE_PORT=9080 jeedom/jeedom:alpha ```
|
``` docker run --net host --name jeedom-server --privileged -v /opt/jeedom:/var/www/html -e ROOT_PASSWORD=toto -e APACHE_PORT=9080 jeedom/jeedom:alpha ```
|
||||||
|
|
||||||
- pour le l'hote SQL mettre 127.0.0.1
|
- pour le l'hote SQL mettre 127.0.0.1
|
@ -1,5 +1,7 @@
|
|||||||
# git
|
# git
|
||||||
|
|
||||||
![git](../img/git.jpg)
|
![git](../img/git.jpg)
|
||||||
|
|
||||||
## Clone with submodule recurse
|
## Clone with submodule recurse
|
||||||
|
|
||||||
add *--recurse-submodules* to clone command
|
add *--recurse-submodules* to clone command
|
||||||
@ -25,7 +27,7 @@ this will ask if you want to add each modification with this option:
|
|||||||
be carefull can't push repo last time use
|
be carefull can't push repo last time use
|
||||||
need to be in a repo with no modification
|
need to be in a repo with no modification
|
||||||
|
|
||||||
```
|
```bash
|
||||||
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch $file" HEAD
|
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch $file" HEAD
|
||||||
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune
|
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune
|
||||||
```
|
```
|
||||||
@ -35,14 +37,16 @@ rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --
|
|||||||
- clone the first repo
|
- clone the first repo
|
||||||
- go in this directory
|
- go in this directory
|
||||||
- launch
|
- launch
|
||||||
```
|
|
||||||
|
```bash
|
||||||
git filter-branch --prune-empty --subdirectory-filter "subdirectory/path" master
|
git filter-branch --prune-empty --subdirectory-filter "subdirectory/path" master
|
||||||
```
|
```
|
||||||
|
|
||||||
- push in your new git repo
|
- push in your new git repo
|
||||||
|
|
||||||
## changing email adress
|
## changing email adress
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ git filter-branch --commit-filter '
|
$ git filter-branch --commit-filter '
|
||||||
if [ "$GIT_AUTHOR_EMAIL" = "schacon@localhost" ];
|
if [ "$GIT_AUTHOR_EMAIL" = "schacon@localhost" ];
|
||||||
then
|
then
|
||||||
|
@ -5,7 +5,7 @@ Git submodule allows ro add externel repository in a repository
|
|||||||
## Adding submodule
|
## Adding submodule
|
||||||
|
|
||||||
- ```git submodule add http://git/toto.git $path```
|
- ```git submodule add http://git/toto.git $path```
|
||||||
this command add *http://git/toto.git* in *path* directory (add -b $branchname to follow specific branch)
|
this command add *<http://git/toto.git>* in *path* directory (add -b $branchname to follow specific branch)
|
||||||
- after that you need to add and commit submodule folder
|
- after that you need to add and commit submodule folder
|
||||||
|
|
||||||
to populate a submodule nested in other submodule
|
to populate a submodule nested in other submodule
|
||||||
@ -21,15 +21,12 @@ to populate a submodule nested in other submodule
|
|||||||
|
|
||||||
## Updating submodule
|
## Updating submodule
|
||||||
|
|
||||||
|
|
||||||
you can update a submodule Manually going in submodule folder and perform a ```git fetch``` and ```git merge```
|
you can update a submodule Manually going in submodule folder and perform a ```git fetch``` and ```git merge```
|
||||||
|
|
||||||
|
|
||||||
### Fetch and merge
|
### Fetch and merge
|
||||||
|
|
||||||
automatic process
|
automatic process
|
||||||
|
|
||||||
- perform a ```git submodule update --remote```
|
- perform a ```git submodule update --remote```
|
||||||
|
|
||||||
|
|
||||||
in each case you need to commit update in project
|
in each case you need to commit update in project
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
# ampache nginx config
|
||||||
|
|
||||||
|
```nginx
|
||||||
```
|
|
||||||
if ( !-d $request_filename ) {
|
if ( !-d $request_filename ) {
|
||||||
rewrite ^/ampache/rest/(.*)\.view$ /ampache/rest/index.php?action=$1 last;
|
rewrite ^/ampache/rest/(.*)\.view$ /ampache/rest/index.php?action=$1 last;
|
||||||
rewrite ^/ampache/rest/play/(.+)$ /ampache/play/$1 last;
|
rewrite ^/ampache/rest/play/(.+)$ /ampache/play/$1 last;
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
|
# HTTP
|
||||||
|
|
||||||
## 1×× Informational
|
## 1×× Informational
|
||||||
|
|
||||||
- 100 Continue
|
- 100 Continue
|
||||||
This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.
|
This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.
|
||||||
|
|
||||||
## 2×× Success
|
## 2×× Success
|
||||||
|
|
||||||
- 200 OK
|
- 200 OK
|
||||||
The request has succeeded. The meaning of a success varies depending on the HTTP method:
|
The request has succeeded. The meaning of a success varies depending on the HTTP method:
|
||||||
GET: The resource has been fetched and is transmitted in the message body.
|
GET: The resource has been fetched and is transmitted in the message body.
|
||||||
@ -19,6 +23,7 @@
|
|||||||
The response body contains multiple status informations for different parts of a batch/bulk request
|
The response body contains multiple status informations for different parts of a batch/bulk request
|
||||||
|
|
||||||
## 3×× Redirection
|
## 3×× Redirection
|
||||||
|
|
||||||
- 300 Multiple Choices
|
- 300 Multiple Choices
|
||||||
The request has more than one possible responses. User-agent or user should choose one of them. There is no standardized way to choose one of the responses.
|
The request has more than one possible responses. User-agent or user should choose one of them. There is no standardized way to choose one of the responses.
|
||||||
- 301 Moved Permanently
|
- 301 Moved Permanently
|
||||||
@ -31,6 +36,7 @@
|
|||||||
This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.
|
This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.
|
||||||
|
|
||||||
## 4×× Client Error
|
## 4×× Client Error
|
||||||
|
|
||||||
- 400 Bad Request
|
- 400 Bad Request
|
||||||
This response means that server could not understand the request due to invalid syntax.
|
This response means that server could not understand the request due to invalid syntax.
|
||||||
- 401 Unauthorized
|
- 401 Unauthorized
|
||||||
@ -45,6 +51,7 @@
|
|||||||
The client does not consider rate limiting and sent too many requests.
|
The client does not consider rate limiting and sent too many requests.
|
||||||
|
|
||||||
## 5×× Server Error
|
## 5×× Server Error
|
||||||
|
|
||||||
- 500 Internal Server Error
|
- 500 Internal Server Error
|
||||||
The server has encountered a situation it doesn't know how to handle.
|
The server has encountered a situation it doesn't know how to handle.
|
||||||
- 501 Not Implemented
|
- 501 Not Implemented
|
||||||
@ -54,4 +61,4 @@
|
|||||||
- 503 Service Unavailable
|
- 503 Service Unavailable
|
||||||
The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.
|
The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.
|
||||||
|
|
||||||
For more info: https://httpstatuses.com/
|
For more info: <https://httpstatuses.com/>
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
# nginx
|
# nginx
|
||||||
|
|
||||||
## reverse proxy
|
## reverse proxy
|
||||||
```
|
|
||||||
|
```nginx
|
||||||
location /chainetv {
|
location /chainetv {
|
||||||
proxy_pass http://unix:/run/gunicorn/socket:/;
|
proxy_pass http://unix:/run/gunicorn/socket:/;
|
||||||
#proxy_set_header Host $host;
|
#proxy_set_header Host $host;
|
||||||
@ -10,6 +12,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- le :/ aprés le socket sert a envoyer le sous répertoire a la suite de l'adresse demander l'appli écoute donc la route /api
|
- le :/ aprés le socket sert a envoyer le sous répertoire a la suite de l'adresse demander l'appli écoute donc la route /api
|
||||||
- la parie commenté a le même fonctionnement mais permet un réglage plus fin associer a flask et la classe ReverseProxied par exemple:
|
- la parie commenté a le même fonctionnement mais permet un réglage plus fin associer a flask et la classe ReverseProxied par exemple:
|
||||||
la location peut rediriger /chaine/api en metant le X-Script-ame a /chainetv l'appli peut donc écouter la route /api
|
la location peut rediriger /chaine/api en metant le X-Script-ame a /chainetv l'appli peut donc écouter la route /api
|
||||||
|
@ -1,18 +1,19 @@
|
|||||||
|
# Arch
|
||||||
|
|
||||||
![arch](../img/Arch_Linux_logo.svg.png)
|
![arch](../img/Arch_Linux_logo.svg.png)
|
||||||
|
|
||||||
## [instalation](arch_install.md)
|
## [instalation](arch_install.md)
|
||||||
|
|
||||||
|
|
||||||
## arch tips
|
## arch tips
|
||||||
|
|
||||||
#### clés GPG corrompue ou usagé
|
### clés GPG corrompue ou usagé
|
||||||
|
|
||||||
```
|
```bash
|
||||||
sudo pacman -S archlinux-keyring
|
sudo pacman -S archlinux-keyring
|
||||||
sudo pacmam-key --init
|
sudo pacmam-key --init
|
||||||
sudo pacman-key --populate archlinux
|
sudo pacman-key --populate archlinux
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Personaliser un iso arch
|
||||||
|
|
||||||
#### Personaliser un iso arch
|
|
||||||
[archiso](https://wiki.archlinux.org/index.php/Archiso)
|
[archiso](https://wiki.archlinux.org/index.php/Archiso)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
---
|
# arch install
|
||||||
title: arch_install
|
|
||||||
---
|
|
||||||
![arch](../img/Arch_Linux_logo.svg.png)
|
![arch](../img/Arch_Linux_logo.svg.png)
|
||||||
The following is a brief installation tutorial for [Arch Linux][1]. It assumes
|
The following is a brief installation tutorial for [Arch Linux][1]. It assumes
|
||||||
familiarity with the Arch [Beginner's Guide][2] and [Installation Guide][3].
|
familiarity with the Arch [Beginner's Guide][2] and [Installation Guide][3].
|
||||||
@ -15,89 +14,87 @@ Boot into the Arch installer.
|
|||||||
|
|
||||||
If your console font is tiny ([HiDPI][7] systems), set a new font.
|
If your console font is tiny ([HiDPI][7] systems), set a new font.
|
||||||
|
|
||||||
$ setfont sun12x22
|
setfont sun12x22
|
||||||
|
|
||||||
Connect to the Internet.
|
Connect to the Internet.
|
||||||
|
|
||||||
Verify that the [system clock is up to date][8].
|
Verify that the [system clock is up to date][8].
|
||||||
|
|
||||||
$ timedatectl set-ntp true
|
timedatectl set-ntp true
|
||||||
|
|
||||||
(bios mode)
|
(bios mode)
|
||||||
|
|
||||||
$ parted -s /dev/sda mklabel msdos
|
parted -s /dev/sda mklabel msdos
|
||||||
$ parted -s /dev/sda mkpart primary 1MiB 513MiB
|
parted -s /dev/sda mkpart primary 1MiB 513MiB
|
||||||
$ parted -s /dev/sda mkpart primary 1024MiB 100%
|
parted -s /dev/sda mkpart primary 1024MiB 100%
|
||||||
$ mkfs.ext2 /dev/sda1
|
mkfs.ext2 /dev/sda1
|
||||||
$ mkfs.ext4 /dev/sda2
|
mkfs.ext4 /dev/sda2
|
||||||
|
|
||||||
(UEFI mode) Create partitions for EFI, boot, and root.
|
(UEFI mode) Create partitions for EFI, boot, and root.
|
||||||
|
|
||||||
$ parted -s /dev/sda mklabel gpt
|
parted -s /dev/sda mklabel gpt
|
||||||
$ parted -s /dev/sda mkpart primary fat32 1MiB 513MiB
|
parted -s /dev/sda mkpart primary fat32 1MiB 513MiB
|
||||||
$ parted -s /dev/sda set 1 boot on
|
parted -s /dev/sda set 1 boot on
|
||||||
$ parted -s /dev/sda set 1 esp on
|
parted -s /dev/sda set 1 esp on
|
||||||
$ parted -s /dev/sda mkpart primary 513MiB 1024MiB
|
parted -s /dev/sda mkpart primary 513MiB 1024MiB
|
||||||
$ parted -s /dev/sda mkpart primary 1024MiB 100%
|
parted -s /dev/sda mkpart primary 1024MiB 100%
|
||||||
$ mkfs.ext4 /dev/sda2
|
mkfs.ext4 /dev/sda2
|
||||||
$ mkfs.fat -F32 /dev/sda1
|
mkfs.fat -F32 /dev/sda1
|
||||||
|
|
||||||
|
|
||||||
Create and mount the encrypted root filesystem. Note that for UEFI systems
|
Create and mount the encrypted root filesystem. Note that for UEFI systems
|
||||||
this will be partition 3.
|
this will be partition 3.
|
||||||
|
|
||||||
|
pvcreate /dev/sda3pc
|
||||||
$ pvcreate /dev/sda3pc
|
vgcreate arch /dev/mapper/lvm
|
||||||
$ vgcreate arch /dev/mapper/lvm
|
lvcreate -L 4G arch -n swap
|
||||||
$ lvcreate -L 4G arch -n swap
|
lvcreate -L 30G arch -n root
|
||||||
$ lvcreate -L 30G arch -n root
|
lvcreate -l +100%FREE arch -n home
|
||||||
$ lvcreate -l +100%FREE arch -n home
|
lvdisplay
|
||||||
$ lvdisplay
|
mkswap -L swap /dev/mapper/arch-swap
|
||||||
$ mkswap -L swap /dev/mapper/arch-swap
|
mkfs.ext4 /dev/mapper/arch-root
|
||||||
$ mkfs.ext4 /dev/mapper/arch-root
|
mkfs.ext4 /dev/mapper/arch-home
|
||||||
$ mkfs.ext4 /dev/mapper/arch-home
|
mount /dev/mapper/arch-root /mnt
|
||||||
$ mount /dev/mapper/arch-root /mnt
|
mkdir /mnt/home
|
||||||
$ mkdir /mnt/home
|
mount /dev/mapper/arch-home /mnt/home
|
||||||
$ mount /dev/mapper/arch-home /mnt/home
|
swapon /dev/mapper/arch-swap
|
||||||
$ swapon /dev/mapper/arch-swap
|
|
||||||
|
|
||||||
(UEFI mode) Encrypt the boot partition using a separate passphrase from
|
(UEFI mode) Encrypt the boot partition using a separate passphrase from
|
||||||
the root partition, then mount the boot and EFI partitions.
|
the root partition, then mount the boot and EFI partitions.
|
||||||
|
|
||||||
$ mkdir /mnt/boot
|
mkdir /mnt/boot
|
||||||
$ mount /dev/sda2 /mnt/boot
|
mount /dev/sda2 /mnt/boot
|
||||||
$ mkdir /mnt/boot/efi
|
mkdir /mnt/boot/efi
|
||||||
$ mount /dev/sda1 /mnt/boot/efi
|
mount /dev/sda1 /mnt/boot/efi
|
||||||
|
|
||||||
Optionally [edit the mirror list][9].
|
Optionally [edit the mirror list][9].
|
||||||
|
|
||||||
$ vi /etc/pacman.d/mirrorlist
|
vi /etc/pacman.d/mirrorlist
|
||||||
|
|
||||||
Install the [base system][10].
|
Install the [base system][10].
|
||||||
|
|
||||||
$ pacstrap -i /mnt base base-devel net-tools wireless_tools dialog wpa_supplicant openssh git grub ansible
|
pacstrap -i /mnt base base-devel net-tools wireless_tools dialog wpa_supplicant openssh git grub ansible
|
||||||
(UEFI mode) $ pacstrap /mnt efibootmgr
|
(UEFI mode) $ pacstrap /mnt efibootmgr
|
||||||
|
|
||||||
Generate and verify [fstab][11].
|
Generate and verify [fstab][11].
|
||||||
|
|
||||||
$ genfstab -U -p /mnt >> /mnt/etc/fstab
|
genfstab -U -p /mnt >> /mnt/etc/fstab
|
||||||
$ less /mnt/etc/fstab
|
less /mnt/etc/fstab
|
||||||
|
|
||||||
Change root into the base install and perform [base configuration tasks][12].
|
Change root into the base install and perform [base configuration tasks][12].
|
||||||
|
|
||||||
$ arch-chroot /mnt /bin/bash
|
arch-chroot /mnt /bin/bash
|
||||||
$ systemctl enable dhcpcd.service
|
systemctl enable dhcpcd.service
|
||||||
$ systemctl enable sshd.service
|
systemctl enable sshd.service
|
||||||
$ passwd
|
passwd
|
||||||
|
|
||||||
modifier /etc/ssh/sshd_config et mettre PermitRoorlogin yes
|
modifier /etc/ssh/sshd_config et mettre PermitRoorlogin yes
|
||||||
|
|
||||||
Set your mkinitcpio.
|
Set your mkinitcpio.
|
||||||
|
|
||||||
# only for UEFI
|
only for UEFI
|
||||||
$ sed -i 's/^HOOKS=.*/HOOKS="base udev autodetect modconf block keyboard lvm2 resume filesystems fsck"/' /etc/mkinitcpio.conf
|
sed -i 's/^HOOKS=.*/HOOKS="base udev autodetect modconf block keyboard lvm2 resume filesystems fsck"/' /etc/mkinitcpio.conf
|
||||||
# for both
|
for both
|
||||||
$ mkinitcpio -p linux
|
mkinitcpio -p linux
|
||||||
|
|
||||||
Configure GRUB.
|
Configure GRUB.
|
||||||
|
|
||||||
@ -113,13 +110,12 @@ Configure GRUB.
|
|||||||
|
|
||||||
Cleanup and reboot!
|
Cleanup and reboot!
|
||||||
|
|
||||||
$ exit
|
exit
|
||||||
$ umount -R /mnt
|
umount -R /mnt
|
||||||
$ reboot
|
reboot
|
||||||
|
|
||||||
Run ansible!
|
Run ansible!
|
||||||
|
|
||||||
|
|
||||||
[1]: https://www.archlinux.org/
|
[1]: https://www.archlinux.org/
|
||||||
[2]: https://wiki.archlinux.org/index.php/Beginners'_guide
|
[2]: https://wiki.archlinux.org/index.php/Beginners'_guide
|
||||||
[3]: https://wiki.archlinux.org/index.php/Installation_guide
|
[3]: https://wiki.archlinux.org/index.php/Installation_guide
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# cron
|
# cron
|
||||||
|
|
||||||
```
|
```bash
|
||||||
# * * * * * command to execute
|
# * * * * * command to execute
|
||||||
# │ │ │ │ │
|
# │ │ │ │ │
|
||||||
# │ │ │ │ │
|
# │ │ │ │ │
|
||||||
@ -10,13 +10,18 @@
|
|||||||
# │ └──────────────────── hour (0 - 23)
|
# │ └──────────────────── hour (0 - 23)
|
||||||
# └───────────────────────── min (0 - 59)
|
# └───────────────────────── min (0 - 59)
|
||||||
```
|
```
|
||||||
|
|
||||||
[test cron](https://crontab.guru/)
|
[test cron](https://crontab.guru/)
|
||||||
|
|
||||||
See also
|
See also
|
||||||
- [wikipedia/cron](http://en.wikipedia.org/wiki/Cron)
|
|
||||||
|
[wikipedia/cron](http://en.wikipedia.org/wiki/Cron)
|
||||||
|
|
||||||
## cron directories
|
## cron directories
|
||||||
|
|
||||||
You can create directories that run cron commands. Taken from the `Ubuntu`
|
You can create directories that run cron commands. Taken from the `Ubuntu`
|
||||||
distro:
|
distro:
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
# /etc/crontab: system-wide crontab
|
# /etc/crontab: system-wide crontab
|
||||||
# Unlike any other crontab you don't have to run the `crontab'
|
# Unlike any other crontab you don't have to run the `crontab'
|
||||||
@ -35,13 +40,15 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
```
|
```
|
||||||
|
|
||||||
## run every weekday at midnight
|
## run every weekday at midnight
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
0 0 * * 0-5
|
0 0 * * 0-5
|
||||||
```
|
```
|
||||||
|
|
||||||
## edit cronjobs
|
## edit cronjobs
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ sudo crontab -e
|
sudo crontab -e
|
||||||
```
|
```
|
||||||
|
|
||||||
## user crontab lcation
|
## user crontab lcation
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
## grub_shell
|
# grub_shell
|
||||||
|
|
||||||
# booter depuis le shell grub
|
## booter depuis le shell grub
|
||||||
|
|
||||||
- les commande **cat** et **ls** fonctionne
|
- les commande **cat** et **ls** fonctionne
|
||||||
- trouver partition de boot
|
- trouver partition de boot
|
||||||
@ -10,10 +10,13 @@
|
|||||||
- enter `boot` to boot
|
- enter `boot` to boot
|
||||||
|
|
||||||
## regénérer config
|
## regénérer config
|
||||||
|
|
||||||
`grub-mkconfig -o /boot/grub/grub.cfg`
|
`grub-mkconfig -o /boot/grub/grub.cfg`
|
||||||
|
|
||||||
## install sur MBR
|
## install sur MBR
|
||||||
|
|
||||||
`grub-install --target=i386-pc /dev/sdX`
|
`grub-install --target=i386-pc /dev/sdX`
|
||||||
|
|
||||||
## meme chose depuis grub rescue
|
## meme chose depuis grub rescue
|
||||||
|
|
||||||
`grub rescue> set prefix=(hd0,1)/boot/grub
|
`grub rescue> set prefix=(hd0,1)/boot/grub
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
|
# Linux
|
||||||
|
|
||||||
![linux](../img/linux.png)
|
![linux](../img/linux.png)
|
||||||
|
|
||||||
## retrouvé date t'instalation
|
## retrouvé date t'instalation
|
||||||
|
|
||||||
`ls -lct /etc | tail -1 | awk '{print $6, $7, $8}'`
|
`ls -lct /etc | tail -1 | awk '{print $6, $7, $8}'`
|
||||||
|
|
||||||
## enable Wayland support:
|
## enable Wayland support
|
||||||
|
|
||||||
- execute `ln -s /dev/null /etc/udev/rules.d/61-gdm.rules` to avoid that gnome test your nvidia Driver
|
- execute `ln -s /dev/null /etc/udev/rules.d/61-gdm.rules` to avoid that gnome test your nvidia Driver
|
||||||
|
|
||||||
@ -14,7 +18,8 @@
|
|||||||
`MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)`
|
`MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)`
|
||||||
|
|
||||||
- create pacman hook:
|
- create pacman hook:
|
||||||
```
|
|
||||||
|
```ini
|
||||||
[Trigger]
|
[Trigger]
|
||||||
Operation=Install
|
Operation=Install
|
||||||
Operation=Upgrade
|
Operation=Upgrade
|
||||||
@ -32,12 +37,10 @@ NeedsTargets
|
|||||||
Exec=/bin/sh -c 'while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P'
|
Exec=/bin/sh -c 'while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## see if you run on wayland
|
||||||
## see if you run on wayland:
|
|
||||||
|
|
||||||
`loginctl show-session $(loginctl G $USERNAME|awk '{print $1}') -p Type`
|
`loginctl show-session $(loginctl G $USERNAME|awk '{print $1}') -p Type`
|
||||||
|
|
||||||
|
|
||||||
## boot in emergency target
|
## boot in emergency target
|
||||||
|
|
||||||
1. (Re)boot the machine
|
1. (Re)boot the machine
|
||||||
|
@ -1,22 +1,23 @@
|
|||||||
#shell
|
# shell
|
||||||
|
|
||||||
##tips
|
## tips
|
||||||
|
|
||||||
- setter IFS au retour chariot
|
- setter IFS au retour chariot
|
||||||
``` IFS=$'\n'```
|
|
||||||
|
```IFS=$'\n'```
|
||||||
|
|
||||||
## boucle
|
## boucle
|
||||||
```
|
|
||||||
|
```bash
|
||||||
for var in $variable
|
for var in $variable
|
||||||
do
|
do
|
||||||
commande
|
commande
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## if
|
## if
|
||||||
|
|
||||||
```
|
```bash
|
||||||
if [ test ]; then
|
if [ test ]; then
|
||||||
echo "C'est vrai"
|
echo "C'est vrai"
|
||||||
else
|
else
|
||||||
@ -25,7 +26,9 @@ fi
|
|||||||
```
|
```
|
||||||
|
|
||||||
### test
|
### test
|
||||||
|
|
||||||
#### string
|
#### string
|
||||||
|
|
||||||
|test|def|
|
|test|def|
|
||||||
|----|---|
|
|----|---|
|
||||||
|$a = j$b|egale|
|
|$a = j$b|egale|
|
||||||
@ -44,7 +47,6 @@ fi
|
|||||||
|$a -gt $b| >|
|
|$a -gt $b| >|
|
||||||
|$a -ge $b| >= |
|
|$a -ge $b| >= |
|
||||||
|
|
||||||
|
|
||||||
#### file
|
#### file
|
||||||
|
|
||||||
|test|def|
|
|test|def|
|
||||||
@ -59,7 +61,7 @@ fi
|
|||||||
|
|
||||||
## Supprimer les Dossiers contenant 1 élement
|
## Supprimer les Dossiers contenant 1 élement
|
||||||
|
|
||||||
```
|
```bash
|
||||||
IFS=$'\n';for i in $(ls) do ✔ 10022 18:29:32
|
IFS=$'\n';for i in $(ls) do ✔ 10022 18:29:32
|
||||||
if [ $(ls $i|wc|awk '{print $1}') = 1 ]
|
if [ $(ls $i|wc|awk '{print $1}') = 1 ]
|
||||||
then
|
then
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
|
# ZSH
|
||||||
|
|
||||||
![zsh](../img/zsh.jpg)
|
![zsh](../img/zsh.jpg)
|
||||||
|
|
||||||
# functionality
|
## functionality
|
||||||
|
|
||||||
|
## shortcut
|
||||||
# shortcut
|
|
||||||
|
|
||||||
key|comportment
|
key|comportment
|
||||||
---|-----------
|
---|-----------
|
||||||
|
|
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
# python
|
# python
|
||||||
|
|
||||||
## référence
|
## référence
|
||||||
https://github.com/gto76/python-cheatsheet/blob/master/README.md
|
|
||||||
|
<https://github.com/gto76/python-cheatsheet/blob/master/README.md>
|
||||||
|
|
||||||
Afficher les warning:```python -Wd```
|
Afficher les warning:```python -Wd```
|
||||||
Mode développement :`-X dev`
|
Mode développement :`-X dev`
|
||||||
@ -10,6 +12,7 @@ Mode développement :`-X dev`
|
|||||||
</details>`
|
</details>`
|
||||||
|
|
||||||
## Virtual env
|
## Virtual env
|
||||||
|
|
||||||
- create virtual env: `python3 -m venv /path`
|
- create virtual env: `python3 -m venv /path`
|
||||||
- enter in virtual env: `source env/bin/activate`
|
- enter in virtual env: `source env/bin/activate`
|
||||||
- leave venv: `deactivate`
|
- leave venv: `deactivate`
|
||||||
@ -17,8 +20,12 @@ Mode développement :`-X dev`
|
|||||||
- install package list in file: `pip install -r requirement.txt`
|
- install package list in file: `pip install -r requirement.txt`
|
||||||
|
|
||||||
## tips
|
## tips
|
||||||
|
|
||||||
- pprint permet d afficher vos structure de données
|
- pprint permet d afficher vos structure de données
|
||||||
- la fonction dir() permet de lister les attribut d un
|
- la fonction dir() permet de lister les attribut d un
|
||||||
|
|
||||||
## unitest
|
## unitest
|
||||||
|
|
||||||
### lancer une suite de tests
|
### lancer une suite de tests
|
||||||
|
|
||||||
```python -m unittest tests.suite```
|
```python -m unittest tests.suite```
|
||||||
|
@ -2,5 +2,4 @@
|
|||||||
|
|
||||||
![¬ebook](Divers/img/notebook.webp)
|
![¬ebook](Divers/img/notebook.webp)
|
||||||
|
|
||||||
|
|
||||||
Ceci est mon wiki personnel où je partage mes notes sous la forme d'un livre MkDocs en ligne via mon instance [gitea](https://git.ducamps.win/).
|
Ceci est mon wiki personnel où je partage mes notes sous la forme d'un livre MkDocs en ligne via mon instance [gitea](https://git.ducamps.win/).
|
||||||
|
Loading…
Reference in New Issue
Block a user