Add this to your .profile, .bashrc, .zshrc...
_decode_base64_url() {
local len=$((${#1} % 4))
local result="$1"
if [ $len -eq 2 ]; then result="$1"'=='
elif [ $len -eq 3 ]; then result="$1"'='
fi
echo "$result" | tr '_-' '/+' | base64 -d| kubectl get rolebindings,clusterrolebindings \ | |
| --all-namespaces \ | |
| -o custom-columns='KIND:kind,NAMESPACE:metadata.namespace,NAME:metadata.name,SERVICE_ACCOUNTS:subjects[?(@.kind=="ServiceAccount")].name' |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: nginx-headless | |
| labels: | |
| app: nginx | |
| spec: | |
| ports: | |
| - port: 80 | |
| name: web |
| // Colors reference | |
| // You can use the following as so: | |
| // console.log(colorCode, data); | |
| // console.log(`${colorCode}some colorful text string${resetCode} rest of string in normal color`); | |
| // | |
| // ... and so on. | |
| export const reset = "\x1b[0m" | |
| export const bright = "\x1b[1m" | |
| export const dim = "\x1b[2m" |
| #!/bin/bash | |
| OUTDIR=. | |
| while read -r db ; do | |
| while read -r table ; do | |
| if [ "$db" == "system" ]; then | |
| echo "skip system db" | |
| continue 2; |
| [ | |
| { | |
| "applicationDomain" : "MIS.COACHING", | |
| "serviceCode" : "questionnaires", | |
| "packageName" : "it.menarini.coaching.rest", | |
| "version" : "v1", | |
| "api" : { | |
| "value" : "", | |
| "description" : "" | |
| }, |
| package it.menarini.coaching.dao; | |
| import .MISCOACHINGanswersDAO; // import errato generato | |
| import it.menarini.coaching.model.CoachAnswer; | |
| import it.menarini.coaching.model.CoachAssessment; | |
| import it.menarini.coaching.model.CoachQuestion; | |
| import it.menarini.coaching.model.CoachQuestionGroup; | |
| import it.menarini.coaching.model.CoachQuestionnaire; | |
| import it.menarini.coaching.model.CoachQuestionnaireProduct; | |
| import it.menarini.coaching.model.ComboBox; |
| [ | |
| { | |
| "applicationDomain" : "MIS.COACHING", | |
| "serviceCode" : "assessments", | |
| "packageName" : "it.menarini.coaching.rest", | |
| "version" : "v1", | |
| "advancedSearch" : true, | |
| "api" : { | |
| "value" : "", | |
| "description" : "" |
| @Override@WsgOperation("Add products - Create new products.") | |
| public List < Map > addProductsQuestionnaire(@WsgParameter("The Context ID") String contextId, @WsgParameter("The new Products object") List < CoachQuestionnaireProduct > products, | |
| SearchRequest searchReq) { | |
| DataSource ds = datasourceManager.getDatasource(serviceName, contextId); | |
| DataSourceTransactionManager dstm = new DataSourceTransactionManager(ds); | |
| TransactionStatus status = dstm.getTransaction(new DefaultTransactionDefinition()); | |
| NamedParameterJdbcTemplate jdbc = new NamedParameterJdbcTemplate(ds); | |
| JdbcTemplate jdbcs = new JdbcTemplate(ds); | |
| String sql = "insert into coach_questionnare_product (id, qualification, weight, description, coach_questionnaire_id) values (:products.id, :products.qualification, :products.weight, :products.description, :products.coachQuestionnaireId)"; | |
| Map parameters = new HashMap(); |
| { | |
| "verb": "POST", | |
| "uri": "/add-products", | |
| "apiOperation": { "value":"Add products","notes" : "Create new products."}, | |
| "methodName": "addProductsQuestionnaire", | |
| "parameters": [ | |
| {"name":"products", "paramType":"RequestBody","paramClass":"it.menarini.coaching.model.CoachQuestionnaireProduct","isCollection" : true, "required" : true, "apiParam" : {"name":"productQuestionnaire","value":"The new Products object"}} | |
| ], | |
| "preAssign" : { "products.id" : "select seq_coaching_product.nextval from dual" }, | |
| "preSqlTemplate": ["delete from coach_questionnare_product where coach_questionnaire_id = :products.coachQuestionnaireId"], |