kafkacat -b bootstrap.kafka.host:9092 \
-C -t topic \
-s avro -r http://schema-registry.host:8081 \
-f '
Key (%K bytes): %k
Value (%S bytes): %s
Timestamp: %T
Partition: %p
Offset: %o
View starship.toml
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
format = """ | |
$username\ | |
$hostname\ | |
$directory\ | |
$git_branch\ | |
$git_commit\ | |
$git_status\ | |
$git_state\ | |
$kubernetes\ | |
$golang\ |
View README.md
View archive.md
tar
# extract
tar -xvf archive.tar
# List files in archive.tar
tar -tvf archive.tar
# compress
tar -cvf archive.tar foo bar
View mssql-helper.sql
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 |
View README.md
PostgreSQL
Monitoring Progress of Index Construction
SELECT
now()::TIME(0),
a.query,
p.phase,
p.blocks_total,
p.blocks_done,
View gradle.md
plugins {
id "com.dorongold.task-tree" version "1.5"
}
task resolveDependencies {
setDescription "Resolves all projects dependencies from the repository."
setGroup "Build Server"
doLast {
View semver-regex.md
Canonical regex
/^
(?'MAJOR'
0|(?:[1-9]\d*)
)
\.
(?'MINOR'
0|(?:[1-9]\d*)
View test.sh
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
count=1 | |
while true; do | |
echo $((count++)); | |
kubectl get pod -A > /dev/null; | |
sleep 1; | |
done; |
View 0-README.md
Django Staticfiles
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.
View bash-color.sh
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 |
NewerOlder