This file contains hidden or 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
| package demo.plain; | |
| import org.keycloak.OAuth2Constants; | |
| import org.keycloak.admin.client.CreatedResponseUtil; | |
| import org.keycloak.admin.client.Keycloak; | |
| import org.keycloak.admin.client.KeycloakBuilder; | |
| import org.keycloak.admin.client.resource.RealmResource; | |
| import org.keycloak.admin.client.resource.UserResource; | |
| import org.keycloak.admin.client.resource.UsersResource; | |
| import org.keycloak.representations.idm.ClientRepresentation; |
This file contains hidden or 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 | |
| cd /opt/bitnami/kafka/bin/ | |
| input="/messages/data/messages.txt" | |
| while IFS= read -r line | |
| do | |
| sh kafka-console-producer.sh --bootstrap-server 127.0.0.1:9092 --topic topic_name $line | |
| done < "$input" |
This file contains hidden or 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
| kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic topic_name |
This file contains hidden or 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
| All settingd: | |
| mysql -uroot -p -A -e"SHOW VARIABLES;" > ~/MySQLCurrentSettings.txt | |
| Global SEttings: | |
| mysql -uroot -p -A -e"SHOW GLOBAL VARIABLES;" > ~/MySQLCurrentSettings.txt | |
| Session Settings: | |
| mysql -uroot -p -A -e"SHOW SESSION VARIABLES;" > ~/MySQLCurrentSettings.txt |
This file contains hidden or 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
| process.stdout.clearLine(); | |
| process.stdout.cursorTo(0); | |
| process.stdout.write(`waiting.... ${progressNumber}`); |
This file contains hidden or 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
| Create file if not exists: /etc/apt/apt.conf.d/proxy.conf | |
| Add your proxy info into file, like: | |
| Acquire::http::Proxy "http://user:[email protected]:port/"; | |
| Acquire::https::Proxy "http://user:[email protected]:port/"; |
This file contains hidden or 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
| find . -maxdepth 4 -name "*.pdf" -type f -print0 | xargs --null -I {} cp -rf {} ~/Documents/cp_calibre_pdf/ |
This file contains hidden or 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
| SELECT s.schemaname, | |
| s.relname AS tablename, | |
| s.indexrelname AS indexname, | |
| pg_relation_size(s.indexrelid) AS index_size, | |
| s.idx_scan | |
| FROM pg_catalog.pg_stat_user_indexes s | |
| JOIN pg_catalog.pg_index i ON s.indexrelid = i.indexrelid | |
| WHERE s.idx_scan > 0 -- has never been scanned | |
| AND 0 <>ALL (i.indkey) -- no index column is an expression | |
| AND NOT i.indisunique -- is not a UNIQUE index |
This file contains hidden or 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
| WITH cte AS ( | |
| SELECT current_date - (n || ' day')::INTERVAL AS date | |
| FROM generate_series(0, 29) n | |
| ) | |
| SELECT date | |
| FROM cte |
This file contains hidden or 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
| grep ^[^#] /etc/apt/sources.list /etc/apt/sources.list.d/* |
NewerOlder