# extract
tar -xvf archive.tar
# List files in archive.tar
tar -tvf archive.tar
# compress
tar -cvf archive.tar foo bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Show all databases | |
SELECT | |
database_id, | |
name, | |
create_date | |
FROM sys.databases; | |
--or using Stored Procedure | |
EXEC sp_databases; | |
-- Switch database |
SELECT
now()::TIME(0),
a.query,
p.phase,
p.blocks_total,
p.blocks_done,
Django staticfiles is the most common problem you need to solve before putting your app on the production. In this tutorial, I and you will walk through the solution options, included.
- runserver: Only in development environment.
- gunicorn: Use
gunicorn
as your app server. - nginx: Put
nginx
web server in a front of your app server (gunicorn). - whitenoise: Let your django app self-serve static files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ..='cd ..' | |
if [[ ! "$PATH" =~ (^|:)"$HOME/.local/bin"(:|$) ]]; then | |
export PATH="$HOME/.local/bin:$PATH" | |
fi | |
export SDKMAN_DIR="$HOME/.sdkman" | |
[[ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ]] && source "$SDKMAN_DIR/bin/sdkman-init.sh" | |
export NVM_DIR="$HOME/.nvm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
##### Color table ##### | |
# Black 0;30 Dark Gray 1;30 | |
# Red 0;31 Light Red 1;31 | |
# Green 0;32 Light Green 1;32 | |
# Brown/Orange 0;33 Yellow 1;33 | |
# Blue 0;34 Light Blue 1;34 | |
# Purple 0;35 Light Purple 1;35 | |
# Cyan 0;36 Light Cyan 1;36 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jinja2 | |
loader = jinja2.FileSystemLoader(searchpath="./") | |
env = jinja2.Environment(loader=loader) | |
TEMPLATE_FILE = "template.j2" | |
template = env.get_template(TEMPLATE_FILE) | |
output = template.render() | |
print(f"[{output}]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Arrays.stream(TimeZone.getAvailableIDs()).forEach(id -> { | |
boolean flag = false; | |
try { | |
ZoneId.of(id); | |
flag = true; | |
} catch (Exception e) { | |
//ignore; | |
} | |
if (!flag) | |
System.out.printf("[%s] %s%n", flag ? "x" : " ", id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<web-fragment version="3.0" | |
xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd"> | |
</web-fragment> |