Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
wiki2:shortcuts [2019/10/22 08:41] alfred [Python Gotchas] |
wiki2:shortcuts [2020/09/10 18:37] (actual) |
||
|---|---|---|---|
| Línea 2: | Línea 2: | ||
| ===== Docker ===== | ===== Docker ===== | ||
| + | Start Postgres | ||
| <code> | <code> | ||
| - | docker run --rm -d -p 5432:5432 -v /home/alfred/tmp/postgresdata:/var/lib/postgresql/data -v /tmp:/tmp --name postgres postgres | + | docker run --rm -d -p 5432:5432 -v /home/alfred/tmp/postgresdata:/var/lib/postgresql/data -v /tmp:/tmp --name postgres -e POSTGRES_PASSWORD=mysecretpassword postgres |
| </code> | </code> | ||
| Línea 21: | Línea 22: | ||
| * [[wiki2:linux_commands#apt]]-get install|reinstall|update | * [[wiki2:linux_commands#apt]]-get install|reinstall|update | ||
| + | |||
| + | === Date === | ||
| + | Format date in the way you like it: | ||
| + | <code> | ||
| + | $(date +%y%m%d) | ||
| + | </code> | ||
| ==== Cheat ==== | ==== Cheat ==== | ||
| You can define the next alias: | You can define the next alias: | ||
| Línea 91: | Línea 98: | ||
| ====== Python Gotchas ====== | ====== Python Gotchas ====== | ||
| - | * [[wiki2:python3#venv_para_crear_entornos_virtuales]] | + | * [[wiki2:python3#venv_para_crear_entornos_virtuales|Creación de entornos virtuales con venv]] |
| ===== Serving your current directory by HTTP ===== | ===== Serving your current directory by HTTP ===== | ||
| For Python 3 run: | For Python 3 run: | ||
| Línea 100: | Línea 107: | ||
| <code> | <code> | ||
| python -m SimpleHTTPServer | python -m SimpleHTTPServer | ||
| + | </code> | ||
| + | |||
| + | ===== Prettify JSON ===== | ||
| + | <code> | ||
| + | cat file.json | python -m json.tool | ||
| </code> | </code> | ||