├── .nojekyll ├── INTRODUCTION.md ├── 脚本工具集 ├── DevOps-Bash-tools │ ├── ai │ │ └── lib │ ├── aws │ │ ├── lib │ │ ├── aws_iam_create_credential.sh │ │ ├── aws_budget.json │ │ ├── aws_budget_sns_access_policy.json │ │ ├── aws_iam_users.sh │ │ ├── aws_secret_list.sh │ │ └── aws_nat_gateways_public_ips.sh │ ├── bin │ │ ├── lib │ │ ├── .bash.d │ │ ├── doapi.sh │ │ ├── wordpress.htaccess │ │ ├── urldecode.sh │ │ ├── random_select.sh │ │ ├── exec_interactive.sh │ │ ├── jsondiff.sh │ │ ├── center.sh │ │ ├── progress_dots.sh │ │ ├── urlencode.sh │ │ └── random_string.sh │ ├── cicd │ │ ├── lib │ │ ├── .bash.d │ │ └── run_latest_tests.sh │ ├── data │ │ └── lib │ ├── gcp │ │ ├── lib │ │ ├── gcp_info_all_projects.sh │ │ └── gcp_iam_workload_identities.sh │ ├── git │ │ ├── lib │ │ ├── .bash.d │ │ ├── git_merge_all.sh │ │ ├── git_merge_master.sh │ │ ├── git_merge_master_pull.sh │ │ ├── git_summary_line.sh │ │ ├── git_repos.sh │ │ └── update_gitignore.io.sh │ ├── java │ │ └── lib │ ├── perl │ │ ├── lib │ │ ├── perlpath.sh │ │ └── perl_find_library_path.sh │ ├── appveyor │ │ ├── lib │ │ └── appveyor_delete_offline_byoc.sh │ ├── bigdata │ │ ├── lib │ │ ├── .bash.d │ │ ├── cloudera_manager_yarn_apps_failed.sh │ │ ├── zookeeper_shell.sh │ │ ├── cloudera_manager_impala_queries_metadata_refresh.sh │ │ ├── cloudera_manager_impala_queries_failed.sh │ │ └── cloudera_manager_impala_queries_ddl.sh │ ├── bitbucket │ │ └── lib │ ├── buildkite │ │ ├── lib │ │ ├── buildkite_sync_pipeline_descriptions_from_github.sh │ │ └── buildkite_trigger_all.sh │ ├── checks │ │ ├── lib │ │ ├── .bash.d │ │ ├── check_python3_compat.sh │ │ └── check_docker_clean.sh │ ├── circleci │ │ └── lib │ ├── codeship │ │ └── lib │ ├── docker │ │ ├── lib │ │ └── dockerhub_build_status.sh │ ├── drone │ │ └── lib │ ├── github │ │ ├── lib │ │ ├── .bash.d │ │ ├── github_tag_release.sh │ │ ├── github_actions_workflows_state.sh │ │ └── github_user_followers.sh │ ├── gitlab │ │ └── lib │ ├── ipaas │ │ └── lib │ ├── jenkins │ │ ├── lib │ │ ├── README.md │ │ ├── jenkins_count_jobs.groovy │ │ ├── jenkins_jobs_disabled.groovy │ │ ├── jenkins_job_disable.groovy │ │ ├── jenkins_jobs_status.groovy │ │ └── jenkins_jobs.groovy │ ├── kafka │ │ ├── lib │ │ ├── .bash.d │ │ ├── kafka_cli_jaas.conf │ │ ├── kafka_producer_perf_test.sh │ │ ├── kafka_acls.sh │ │ ├── kafka_configs.sh │ │ ├── kafka_console_producer.sh │ │ ├── kafka_console_consumer.sh │ │ ├── kafka_consumer_groups.sh │ │ ├── kafka_consumer_perf_test.sh │ │ └── kafka_topics.sh │ ├── media │ │ └── lib │ ├── mysql │ │ └── lib │ ├── pingdom │ │ ├── lib │ │ └── pingdom_sms_credits.sh │ ├── postgres │ │ └── lib │ ├── python │ │ ├── lib │ │ ├── pythonpath.sh │ │ └── python_indices.sh │ ├── scripts │ │ ├── lib │ │ └── README.md │ ├── search │ │ └── lib │ ├── shippable │ │ └── lib │ ├── spotify │ │ └── lib │ ├── teamcity │ │ ├── lib │ │ └── .bash.d │ ├── terraform │ │ └── lib │ ├── travis │ │ ├── lib │ │ ├── travis_repos_delete_crons.sh │ │ └── travis_repos_delete_caches.sh │ ├── wercker │ │ ├── lib │ │ ├── .werckerignore │ │ ├── wercker.yml │ │ └── wercker_app_id.sh │ ├── azure_devops │ │ └── lib │ ├── boot │ ├── cloudflare │ │ ├── lib │ │ ├── cloudflare_ssl_verified_all_zones.sh │ │ ├── cloudflare_dns_records_all_zones.sh │ │ └── cloudflare_zones.sh │ ├── kubernetes │ │ ├── lib │ │ └── .bash.d │ ├── install │ │ ├── install_tekton_cli.sh │ │ ├── install_codeql.sh │ │ ├── install_cmctl.sh │ │ ├── install_digital_ocean_cli.sh │ │ ├── install_octopus_deploy_cli.sh │ │ ├── install_bitnami_sealed_secrets_kubeseal.sh │ │ ├── install_sdkman.sh │ │ ├── install_kubescape.sh │ │ ├── install_oh-my-zsh.sh │ │ ├── install_pulumi_cli.sh │ │ ├── install_fossa_cli.sh │ │ ├── install_datree.sh │ │ ├── install_sdkman_all_sdks.sh │ │ ├── install_rvm.sh │ │ ├── install_vundle.sh │ │ ├── install_talosctl.sh │ │ ├── install_docker_compose.sh │ │ ├── install_drone.sh │ │ ├── install_semaphore_ci.sh │ │ ├── install_cloudbees.sh │ │ ├── install_wercker_cli.sh │ │ ├── install_tfsec.sh │ │ ├── install_nova.sh │ │ ├── install_yq.sh │ │ ├── install_jfrog_cli.sh │ │ ├── install_pluto.sh │ │ ├── install_polaris.sh │ │ ├── install_clairctl.sh │ │ ├── install_dockerhub_cli.sh │ │ ├── install_circleci.sh │ │ ├── install_kops.sh │ │ ├── install_bazelisk.sh │ │ ├── install_kind.sh │ │ ├── install_spotifycontrol.sh │ │ ├── install_terraformer.sh │ │ ├── install_argocd.sh │ │ └── install_cert_manager_cli.sh │ ├── configs │ │ ├── .gemrc │ │ ├── .Xmodmap │ │ ├── .sdkman │ │ │ └── etc │ │ │ │ └── config │ │ ├── .Codefresh │ │ │ └── cli-config │ │ │ │ └── config.yaml │ │ ├── .sqliterc │ │ ├── .aws │ │ │ └── shell │ │ │ │ └── awsshellrc │ │ ├── .perlcritic_forbidden_modules │ │ ├── .toprc │ │ ├── .sawsrc │ │ ├── .perlcriticrc │ │ ├── .ansible.cfg │ │ ├── .inputrc │ │ └── .my.cnf │ ├── .sonarcloud.properties │ ├── STATUS.md │ ├── .github │ │ ├── workflows │ │ │ ├── push_all_repos.sh │ │ │ ├── commit_adjacent_repos.sh │ │ │ └── actions-allowed.txt │ │ └── ISSUE_TEMPLATE.md │ ├── .git-templates │ │ └── git-secrets │ │ │ └── hooks │ │ │ ├── commit-msg │ │ │ ├── pre-commit │ │ │ └── prepare-commit-msg │ ├── .mdlrc │ ├── setup │ │ ├── teamcity │ │ │ └── teamcity-database.properties │ │ ├── gem-packages.txt │ │ ├── debian.unstable.pref │ │ ├── debian.experimental.pref │ │ ├── debian.stable.pref │ │ ├── debian.testing.pref │ │ ├── atom-packages.txt │ │ ├── apk-packages-desktop.txt │ │ ├── pip-packages-mac.txt │ │ ├── R-packages.txt │ │ ├── gocd_config_repo.json │ │ ├── npm-packages.txt │ │ ├── cpan-packages-desktop.txt │ │ ├── cpan-requirements.txt │ │ ├── npm-packages-desktop.txt │ │ ├── jenkins-plugins.txt │ │ ├── gem-packages-desktop.txt │ │ ├── upgrade_gradle_wrapper.sh │ │ ├── brew-packages-desktop-casks.txt │ │ ├── cpan-requirements-optional.txt │ │ ├── teamcity-mysql-setup.sql │ │ ├── apk-packages-optional.txt │ │ ├── python_mac_upgrade_ssl_fix.sh │ │ ├── go-packages-desktop.txt │ │ ├── portage-packages-server.txt │ │ ├── portage-packages-dockapps.txt │ │ ├── deb-packages-optional.txt │ │ ├── python_install_snakebite.sh │ │ ├── apk-packages.txt │ │ ├── ccmenu_cp_plist.sh │ │ ├── prometheus.yml │ │ ├── deb-packages.txt │ │ ├── rpm-packages.txt │ │ ├── which_python_installed.sh │ │ ├── README.md │ │ └── setup_codefresh.sh │ ├── applescript │ │ ├── get_mouse_coordinates.sh │ │ ├── com.harisekhon.wakeup_script.plist │ │ ├── screensaver_activate.scpt │ │ ├── get_frontmost_process.scpt │ │ ├── set_frontmost_process.scpt │ │ ├── get_mouse_coordinates.scpt │ │ ├── is_screensaver_running.scpt │ │ └── browser_get_default.scpt │ ├── resources │ │ ├── tabs_ignore.txt │ │ └── whitespace_ignore.txt │ ├── .gitconfig.local │ ├── lib │ │ ├── README.md │ │ ├── mac.sh │ │ ├── os.sh │ │ ├── dockerfile_keywords.txt │ │ ├── utils-bourne.sh │ │ └── args_extract.sh │ ├── requirements.txt │ ├── tests │ │ └── README.md │ ├── .zprofile │ ├── .bash.d │ │ ├── lolcat.sh │ │ ├── Makefile │ │ ├── z_final.sh │ │ ├── k3d.sh │ │ ├── trivy.sh │ │ ├── bash_it.sh │ │ ├── skaffold.sh │ │ ├── grype.sh │ │ ├── postgres.sh │ │ ├── mysql.sh │ │ └── circleci.sh │ ├── .gitmodules │ ├── docker-compose │ │ ├── gerrit.yml │ │ ├── prometheus.yml │ │ └── wordpress.yml │ ├── .zlogin │ ├── .zlogout │ ├── .scrutinizer.yml │ ├── .zshenv │ ├── .hound.yml │ ├── .cirrus.yml │ ├── .gitlab-ci.yml │ ├── yamllint │ │ └── config │ ├── LICENSE │ ├── Gemfile │ ├── hadolint.yaml │ ├── .mdl.rb │ ├── .terraformignore │ └── .bash_logout └── Linutil.md ├── .github ├── META │ ├── INTRODUCTION.md │ ├── README.md │ ├── gitcp │ ├── ABOUT.md │ ├── commit-all.sh │ ├── settings.json │ └── LICENSE.code ├── ISSUE_TEMPLATE │ ├── custom.md │ ├── feature_request.md │ └── bug_report.md └── SCRIPTS │ ├── commit-all.sh │ └── commit-all.doc.sh ├── Bash Commands ├── ripgrep │ └── rga.md ├── awk.md ├── 99~参考资料 │ └── Bash Pitfalls.md ├── ls │ └── eza.md ├── ps │ └── 99~参考资料 │ │ └── psaux.bash │ │ ├── check.awk │ │ └── README.md └── ls.md ├── .gitattributes ├── Prompts └── 文章改写 Prompts.md ├── 常用脚本 ├── Semrush.md └── README.md ├── README.md └── books.html /.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /INTRODUCTION.md: -------------------------------------------------------------------------------- 1 | # 本篇导读 2 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/ai/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/aws/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bin/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/cicd/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/data/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/gcp/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/git/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/java/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/perl/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /.github/META/INTRODUCTION.md: -------------------------------------------------------------------------------- 1 | # 本篇导读 2 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/appveyor/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bigdata/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bitbucket/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/buildkite/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/checks/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/circleci/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/codeship/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/docker/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/drone/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/github/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/gitlab/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/ipaas/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/jenkins/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kafka/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/media/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/mysql/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/pingdom/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/postgres/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/python/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/scripts/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/search/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/shippable/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/spotify/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/teamcity/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/terraform/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/travis/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/wercker/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/azure_devops/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bin/.bash.d: -------------------------------------------------------------------------------- 1 | ../.bash.d -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/boot: -------------------------------------------------------------------------------- 1 | setup/bootstrap.sh -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/checks/.bash.d: -------------------------------------------------------------------------------- 1 | ../.bash.d -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/cicd/.bash.d: -------------------------------------------------------------------------------- 1 | ../.bash.d -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/cloudflare/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/git/.bash.d: -------------------------------------------------------------------------------- 1 | ../.bash.d -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/github/.bash.d: -------------------------------------------------------------------------------- 1 | ../.bash.d -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kafka/.bash.d: -------------------------------------------------------------------------------- 1 | ../.bash.d -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kubernetes/lib: -------------------------------------------------------------------------------- 1 | ../lib -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bigdata/.bash.d: -------------------------------------------------------------------------------- 1 | ../.bash.d -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kubernetes/.bash.d: -------------------------------------------------------------------------------- 1 | ../.bash.d -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/teamcity/.bash.d: -------------------------------------------------------------------------------- 1 | ../.bash.d -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bin/doapi.sh: -------------------------------------------------------------------------------- 1 | digital_ocean_api.sh -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/wercker/.werckerignore: -------------------------------------------------------------------------------- 1 | **/.md 2 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_tekton_cli.sh: -------------------------------------------------------------------------------- 1 | install_tkn.sh -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/github/github_tag_release.sh: -------------------------------------------------------------------------------- 1 | github_release.sh -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_codeql.sh: -------------------------------------------------------------------------------- 1 | install_github_codeql.sh -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_cmctl.sh: -------------------------------------------------------------------------------- 1 | install_cert_manager_cli.sh -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_digital_ocean_cli.sh: -------------------------------------------------------------------------------- 1 | install_doctl.sh -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_octopus_deploy_cli.sh: -------------------------------------------------------------------------------- 1 | install_octo.sh -------------------------------------------------------------------------------- /Bash Commands/ripgrep/rga.md: -------------------------------------------------------------------------------- 1 | # [rga](https://github.com/phiresky/ripgrep-all) 2 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/configs/.gemrc: -------------------------------------------------------------------------------- 1 | gem: --no-document --no-ri --no-rdoc 2 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.sonarcloud.properties: -------------------------------------------------------------------------------- 1 | sonar.host.url=https://sonarcloud.io 2 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/aws/aws_iam_create_credential.sh: -------------------------------------------------------------------------------- 1 | aws_cli_create_credential.sh -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_bitnami_sealed_secrets_kubeseal.sh: -------------------------------------------------------------------------------- 1 | install_kubeseal.sh -------------------------------------------------------------------------------- /Bash Commands/awk.md: -------------------------------------------------------------------------------- 1 | # awk 2 | 3 | # Links 4 | 5 | - https://earthly.dev/blog/awk-examples/ Understanding AWK -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/STATUS.md: -------------------------------------------------------------------------------- 1 | # CI/CD Status Page 2 | 3 | Moved to https://harisekhon.github.io/CI-CD/ 4 | -------------------------------------------------------------------------------- /.github/META/README.md: -------------------------------------------------------------------------------- 1 | git checkout -b gh-pages & git push --set-upstream origin gh-pages & git checkout master 2 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.github/workflows/push_all_repos.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | git_foreach_repo.sh 'push' 4 | -------------------------------------------------------------------------------- /Bash Commands/99~参考资料/Bash Pitfalls.md: -------------------------------------------------------------------------------- 1 | # Bash Pitfalls 2 | 3 | # Links 4 | 5 | - https://kodango.com/bash-pitfalls-part-1 6 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.git-templates/git-secrets/hooks/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | git secrets --commit_msg_hook -- "$@" 3 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.git-templates/git-secrets/hooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | git secrets --pre_commit_hook -- "$@" 3 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.github/workflows/commit_adjacent_repos.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | git_foreach_repo.sh 'gitu .github/workflows ||:' 4 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.git-templates/git-secrets/hooks/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | git secrets --prepare_commit_msg_hook -- "$@" 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.xmind filter=lfs diff=lfs merge=lfs -text 2 | *.zip filter=lfs diff=lfs merge=lfs -text 3 | *.pdf filter=lfs diff=lfs merge=lfs -text 4 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.mdlrc: -------------------------------------------------------------------------------- 1 | mdlrc_dir = File.expand_path('..', __FILE__) 2 | 3 | style_file = File.join(mdlrc_dir, '.mdl.rb') 4 | 5 | style style_file 6 | -------------------------------------------------------------------------------- /.github/META/gitcp: -------------------------------------------------------------------------------- 1 | # !/bin/bash 2 | 3 | msg=${1:-update articles or snippets} 4 | 5 | git add --all 6 | git commit -m "feat: ${msg}" --no-verify 7 | git pull 8 | git push -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/teamcity/teamcity-database.properties: -------------------------------------------------------------------------------- 1 | #Mon Nov 30 22:18:13 GMT 2020 2 | connectionUrl=jdbc\:hsqldb\:file\:$TEAMCITY_SYSTEM_PATH/buildserver 3 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/applescript/get_mouse_coordinates.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | [ -n "${DEBUG:-}" ] && set -x 5 | 6 | MouseTools -location 7 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/resources/tabs_ignore.txt: -------------------------------------------------------------------------------- 1 | # Posix Regex 2 | # used on top of whitespace_ignore.txt 3 | Makefile 4 | .*\.go$ 5 | .*\.json$ 6 | .*\.log$ 7 | .*\.xml$ 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/gem-packages.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2013-02-18 10:47:57 +0000 (Mon, 18 Feb 2013) 4 | # 5 | # vim:ts=4:sw=4:et 6 | 7 | json 8 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.gitconfig.local: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2012-01-31 14:08:42 +0000 (Tue, 31 Jan 2012) 4 | # 5 | 6 | [user] 7 | name = Hari Sekhon 8 | email = harisekhon@gmail.com 9 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bin/wordpress.htaccess: -------------------------------------------------------------------------------- 1 | php_value upload_max_filesize 3072M 2 | php_value post_max_size 3072M 3 | php_value memory_limit 3072M 4 | php_value max_execution_time 300 5 | php_value max_input_time 300 6 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/debian.unstable.pref: -------------------------------------------------------------------------------- 1 | # 0 < P < 100: causes a version to be installed only if there is no 2 | # installed version of the package 3 | 4 | Package: * 5 | Pin: release a=unstable 6 | Pin-Priority: 50 7 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/debian.experimental.pref: -------------------------------------------------------------------------------- 1 | # 0 < P < 100: causes a version to be installed only if there is no 2 | # installed version of the package 3 | 4 | Package: * 5 | Pin: release a=experimental 6 | Pin-Priority: 1 7 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/configs/.Xmodmap: -------------------------------------------------------------------------------- 1 | keycode 115 = Super_L 2 | add Mod4 = Super_L 3 | keycode 116 = Super_R 4 | add Mod4 = Super_R 5 | clear Mod1 6 | keycode 66 = Alt_L 7 | keycode 69 = Alt_R 8 | add Mod1 = Alt_L 9 | add Mod1 = Alt_R 10 | -------------------------------------------------------------------------------- /Prompts/文章改写 Prompts.md: -------------------------------------------------------------------------------- 1 | ``` 2 | 改写该文章,在保持原意的基础上,使用更易于理解的表达,不要缩减文章,可以改写原文的举例但是不要省略。英文关键字保持不变、代码保持不变,图片保持不变,改写后列表使用无序列表。输出为 Markdown 源码格式。 3 | 4 | 翻译成中文,英文关键字保持不变、代码保持不变;并改写该文章,在保持原意的基础上,使用更易于理解的表达,不要缩减文章,可以改写原文的举例但是不要省略。改写后列表使用无序列表。输出为 Markdown 源码格式。 5 | ``` 6 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/scripts/README.md: -------------------------------------------------------------------------------- 1 | This directory is for quick hack scripts that are not as generic tools as the rest of this repo. 2 | 3 | They usually have something specific to a situation or environment that may be personal to me and are not intended to used as-is. 4 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/configs/.sdkman/etc/config: -------------------------------------------------------------------------------- 1 | sdkman_auto_answer=false 2 | sdkman_auto_selfupdate=false 3 | sdkman_insecure_ssl=false 4 | sdkman_curl_connect_timeout=7 5 | sdkman_curl_max_time=10 6 | sdkman_beta_channel=false 7 | sdkman_debug_mode=false 8 | sdkman_colour_enable=true 9 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/debian.stable.pref: -------------------------------------------------------------------------------- 1 | # 500 <= P < 990: causes a version to be installed unless there is a 2 | # version available belonging to the target release or the installed 3 | # version is more recent 4 | 5 | Package: * 6 | Pin: release a=stable 7 | Pin-Priority: 900 8 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/jenkins/README.md: -------------------------------------------------------------------------------- 1 | # Jenkins scripts 2 | 3 | The Bash scripts can execute from the git clone, but the `*.groovy` scripts needs to be pasted into the Jenkins Console at `$JENKINS_URL/script` which you can browse to: 4 | 5 | Jenkins -> Manage Jenkins -> Script Console 6 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/debian.testing.pref: -------------------------------------------------------------------------------- 1 | # 100 <= P < 500: causes a version to be installed unless there is a 2 | # version available belonging to some other distribution or the installed 3 | # version is more recent 4 | 5 | Package: * 6 | Pin: release a=testing 7 | Pin-Priority: 400 8 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/lib/README.md: -------------------------------------------------------------------------------- 1 | Utility Library 2 | =============== 3 | 4 | Functions abstracted from top level scripts. 5 | 6 | There are more functions and aliases with interactive focus in the [.bash.d/](https://github.com/HariSekhon/DevOps-Bash-tools/tree/master/.bash.d) directory at the top level. 7 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/requirements.txt: -------------------------------------------------------------------------------- 1 | aws-consoler>=1.1.0 2 | checkov>=2.0.618 3 | #git-remote-codecommit>=1.16 4 | grip>=4.6.1 5 | jsonlint>=0.1 6 | pylint>=1.9.5 7 | # can only be installed on macOS - moved to setup/pip-packages-mac.txt 8 | #pyobjc-framework-Quartz>=9.0.1 9 | semgrep>=0.78.0 10 | yamllint>=1.15.0 11 | -------------------------------------------------------------------------------- /脚本工具集/Linutil.md: -------------------------------------------------------------------------------- 1 | # [Linutil](https://github.com/ChrisTitusTech/linutil) 2 | 3 | Linutil is a distro-agnostic toolbox designed to simplify everyday Linux tasks. It helps you set up applications and optimize your system for specific use cases. The utility is actively developed in Rust 🦀, providing performance and reliability. 4 | -------------------------------------------------------------------------------- /常用脚本/Semrush.md: -------------------------------------------------------------------------------- 1 | - 抓取 Semrush 中的排行数据 2 | 3 | ```js 4 | JSON.stringify( 5 | Array.from(document.querySelectorAll(".sm-group-item__content")).map(($e) => { 6 | return { 7 | name: $e.querySelector(".sm-group-item__text").innerText, 8 | number: $e.querySelector(".sm-group-item__number").innerText, 9 | }; 10 | }) 11 | ); 12 | ``` 13 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/configs/.Codefresh/cli-config/config.yaml: -------------------------------------------------------------------------------- 1 | currentProfile: default 2 | profiles: 3 | default: 4 | output: 5 | pretty: false 6 | dateFormat: default 7 | request: 8 | timeout: 30000 9 | maxAttempts: 10 10 | retryDelay: 500 11 | logs: 12 | fallback: 13 | interval: 5000 14 | maxAttempts: 1000 15 | -------------------------------------------------------------------------------- /Bash Commands/ls/eza.md: -------------------------------------------------------------------------------- 1 | # [eza](https://github.com/eza-community/eza) 2 | 3 | eza is a modern, maintained replacement for the venerable file-listing command-line program ls that ships with Unix and Linux operating systems, giving it more features and better defaults. It uses colours to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git. And it’s small, fast, and just one single binary. 4 | 5 | ![](https://github.com/eza-community/eza/raw/main/docs/images/screenshots.png) 6 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Please be specific about your issue and include debug output from running after setting `export DEBUG=1` in your shell. 2 | 3 | You can anonymize hostnames / FQDNs, IP / MAC addresses, Kerberos principals, email addresses and almost anything else using `anonymize.pl` or the newer `anonymize.py` available in the [DevOps Perl Tools](https://github.com/HariSekhon/DevOps-Perl-tools) and [DevOps Python Tools](https://github.com/HariSekhon/DevOps-Python-tools) respectively. 4 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/tests/README.md: -------------------------------------------------------------------------------- 1 | Tests 2 | ===== 3 | 4 | Unlike the `tests/` directory of my other repos, most of the scripts in this repo are actually really used and tested via the CI of most of my other repos that use it as a submodule, while some other scripts aren't easily testable as their require non-trivial infrastructure (eg. Cloudera) or local access keys. 5 | 6 | `spotify_uri_to_name.sh` has its alternate modes tested here only because adjacent scripts and repos only use its original design for track conversions. 7 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.zprofile: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2006-06-28 23:25:09 +0100 (Wed, 28 Jun 2006) 4 | # (forked from .bash_profile) 5 | 6 | # ============================================================================ # 7 | # Z S H P r o f i l e 8 | # ============================================================================ # 9 | 10 | # goes horribly wrong - too much advanced bash 11 | #if [[ -e ~/.profile ]]; then 12 | # emulate sh -c 'source ~/.profile' 13 | #fi 14 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/resources/whitespace_ignore.txt: -------------------------------------------------------------------------------- 1 | # Posix Regex 2 | /Makefile$ 3 | /\. 4 | \.pyc$ 5 | \.pyo$ 6 | \.jyc$ 7 | \.jyo$ 8 | \.zip$ 9 | \.tar$ 10 | \.tgz$ 11 | \.tbz$ 12 | \.gz$ 13 | \.bz2$ 14 | \.class$ 15 | \.plist$ 16 | \.svg$ 17 | \.png$ 18 | \.jpg$ 19 | \.jpeg$ 20 | /target/ 21 | /fatpacks/ 22 | /build/ 23 | /gradle/ 24 | /gradlew 25 | /mvnw 26 | dependency-reduced-pom.xml 27 | /[[:alnum:]-]+-[[:digit:]\.]+/ 28 | /cover_db/ 29 | check_memcached_stats.cfg-pnp4nagios 30 | /spark-.*-bin-hadoop.*/ 31 | -bin\b 32 | -------------------------------------------------------------------------------- /Bash Commands/ps/99~参考资料/psaux.bash/check.awk: -------------------------------------------------------------------------------- 1 | #!/bin/gawk -f 2 | { 3 | line[$2][FNR!=NR] = $0 4 | for (i = 1; i <=NF; i++) 5 | fields[$2][i][FNR!=NR] = $i 6 | } 7 | END { 8 | for (i in fields) { 9 | for (j in fields[i]) { 10 | if (length(fields[i][j]) > 1 && fields[i][j][0] != fields[i][j][1]) { 11 | print "mine=" line[i][0] 12 | print " ps=" line[i][1] 13 | print "" 14 | break 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.github/META/ABOUT.md: -------------------------------------------------------------------------------- 1 | # About | 关于 2 | 3 | # Principles 4 | 5 | - Awesome-Lists/Awesome-CS-Books 层次无限制,但须尽可能少;Awesome-CheatSheets/Developer-Zero-To-Mastery 中不可超过两层,其余文档类仓库如无额外情况,目录层次不可超过三层。单层子文件数目尽量不超过 20,若超过则考虑拆分或者上浮。 6 | 7 | - Awesome-Lists/Awesome-CS-Books 中以知识图谱结构为基准,其余仓库以可理解性为基准;弱化 Awesome-CheatSheets,仅为其余各仓库内容汇总的速览导出版,不可作为原始内容存放处。 8 | 9 | - 同一目录下文件类型除 README.md 外应当保持一致,通用的目录名包括:导论、架构机制、Specials;通用的文件名包括:安装与配置。 10 | 11 | # Credits | 致谢 12 | 13 | 由于笔者平日忙于工作,几乎所有线上的文档都是我夫人帮忙整理,在此特别致谢;同时也感谢我家的布丁安静的趴在脚边,不再那么粪发涂墙。 14 | 15 | # Roadmap | 规划 16 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_sdkman.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2019-10-04 16:36:18 +0100 (Fri, 04 Oct 2019) 5 | # (circa 2016 originally) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying LICENSE file 10 | # 11 | # https://www.linkedin.com/in/HariSekhon 12 | # 13 | 14 | # Installs SDKMan 15 | 16 | # https://sdkman.io/install 17 | 18 | set -euo pipefail 19 | [ -n "${DEBUG:-}" ] && set -x 20 | 21 | curl -sS "https://get.sdkman.io" | bash 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Awesome Commands and Scripts 2 | 3 | Awesome Tools 是对于开发人员日常使用的成熟工具的集锦。 4 | 5 | # MAC 6 | 7 | # Windows 8 | 9 | - [SHELL ![code](https://ng-tech.icu/assets/code.svg)](https://nilesoft.org/): Powerful context menu manager for Windows File Explorer 10 | 11 | # Teamwork 12 | 13 | ## File Sharing 14 | 15 | - [transfer.sh ![code](https://ng-tech.icu/assets/code.svg)](https://github.com/dutchcoders/transfer.sh): Easy and fast file sharing from the command-line. 16 | 17 | # Design & Documents 18 | 19 | # Links 20 | 21 | - [Media-OpenSource-List]() 22 | -------------------------------------------------------------------------------- /books.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 16 | 17 | 18 | 23 | 24 |
知识体系 12 | 《Awesome Lists | CS 资料集锦》 15 |
19 | 《Awesome Lists | CS 资料集锦》 22 |
25 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/atom-packages.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2020-03-29 00:54:51 +0000 (Sun, 29 Mar 2020) 4 | # 5 | # https://github.com/HariSekhon/DevOps-Bash-tools 6 | # 7 | # License: see accompanying LICENSE file 8 | # 9 | # https://www.linkedin.com/in/HariSekhon 10 | # 11 | 12 | # ============================================================================ # 13 | # A t o m P a c k a g e s 14 | # ============================================================================ # 15 | 16 | linter-jenkins 17 | -------------------------------------------------------------------------------- /Bash Commands/ls.md: -------------------------------------------------------------------------------- 1 | # ls 2 | 3 | # 基础使用 4 | 5 | # 替代品 6 | 7 | - [2023~eza-community/eza ![code](https://ng-tech.icu/assets/code.svg) ![star](https://img.shields.io/github/stars/eza-community/eza)](https://github.com/eza-community/eza): eza is a modern, maintained replacement for the venerable file-listing command-line program ls that ships with Unix and Linux operating systems, giving it more features and better defaults. It uses colours to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git. And it’s small, fast, and just one single binary. 8 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.bash.d/lolcat.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-11-03 11:31:02 +0000 (Sun, 03 Nov 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | lolz(){ 17 | exec 1> >(lolcat >&2) 18 | } 19 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/apk-packages-desktop.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2019-03-16 20:35:14 +0000 (Sat, 16 Mar 2019) 4 | # 5 | # https://github.com/HariSekhon/DevOps-Bash-tools 6 | # 7 | # License: see accompanying LICENSE file 8 | # 9 | # https://www.linkedin.com/in/HariSekhon 10 | # 11 | 12 | # ============================================================================ # 13 | # Alpine Desktop Package Requirements 14 | # ============================================================================ # 15 | 16 | skopeo 17 | steghide 18 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/pip-packages-mac.txt: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sts=4:sw=4:et 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2023-05-13 01:50:26 +0100 (Sat, 13 May 2023) 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 11 | # 12 | # https://www.linkedin.com/in/HariSekhon 13 | # 14 | 15 | # can only be installed on macOS 16 | 17 | pyobjc-framework-Quartz 18 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/R-packages.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2014-12-29 21:10:12 +0000 (Mon, 29 Dec 2014) 4 | # 5 | # https://github.com/HariSekhon/DevOps-Bash-tools 6 | # 7 | # License: see accompanying LICENSE file 8 | # 9 | # https://www.linkedin.com/in/HariSekhon 10 | # 11 | 12 | # R packages to install from CRAN 13 | 14 | arules # Apriori Association Rules 15 | data.table 16 | devtools 17 | e1071 # Naiive Bayes 18 | ggplot2 19 | httr 20 | jsonlite 21 | reshape 22 | RJava 23 | ROCR # used with Naiive Bayes 24 | rpart # Decision Trees 25 | rpart.plot 26 | slidify 27 | -------------------------------------------------------------------------------- /.github/SCRIPTS/commit-all.sh: -------------------------------------------------------------------------------- 1 | rm -rf /Users/zhangzixiong/Desktop/Workspace/Github/ngte/wx-chevalier.github.com/content/books 2 | rm -rf /Users/zhangzixiong/Desktop/Workspace/Github/ngte/wx-chevalier.github.com/docs/books 3 | 4 | for file in *; do 5 | [ -d "$file" ] || continue 6 | 7 | if [ "$file" == "Private" ] || [ "$file" == "config" ] || [ "$file" == "examples" ] || [ "$file" == "models" ] || [ "$file" == "algorithms" ] || [ "$file" == "code" ]; then 8 | continue 9 | fi 10 | 11 | echo "cd $file" 12 | cd ./$file 13 | 14 | ./commit-all.sh 15 | 16 | cd .. 17 | done 18 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/configs/.sqliterc: -------------------------------------------------------------------------------- 1 | -- vim:ts=4:sts=4:sw=4:et 2 | -- 3 | -- Author: Hari Sekhon 4 | -- Date: 2020-07-21 20:39:48 +0100 (Tue, 21 Jul 2020) 5 | -- 6 | -- https://github.com/HariSekhon/DevOps-Bash-tools 7 | -- 8 | -- License: see accompanying Hari Sekhon LICENSE file 9 | -- 10 | -- If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 11 | -- 12 | -- https://www.linkedin.com/in/HariSekhon 13 | -- 14 | 15 | .headers on 16 | .mode column 17 | .nullvalue NULL 18 | -- .prompt "> " 19 | .timer on 20 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/gocd_config_repo.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "bash-tools", 3 | "plugin_id": "yaml.config.plugin", 4 | "material": { 5 | "type": "git", 6 | "attributes": { 7 | "url": "https://github.com/HariSekhon/DevOps-Bash-tools", 8 | "branch": "master", 9 | "auto_update": true 10 | } 11 | }, 12 | "configuration": [ 13 | { 14 | "key": "file_pattern", 15 | "value": "cicd/*.gocd.y*ml" 16 | } 17 | ], 18 | "rules": [ 19 | { 20 | "directive": "allow", 21 | "action": "*", 22 | "type": "*", 23 | "resource": "*" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/npm-packages.txt: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sts=4:sw=4:et 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2019-11-18 12:53:03 +0000 (Mon, 18 Nov 2019) 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 11 | # 12 | # https://www.linkedin.com/in/HariSekhon 13 | # 14 | 15 | # NodeJS packages - one per line 16 | 17 | #js-yaml # in npm-packages-desktop.txt 18 | jsonlint 19 | -------------------------------------------------------------------------------- /.github/META/commit-all.sh: -------------------------------------------------------------------------------- 1 | (cd /Users/zhangzixiong/Desktop/Github/AI/Soogle/sg-index-doc && npm run ts ./src/cli/generate-toc.ts) 2 | 3 | for file in *; do 4 | [ -d "$file" ] || continue 5 | 6 | if [ "$file" == "config" ] || [ "$file" == "examples" ] || [ "$file" == "models" ] || [ "$file" == "algorithms" ] || [ "$file" == "code" ]; then 7 | continue 8 | fi 9 | 10 | echo "cd $file"; 11 | cd ./$file 12 | # git lfs uninstall 13 | git lfs track *.zip 14 | 15 | git add --all 16 | git commit -m "feat: update articles" 17 | git pull 18 | git push 19 | cd .. 20 | done -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/applescript/com.harisekhon.wakeup_script.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | com.harisekhon.wakeup_script 7 | Program 8 | /Users/hari/github/bash-tools/applescript/wakeup_script.sh 9 | WatchPaths 10 | 11 | /var/db/.AppleSetupDone 12 | 13 | RunAtLoad 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/configs/.aws/shell/awsshellrc: -------------------------------------------------------------------------------- 1 | [aws-shell] 2 | 3 | # fuzzy or substring match. 4 | match_fuzzy = True 5 | 6 | # vi or emacs key bindings. 7 | enable_vi_bindings = False 8 | 9 | # multi or single column completion menu. 10 | show_completion_columns = False 11 | 12 | # show or hide the help pane. 13 | show_help = True 14 | 15 | # visual theme. possible values: manni, igor, xcode, vim, 16 | # autumn,vs, rrt, native, perldoc, borland, tango, emacs, 17 | # friendly, monokai, paraiso-dark, colorful, murphy, bw, 18 | # pastie, paraiso-light, trac, default, fruity. 19 | # to disable themes, set theme = none 20 | theme = vim 21 | -------------------------------------------------------------------------------- /常用脚本/README.md: -------------------------------------------------------------------------------- 1 | mvn install -DskipTests -Dmaven.test.skip 2 | 3 | git config --global credential.helper cache 4 | 5 | yarn install --registry=https://registry.npmjs.org/ 6 | 7 | yarn install --registry=https://registry.npmmirror.com/ 8 | 9 | npm publish --registry=https://registry.npmjs.org/ --access public 10 | 11 | git config --global http.proxy http://127.0.0.1:7890 12 | 13 | defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder 14 | 15 | git config --global branch.autosetuprebase always 16 | git config --global pull.rebase false 17 | 18 | git pull --no-rebase 19 | 20 | '(.[\u4E00-\u9FA5]+)|([\u4E00-\u9FA5]+.)' 21 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/configs/.perlcritic_forbidden_modules: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sts=4:sw=4:et 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2019-10-29 22:33:20 +0000 (Tue, 29 Oct 2019) 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 11 | # 12 | # https://www.linkedin.com/in/HariSekhon 13 | # 14 | 15 | Switch Use if, elsif instead of the deprecated Switch module 16 | Fatal Use autodie instead of Fatal 17 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/cpan-packages-desktop.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2013-02-18 10:48:12 +0000 (Mon, 18 Feb 2013) 4 | # 5 | # vim:ts=4:sw=4:et 6 | 7 | App::Ack 8 | App::cpanminus 9 | App::FatPacker 10 | # useful for converting JSON to YAML 11 | Catmandu 12 | DBD::mysql 13 | IO::Socket::SSL 14 | JSON 15 | JSON::XS 16 | LWP::Simple 17 | LWP::UserAgent 18 | Mail::IMAPClient 19 | Net::DNS 20 | Net::SSH::Expect 21 | Perl::Critic 22 | Test::Kwalitee 23 | Net::SSLeay 24 | SMS::AQL 25 | Test::More 26 | Text::Unidecode 27 | Thrift::BinaryProtocol 28 | Thrift::BufferedTransport 29 | Thrift::Socket 30 | URI::Escape 31 | XML::Simple 32 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/cpan-requirements.txt: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sts=4:sw=4:noet 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2013-01-06 15:45:00 +0000 (Sun, 06 Jan 2013) 5 | # 6 | # https://github.com/HariSekhon/lib 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # https://www.linkedin.com/in/HariSekhon 11 | # 12 | 13 | # ============================================================================ # 14 | # CPAN Module Dependencies 15 | # ============================================================================ # 16 | 17 | # needed by bash-tools/perl_generate_fatpacks.sh 18 | App::FatPacker 19 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/npm-packages-desktop.txt: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sts=4:sw=4:et 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2019-11-18 12:53:03 +0000 (Mon, 18 Nov 2019) 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 11 | # 12 | # https://www.linkedin.com/in/HariSekhon 13 | # 14 | 15 | # NodeJS desktop packages - one per line 16 | 17 | @mermaid-js/mermaid-cli 18 | codefresh 19 | js-yaml 20 | netlify-cli 21 | nodemon 22 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.bash.d/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2016-01-17 12:56:53 +0000 (Sun, 17 Jan 2016) 4 | # 5 | # vim:ts=4:sts=4:sw=4:noet 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback 10 | # 11 | # https://www.linkedin.com/in/HariSekhon 12 | # 13 | 14 | include ../Makefile.in 15 | 16 | REPO := HariSekhon/DevOps-Bash-tools 17 | 18 | BASH_TOOLS := .. 19 | 20 | .PHONY: readme 21 | readme: 22 | @source $(BASH_TOOLS)/.bash.d/network.sh; browser "https://github.com/$(REPO)/blob/master/.bash.d/README.md" 23 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "SQL"] 2 | path = SQL 3 | url = https://github.com/HariSekhon/SQL-scripts 4 | [submodule "sql"] 5 | path = sql 6 | url = https://github.com/HariSekhon/SQL-scripts 7 | [submodule "templates"] 8 | path = templates 9 | url = https://github.com/HariSekhon/Templates 10 | [submodule "vagrant-configs"] 11 | path = vagrant-configs 12 | url = https://github.com/HariSekhon/Vagrant-templates 13 | [submodule "packer"] 14 | path = packer 15 | url = https://github.com/HariSekhon/Packer-templates 16 | [submodule "kubernetes-configs"] 17 | path = kubernetes-configs 18 | url = https://github.com/HariSekhon/Kubernetes-configs 19 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/applescript/screensaver_activate.scpt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env osascript 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2022-12-05 22:21:47 +0000 (Mon, 05 Dec 2022) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # Activate the macOS screensaver programmatically 17 | 18 | tell application "ScreenSaverEngine" to activate 19 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/cicd/run_latest_tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2016-01-23 17:19:22 +0000 (Sat, 23 Jan 2016) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -euo pipefail 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | VERSION=latest "$srcdir/run_tests.sh" "$@" 21 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/jenkins-plugins.txt: -------------------------------------------------------------------------------- 1 | # Basic list of plugins to get started, generated by: 2 | # 3 | # jenkins_cli.sh list-plugins | awk '{print $1":"$NF}' | sort > setup/jenkins_plugins.txt 4 | # 5 | # For a more comprehensive list of awesome plugins, see: 6 | # 7 | # https://github.com/HariSekhon/Kubernetes-configs/blob/master/jenkins-values.yaml 8 | # 9 | blueocean:1.22.0 10 | build-timeout:1.19.1 11 | command-launcher:1.4 12 | #convert-to-pipeline:1.0 13 | git-client:3.2.1 14 | git-server:1.9 15 | git:4.2.2 16 | github-api:1.106 17 | github-branch-source:2.6.0 18 | github:1.29.5 19 | gradle:1.36 20 | junit:1.28 21 | timestamper:1.11.2 22 | workflow-aggregator:2.6 23 | -------------------------------------------------------------------------------- /Bash Commands/ps/99~参考资料/psaux.bash/README.md: -------------------------------------------------------------------------------- 1 | `ps aux` written entirely in bash without ever forking 2 | ====================================================== 3 | 4 | An interview question for a position that requires knowledge of bash/linux/stuff could be: 5 | 6 | > What if you're ssh'd into a machine, you're in your trusty bash shell, but unfortunately you cannot spawn any new processes because literally all other pids are taken. What do you do? 7 | 8 | And if that's what you're facing, this might be the tool for you! Now you can kinda sorta pretend that you have access to a working `ps aux`. 9 | 10 | It definitely totally works on 100% of the machines in every situation ever, guaranteed. 11 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_kubescape.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2022-10-11 10:21:17 +0100 (Tue, 11 Oct 2022) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -euo pipefail 17 | [ -n "${DEBUG:-}" ] && set -x 18 | 19 | curl -s https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash 20 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/configs/.toprc: -------------------------------------------------------------------------------- 1 | RCfile for "top with windows" # shameless braggin' 2 | Id:a, Mode_altscr=0, Mode_irixps=1, Delay_time=3.000, Curwin=0 3 | CPU fieldscur=AEHIOQTWKNMbcdfgjplrsuvyzX 4 | winflags=65337, sortindx=10, maxtasks=0 5 | summclr=2, msgsclr=6, headclr=2, taskclr=6 6 | TIM fieldscur=ABcefgjlrstuvyzMKNHIWOPQDX 7 | winflags=65337, sortindx=12, maxtasks=0 8 | summclr=6, msgsclr=6, headclr=1, taskclr=1 9 | MEM fieldscur=ANOPQRSTUVbcdefgjlmyzWHIKX 10 | winflags=65337, sortindx=14, maxtasks=0 11 | summclr=5, msgsclr=5, headclr=4, taskclr=5 12 | USR fieldscur=AbdEcgfHIjlOPQrstuvyzMKNWX 13 | winflags=65337, sortindx=7, maxtasks=0 14 | summclr=3, msgsclr=3, headclr=2, taskclr=3 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/applescript/get_frontmost_process.scpt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env osascript 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2022-02-28 13:05:26 +0000 (Mon, 28 Feb 2022) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | tell application "System Events" 17 | set frontmostProcess to first process where it is frontmost 18 | name of frontmostProcess 19 | end tell 20 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/jenkins/jenkins_count_jobs.groovy: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Hari Sekhon 3 | // Date: 2021-04-08 19:16:17 +0100 (Thu, 08 Apr 2021) 4 | // 5 | // vim:ts=4:sts=4:sw=4:noet 6 | // 7 | // https://github.com/HariSekhon/DevOps-Bash-tools 8 | // 9 | // License: see accompanying Hari Sekhon LICENSE file 10 | // 11 | // If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | // 13 | // https://www.linkedin.com/in/HariSekhon 14 | // 15 | 16 | // Paste this into $JENKINS_URL/script 17 | // 18 | // Jenkins -> Manage Jenkins -> Script Console 19 | 20 | jenkins.model.Jenkins.instance.items.findAll().size 21 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/docker-compose/gerrit.yml: -------------------------------------------------------------------------------- 1 | # vim:ts=2:sts=2:sw=2:et 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2020-07-08 13:36:32 +0100 (Wed, 08 Jul 2020) 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 11 | # 12 | # https://www.linkedin.com/in/HariSekhon 13 | # 14 | 15 | version: '3' 16 | 17 | services: 18 | gerrit: 19 | hostname: gerrit 20 | image: gerritcodereview/gerrit:${VERSION:-latest} 21 | ports: 22 | - 8080:8080 23 | - 29418:29418 24 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/applescript/set_frontmost_process.scpt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env osascript 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2022-02-28 13:05:26 +0000 (Mon, 28 Feb 2022) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | on run argv 17 | tell application "System Events" 18 | set frontmost of application process (item 1 of argv) to true 19 | end tell 20 | end run 21 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/gem-packages-desktop.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2013-02-18 10:47:57 +0000 (Mon, 18 Feb 2013) 4 | # 5 | # vim:ts=4:sw=4:et 6 | 7 | gitlab 8 | gist 9 | jgrep 10 | lolcat 11 | 12 | # installed via homebrew now, can't find gem any more 13 | #rbenv 14 | 15 | # mdl needs ruby >= 2.4.0 whereas older Macs may have 2.3.0 - if so install manually via: 16 | # 17 | # brew install ruby 18 | # 19 | # GEM=/usr/local/Cellar/ruby/*/bin/gem ./ruby_gem_install.sh mdl 20 | # 21 | # will be picked up by new shells via .bash.d/paths.sh automatically detecting and adding ~/.gem/ruby/*/bin 22 | # 23 | # on macOS Catalina I now have Ruby 2.6 so this can install normally 24 | mdl 25 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/configs/.sawsrc: -------------------------------------------------------------------------------- 1 | [main] 2 | 3 | # Visual theme. Possible values: manni, igor, xcode, vim, autumn, vs, rrt, 4 | # native, perldoc, borland, tango, emacs, friendly, monokai, paraiso-dark, 5 | # colorful, murphy, bw, pastie, paraiso-light, trac, default, fruity 6 | theme = vim 7 | 8 | # Use color output mode. 9 | color_output = True 10 | 11 | # Use fuzzy matching mode for resources (default is to use simple substring match). 12 | fuzzy_match = True 13 | 14 | # Use shortcut matching mode 15 | shortcut_match = True 16 | 17 | # log_file location. 18 | log_file = ~/.saws.log 19 | 20 | # Default log level. Possible values: "CRITICAL", "ERROR", "WARNING", "INFO" 21 | # and "DEBUG". 22 | log_level = INFO 23 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/upgrade_gradle_wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-05-31 16:20:04 +0100 (Sun, 31 May 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -euo pipefail 17 | [ -n "${DEBUG:-}" ] && set -x 18 | 19 | GRADLE_VERSION="${GRADLE_VERSION:-6.4.1}" 20 | 21 | ./gradlew wrapper --gradle-version="$GRADLE_VERSION" --distribution-type=bin 22 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.zlogin: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-03-13 18:58:03 +0000 (Fri, 13 Mar 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # ============================================================================ # 17 | # Z S H L o g i n 18 | # ============================================================================ # 19 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.zlogout: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-03-13 18:58:03 +0000 (Fri, 13 Mar 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # ============================================================================ # 17 | # Z S H L o g o u t 18 | # ============================================================================ # 19 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/aws/aws_budget.json: -------------------------------------------------------------------------------- 1 | { 2 | "BudgetName": "AWS_Charges", 3 | "BudgetType": "COST", 4 | "BudgetLimit": { 5 | "Amount": "", 6 | "Unit": "USD" 7 | }, 8 | "CostFilters": {}, 9 | "CostTypes": { 10 | "IncludeTax": true, 11 | "IncludeSubscription": true, 12 | "UseBlended": false, 13 | "IncludeRefund": false, 14 | "IncludeCredit": false, 15 | "IncludeUpfront": true, 16 | "IncludeRecurring": true, 17 | "IncludeOtherSubscription": true, 18 | "IncludeSupport": true, 19 | "IncludeDiscount": true, 20 | "UseAmortized": false 21 | }, 22 | "TimeUnit": "MONTHLY", 23 | "TimePeriod": { 24 | "Start": "2021-08-01T01:00:00+01:00", 25 | "End": "2087-06-15T01:00:00+01:00" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_oh-my-zsh.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-03-01 21:01:50 +0000 (Sun, 01 Mar 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -euo pipefail 17 | [ -n "${DEBUG:-}" ] && set -x 18 | 19 | echo "downloading Oh-my-Zsh..." 20 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 21 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kafka/kafka_cli_jaas.conf: -------------------------------------------------------------------------------- 1 | // vim:ts=4:sts=4:sw=4:et 2 | // 3 | // Author: Hari Sekhon 4 | // Date: 2016-06-28 14:39:32 +0100 (Tue, 28 Jun 2016) 5 | // 6 | // https://github.com/HariSekhon/DevOps-Bash-tools 7 | // 8 | // License: see accompanying Hari Sekhon LICENSE file 9 | // 10 | // If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 11 | // 12 | // https://www.linkedin.com/in/HariSekhon 13 | // 14 | 15 | KafkaClient { 16 | com.sun.security.auth.module.Krb5LoginModule required 17 | useKeyTab=false 18 | useTicketCache=true 19 | renewTGT=false 20 | doNotPrompt=true 21 | serviceName="kafka"; 22 | }; 23 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/checks/check_python3_compat.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2015-05-25 01:38:24 +0100 (Mon, 25 May 2015) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -euo pipefail 17 | [ -n "${DEBUG:-}" ] && set -x 18 | 19 | pip install caniusepython3 20 | echo "Testing module dependencies for Python 3 compatibility" 21 | caniusepython3 -r requirements.txt 22 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/brew-packages-desktop-casks.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2011-06-01 16:58:33 +0000 (Wed, 01 Jun 2011) 4 | # 5 | 6 | # run: CASK=1 ../packages/brew_install_packages.sh brew-packages-desktop-casks.txt 7 | 8 | anaconda 9 | atom 10 | barrier 11 | ccmenu 12 | codeship/taps/jet 13 | docker 14 | #insomnia # Kong Rest API testing client desktop app 15 | #iterm2 16 | #firefox-developer-edition 17 | google-chrome 18 | google-cloud-sdk 19 | intellij-idea-ce 20 | keepassxc 21 | keka 22 | minikube 23 | minishift 24 | multipass # instant Ubuntu VMs 25 | podman 26 | postman 27 | powershell 28 | spotify 29 | vagrant 30 | virtualbox 31 | vnc-viewer 32 | wireshark # installs GUI, without cask only install CLI utils like tshark 33 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bin/urldecode.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-03-03 17:47:02 +0000 (Tue, 03 Mar 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # Quick command line URL decoding 17 | 18 | set -euo pipefail 19 | [ -n "${DEBUG:-}" ] && set -x 20 | 21 | if [ $# -gt 0 ]; then 22 | echo "$@" 23 | else 24 | cat 25 | fi | 26 | perl -MURI::Escape -ne 'chomp; print uri_unescape($_) . "\n"' 27 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_pulumi_cli.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2022-07-21 09:46:37 +0100 (Thu, 21 Jul 2022) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -euo pipefail 17 | [ -n "${DEBUG:-}" ] && set -x 18 | #srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # installs to ~/.pulumi/bin/ 21 | curl -fsSL https://get.pulumi.com | sh 22 | echo 23 | ~/.pulumi/bin/pulumi version 24 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/lib/mac.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-08-17 20:21:43 +0100 (Mon, 17 Aug 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # designed to be included from utils.sh 17 | 18 | set -euo pipefail 19 | [ -n "${DEBUG:-}" ] && set -x 20 | 21 | if ! is_mac; then 22 | return 23 | fi 24 | 25 | if ! type tac &>/dev/null; then 26 | tac(){ 27 | gtac "$@" 28 | } 29 | fi 30 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/cpan-requirements-optional.txt: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sts=4:sw=4:noet 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2013-01-06 15:45:00 +0000 (Sun, 06 Jan 2013) 5 | # 6 | # https://github.com/HariSekhon/lib 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # https://www.linkedin.com/in/HariSekhon 11 | # 12 | 13 | # ============================================================================ # 14 | # Optional CPAN Module Dependencies 15 | # ============================================================================ # 16 | 17 | # needed for PAR::Packer 18 | ExtUtils::Embed 19 | 20 | # needed by perl_generate_par_binaries.sh 21 | PAR::Packer 22 | 23 | # for json2yaml.sh / yaml2json.sh 24 | JSON::XS 25 | YAML::XS 26 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/jenkins/jenkins_jobs_disabled.groovy: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Hari Sekhon 3 | // Date: 2022-01-25 19:26:05 +0000 (Tue, 25 Jan 2022) 4 | // 5 | // vim:ts=4:sts=4:sw=4:noet 6 | // 7 | // https://github.com/HariSekhon/DevOps-Bash-tools 8 | // 9 | // License: see accompanying Hari Sekhon LICENSE file 10 | // 11 | // If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | // 13 | // https://www.linkedin.com/in/HariSekhon 14 | // 15 | 16 | // Lists all disabled Jenkins jobs 17 | 18 | // Paste this into $JENKINS_URL/script 19 | // 20 | // Jenkins -> Manage Jenkins -> Script Console 21 | 22 | jenkins.model.Jenkins.instance.items.findAll { it.isDisabled() }.each { println it.name }.size 23 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2020-03-17 11:41:13 +0000 (Tue, 17 Mar 2020) 4 | # 5 | # vim:ts=2:sts=2:sw=2:et 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | build: 17 | image: default-bionic 18 | nodes: 19 | auto: 20 | commands: 21 | - repo="${SCRUTINIZER_PROJECT#*/}"; git clone "https://github.com/$repo" build 22 | - cd ~/build 23 | - pwd 24 | - ls -l 25 | - make init 26 | - make ci test 27 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/lib/os.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2015-05-25 01:38:24 +0100 (Mon, 25 May 2015) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -eu 17 | [ -n "${DEBUG:-}" ] && set -x 18 | 19 | is_linux(){ 20 | if [ "$(uname -s)" = "Linux" ]; then 21 | return 0 22 | fi 23 | return 1 24 | } 25 | 26 | is_mac(){ 27 | if [ "$(uname -s)" = "Darwin" ]; then 28 | return 0 29 | fi 30 | return 1 31 | } 32 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_fossa_cli.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2022-05-22 12:48:07 +0100 (Sun, 22 May 2022) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # https://github.com/fossas/fossa-cli 17 | 18 | set -euo pipefail 19 | [ -n "${DEBUG:-}" ] && set -x 20 | #srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 21 | 22 | curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash 23 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kafka/kafka_producer_perf_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-07-30 15:16:58 +0100 (Tue, 30 Jul 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -u 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # sources heap, kerberos, brokers, zookeepers etc 21 | # shellcheck source=.bash.d/kafka.sh 22 | . "$srcdir/.bash.d/kafka.sh" 23 | 24 | exec kafka-producer-perf-test.sh "$@" 25 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/teamcity-mysql-setup.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Author: Hari Sekhon 3 | -- Date: 2020-11-24 11:25:23 +0000 (Tue, 24 Nov 2020) 4 | -- 5 | -- vim:ts=2:sts=2:sw=2:et:filetype=sql 6 | -- 7 | -- https://github.com/HariSekhon/DevOps-Bash-tools 8 | -- 9 | -- License: see accompanying Hari Sekhon LICENSE file 10 | -- 11 | -- If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | -- 13 | -- https://www.linkedin.com/in/HariSekhon 14 | -- 15 | 16 | -- https://www.jetbrains.com/help/teamcity/setting-up-an-external-database.html#MySQL 17 | 18 | create database teamcity collate utf8_bin; 19 | create user teamcity identified by 'teamcity'; 20 | grant all privileges on teamcity.* to teamcity; 21 | grant process on *.* to teamcity; 22 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/jenkins/jenkins_job_disable.groovy: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Hari Sekhon 3 | // Date: 2022-01-25 19:26:05 +0000 (Tue, 25 Jan 2022) 4 | // 5 | // vim:ts=4:sts=4:sw=4:noet 6 | // 7 | // https://github.com/HariSekhon/DevOps-Bash-tools 8 | // 9 | // License: see accompanying Hari Sekhon LICENSE file 10 | // 11 | // If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | // 13 | // https://www.linkedin.com/in/HariSekhon 14 | // 15 | 16 | // Paste this into $JENKINS_URL/script 17 | // 18 | // Jenkins -> Manage Jenkins -> Script Console 19 | 20 | // XXX: Edit this to the name of your job pipeline 21 | def jobName = "My Dev Pipeline" 22 | def job = Jenkins.instance.getItem(jobName) 23 | job.setDisabled(true) 24 | job.isDisabled() 25 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.zshenv: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-03-13 18:58:03 +0000 (Fri, 13 Mar 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # ============================================================================ # 17 | # Z S H E n v 18 | # ============================================================================ # 19 | 20 | # sourced by both interactive shells and scripts 21 | # 22 | # be careful with you put in here 23 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/jenkins/jenkins_jobs_status.groovy: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Hari Sekhon 3 | // Date: 2022-01-25 19:26:05 +0000 (Tue, 25 Jan 2022) 4 | // 5 | // vim:ts=4:sts=4:sw=4:noet 6 | // 7 | // https://github.com/HariSekhon/DevOps-Bash-tools 8 | // 9 | // License: see accompanying Hari Sekhon LICENSE file 10 | // 11 | // If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | // 13 | // https://www.linkedin.com/in/HariSekhon 14 | // 15 | 16 | // List all Jenkins jobs prefix with whether they are enabled or disabled 17 | 18 | // Paste this into $JENKINS_URL/script 19 | // 20 | // Jenkins -> Manage Jenkins -> Script Console 21 | 22 | jenkins.model.Jenkins.instance.items.findAll().each { println "disabled: ${it.isDisabled()}\t\tname: ${it.name}" }.size 23 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bin/random_select.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2016-08-01 17:53:24 +0100 (Mon, 01 Aug 2016) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -eu 17 | [ -n "${DEBUG:-}" ] && set -x 18 | 19 | 20 | if [ -z "$*" ]; then 21 | echo "usage: ${0##*/} arg1 arg2 arg3 ..." 22 | exit 1 23 | fi 24 | 25 | i=0 26 | for x in "$@"; do 27 | a[$i]="$x" 28 | ((i + 1)) 29 | done 30 | 31 | num=${#@} 32 | 33 | selected=$((RANDOM % num)) 34 | 35 | echo "${a[$selected]}" 36 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/jenkins/jenkins_jobs.groovy: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Hari Sekhon 3 | // Date: 2021-04-08 19:16:17 +0100 (Thu, 08 Apr 2021) 4 | // 5 | // vim:ts=4:sts=4:sw=4:noet 6 | // 7 | // https://github.com/HariSekhon/DevOps-Bash-tools 8 | // 9 | // License: see accompanying Hari Sekhon LICENSE file 10 | // 11 | // If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | // 13 | // https://www.linkedin.com/in/HariSekhon 14 | // 15 | 16 | // Paste this into $JENKINS_URL/script 17 | // 18 | // Jenkins -> Manage Jenkins -> Script Console 19 | 20 | //jenkins.model.Jenkins.instance.items.findAll().each { println it.name } // return the whole array, don't want that, just return num 21 | jenkins.model.Jenkins.instance.items.findAll().each { println it.displayName }.size 22 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/perl/perlpath.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # shellcheck disable=SC2230 3 | # vim:ts=4:sts=4:sw=4:et 4 | # 5 | # Author: Hari Sekhon 6 | # Date: 2019-09-27 17:12:39 +0100 (Fri, 27 Sep 2019) 7 | # 8 | # https://github.com/HariSekhon/DevOps-Bash-tools 9 | # 10 | # License: see accompanying Hari Sekhon LICENSE file 11 | # 12 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 13 | # 14 | # https://www.linkedin.com/in/HariSekhon 15 | # 16 | 17 | # Prints the Perl @INC paths, one per line 18 | 19 | set -euo pipefail 20 | [ -n "${DEBUG:-}" ] && set -x 21 | 22 | # copied from old bashrc function which is now ported under .bash.d/ too, but given here for convenience in case you are not running the full bash profile 23 | perl -e 'print join("\n", @INC);' 24 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/git/git_merge_all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2017-11-21 10:43:47 +0100 (Tue, 21 Nov 2017) 6 | # 7 | # https://github.com/HariSekhon/Dockerfiles 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -euo pipefail 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # shellcheck source=lib/git.sh 21 | . "$srcdir/lib/git.sh" 22 | 23 | # For Git < 2.0 may need to set: 24 | # 25 | # git config merge.defaultToUpstream true 26 | 27 | foreachbranch 'git merge --no-edit' 28 | 29 | git checkout master 30 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bin/exec_interactive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-02-15 12:51:17 +0000 (Fri, 15 Feb 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # cannot -set -o pipefail because some docker images version of 'sh' do not support it, namely debian and ubuntu 17 | set -eu 18 | [ -n "${DEBUG:-}" ] && set -x 19 | 20 | # cannot allow set -e because it will cause an exit before the exec to interactive 21 | ( 22 | exec "${SHELL:-sh}" -i 3<&- <&4 26 | EOF 27 | ) 28 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/apk-packages-optional.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2019-03-16 20:35:14 +0000 (Sat, 16 Mar 2019) 4 | # 5 | # https://github.com/HariSekhon/DevOps-Bash-tools 6 | # 7 | # License: see accompanying LICENSE file 8 | # 9 | # https://www.linkedin.com/in/HariSekhon 10 | # 11 | 12 | # ============================================================================ # 13 | # Alpine Package Requirements 14 | # ============================================================================ # 15 | 16 | # Packages that don't error if failing to install 17 | 18 | # Python is a mess and breaks with this on latest Alpine 3, so do as best effort 19 | # 20 | # python (missing): 21 | # ERROR: unsatisfiable constraints: 22 | # required by: world[python] 23 | 24 | python 25 | python2 26 | python3 27 | py-pip 28 | py2-pip 29 | py3-pip 30 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.bash.d/z_final.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # shellcheck disable=SC2230 3 | # vim:ts=4:sts=4:sw=4:et 4 | # 5 | # Author: Hari Sekhon 6 | # Date: circa 2006 (forked from .bashrc) 7 | # 8 | # https://github.com/HariSekhon/DevOps-Bash-tools 9 | # 10 | # License: see accompanying Hari Sekhon LICENSE file 11 | # 12 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 13 | # 14 | # https://www.linkedin.com/in/HariSekhon 15 | # 16 | 17 | # ============================================================================ # 18 | # F i n a l i z a t i o n 19 | # ============================================================================ # 20 | 21 | # place to add last minute clean ups like path deduping 22 | 23 | # slows down new shells 24 | #dedupe_paths 25 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kafka/kafka_acls.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-07-30 15:16:58 +0100 (Tue, 30 Jul 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -u 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # sources heap, kerberos, brokers, zookeepers etc 21 | # shellcheck source=.bash.d/kafka.sh 22 | . "$srcdir/.bash.d/kafka.sh" 23 | 24 | # it's assigned in .bash.d/kafka.sh 25 | # shellcheck disable=SC2154,SC2086 26 | kafka-acls.sh $bootstrap_server "$@" 27 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kafka/kafka_configs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-07-30 15:16:58 +0100 (Tue, 30 Jul 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -u 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # sources heap, kerberos, brokers, zookeepers etc 21 | # shellcheck source=.bash.d/kafka.sh 22 | . "$srcdir/.bash.d/kafka.sh" 23 | 24 | # it's assigned in .bash.d/kafka.sh 25 | # shellcheck disable=SC2154,SC2086 26 | kafka-configs.sh $kafka_zookeeper "$@" 27 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/python_mac_upgrade_ssl_fix.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2019-09-16 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying LICENSE file 9 | # 10 | # https://www.linkedin.com/in/HariSekhon 11 | # 12 | 13 | # from https://stackoverflow.com/questions/24287239/abort-trap-6-when-running-a-python-script 14 | 15 | set -euo pipefail 16 | 17 | sudo="" 18 | [ $EUID -eq 0 ] || sudo=sudo 19 | 20 | #brew update && brew upgrade && brew install openssl 21 | cd /usr/local/Cellar/openssl/*/lib 22 | sudo cp -- libssl.1.0.0.dylib libcrypto.1.0.0.dylib /usr/local/lib/ 23 | cd /usr/local/lib 24 | [ -f libssl.dylib ] || 25 | $sudo ln -s -- libssl.1.0.0.dylib libssl.dylib 26 | [ -f libcrypto.dylib ] || 27 | $sudo ln -s -- libcrypto.1.0.0.dylib libcrypto.dylib 28 | #pip3 install --upgrade packagename 29 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/go-packages-desktop.txt: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sts=4:sw=4:et 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2019-09-06 17:09:33 +0100 (Fri, 06 Sep 2019) 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 11 | # 12 | # https://www.linkedin.com/in/HariSekhon 13 | # 14 | 15 | # List of Golang software to install via 'go install', one per line, and if not @version is suffixed, will assume @latest 16 | 17 | golang.org/x/tools/cmd/goimports 18 | github.com/remind101/assume-role 19 | github.com/songgao/colorgo 20 | github.com/cjbassi/gotop 21 | github.com/mkouhei/gosh 22 | github.com/rakyll/hey 23 | #github.com/PaulRosset/previs 24 | #github.com/wercker/wercker 25 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.hound.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2020-09-23 10:28:21 +0100 (Wed, 23 Sep 2020) 4 | # 5 | # vim:ts=2:sts=2:sw=2:et 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | --- 17 | # https://intercom.help/hound/en/articles/2138537-flake8 18 | flake8: 19 | enabled: true 20 | #config_file: .flake8 21 | 22 | # http://help.houndci.com/en/articles/2138564-shellcheck 23 | shellcheck: 24 | enabled: true 25 | #config_file: .shellcheck.yml 26 | 27 | # http://help.houndci.com/en/articles/2138524-golint 28 | golint: 29 | enabled: false 30 | 31 | #fail_on_violations: true 32 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/git/git_merge_master.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2017-11-21 10:43:47 +0100 (Tue, 21 Nov 2017) 6 | # 7 | # https://github.com/HariSekhon/Dockerfiles 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -euo pipefail 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # shellcheck source=lib/git.sh 21 | . "$srcdir/lib/git.sh" 22 | 23 | # For Git < 2.0 may need to set: 24 | # 25 | # git config merge.defaultToUpstream true 26 | 27 | foreachbranch 'git merge --no-edit && git merge master --no-edit' 28 | 29 | git checkout master 30 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kafka/kafka_console_producer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-07-30 15:16:58 +0100 (Tue, 30 Jul 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -u 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # sources heap, kerberos, brokers, zookeepers etc 21 | # shellcheck source=.bash.d/kafka.sh 22 | . "$srcdir/.bash.d/kafka.sh" 23 | 24 | # it's assigned in .bash.d/kafka.sh 25 | # shellcheck disable=SC2154,SC2086 26 | exec kafka-console-producer.sh $broker_list "$@" 27 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kafka/kafka_console_consumer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-07-30 15:16:58 +0100 (Tue, 30 Jul 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -u 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # sources heap, kerberos, brokers, zookeepers etc 21 | # shellcheck source=.bash.d/kafka.sh 22 | . "$srcdir/.bash.d/kafka.sh" 23 | 24 | # it's assigned in .bash.d/kafka.sh 25 | # shellcheck disable=SC2154,SC2086 26 | exec kafka-console-consumer.sh $bootstrap_server "$@" 27 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kafka/kafka_consumer_groups.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-07-30 15:16:58 +0100 (Tue, 30 Jul 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -u 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # sources heap, kerberos, brokers, zookeepers etc 21 | # shellcheck source=.bash.d/kafka.sh 22 | . "$srcdir/.bash.d/kafka.sh" 23 | 24 | # it's assigned in .bash.d/kafka.sh 25 | # shellcheck disable=SC2154,SC2086 26 | exec kafka-consumer-groups.sh $bootstrap_server "$@" 27 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kafka/kafka_consumer_perf_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-07-30 15:16:58 +0100 (Tue, 30 Jul 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -u 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # sources heap, kerberos, brokers, zookeepers etc 21 | # shellcheck source=.bash.d/kafka.sh 22 | . "$srcdir/.bash.d/kafka.sh" 23 | 24 | # it's assigned in .bash.d/kafka.sh 25 | # shellcheck disable=SC2154,SC2086 26 | exec kafka-consumer-perf-test.sh $broker_list "$@" 27 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/wercker/wercker.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2020-02-24 15:41:04 +0000 (Mon, 24 Feb 2020) 4 | # 5 | # vim:ts=2:sts=2:sw=2:et 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # https://devcenter.wercker.com/reference/wercker-yml/ 17 | 18 | box: debian 19 | 20 | build: 21 | steps: 22 | - script: 23 | name: ci bootstrap 24 | code: setup/ci_bootstrap.sh 25 | - script: 26 | name: init 27 | code: make init 28 | - script: 29 | name: build 30 | code: make ci 31 | - script: 32 | name: test 33 | code: make test 34 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/applescript/get_mouse_coordinates.scpt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env osascript 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-06-13 20:43:57 +0100 (Sat, 13 Jun 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # Gets the coordinates of the mouse cursor 17 | # 18 | # other options: 19 | # 20 | # Cmd-Shift-4 - to take a select area screenshot displays the coordates, then press Esc to cancel 21 | # 22 | # MouseTools -location 23 | 24 | tell application "System Events" 25 | # doesn't work due to mouse not being defined 26 | set mousePosition to position of the mouse 27 | end tell 28 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/git/git_merge_master_pull.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2017-11-21 10:43:47 +0100 (Tue, 21 Nov 2017) 6 | # 7 | # https://github.com/HariSekhon/Dockerfiles 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -euo pipefail 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # shellcheck source=lib/git.sh 21 | . "$srcdir/lib/git.sh" 22 | 23 | # For Git < 2.0 may need to set: 24 | # 25 | # git config merge.defaultToUpstream true 26 | 27 | foreachbranch 'git fetch && git merge --no-edit && git merge master --no-edit' 28 | 29 | git checkout master 30 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_datree.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2022-04-14 10:51:19 +0100 (Thu, 14 Apr 2022) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -euo pipefail 17 | [ -n "${DEBUG:-}" ] && set -x 18 | #srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | curl https://get.datree.io | /bin/bash 21 | echo 22 | 23 | if [ -n "${DATREE_TOKEN:-}" ]; then 24 | echo "\$DATATREE_TOKEN found, configuring..." 25 | datree config set token "$DATREE_TOKEN" 26 | fi 27 | 28 | echo 29 | echo -n "Datree version: " 30 | datree version 31 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/portage-packages-server.txt: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sts=4:sw=4:et 2 | # 3 | # Author: Hari Sekhon 4 | # Date: Tue May 27 20:29:57 2008 +0000 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 11 | # 12 | # https://www.linkedin.com/in/HariSekhon 13 | # 14 | 15 | # Gentoo Portage packages to install - one per line 16 | 17 | app-emacs/gentoo-syntax 18 | app-vim/gentoo-syntax 19 | at 20 | bash-completion 21 | bind-tools 22 | denyhosts 23 | e2fsprogs 24 | ethtool 25 | gentoolkit 26 | lsof 27 | mailx 28 | ntp 29 | ntp-syntax 30 | openssh 31 | pam-syntax 32 | pciutils 33 | portsentry 34 | scanlogd 35 | slocate 36 | sudo 37 | syslog-ng 38 | traceroute 39 | usbutils 40 | vim 41 | vixie-cron 42 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/python/pythonpath.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # shellcheck disable=SC2230 3 | # vim:ts=4:sts=4:sw=4:et 4 | # 5 | # Author: Hari Sekhon 6 | # Date: 2019-09-27 17:12:39 +0100 (Fri, 27 Sep 2019) 7 | # 8 | # https://github.com/HariSekhon/DevOps-Bash-tools 9 | # 10 | # License: see accompanying Hari Sekhon LICENSE file 11 | # 12 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 13 | # 14 | # https://www.linkedin.com/in/HariSekhon 15 | # 16 | 17 | # Prints the Python sys.path, one per line 18 | 19 | set -euo pipefail 20 | [ -n "${DEBUG:-}" ] && set -x 21 | 22 | # copied from old bashrc function which is now ported under .bash.d/ too, but given here for convenience in case you are not running the full bash profile 23 | python -c 'from __future__ import print_function; import sys; [print(_) for _ in sys.path if _]' 24 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/applescript/is_screensaver_running.scpt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env osascript 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2022-12-05 17:44:03 +0000 (Mon, 05 Dec 2022) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # Returns 'true' or 'false' as to whether screensaver is running 17 | # 18 | # Useful to avoid sending clicks or keystrokes during screensaver, as this makes it hard to login 19 | # 20 | # XXX: Caveat: doesn't work on locked screen when screensaver isn't running so not comprehensive 21 | 22 | tell application "System Events" 23 | get running of screen saver preferences 24 | end tell 25 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bin/jsondiff.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-04-04 17:00:20 +0100 (Sat, 04 Apr 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # Diffs 2 JSON files given as arguments 17 | 18 | set -euo pipefail 19 | [ -n "${DEBUG:-}" ] && set -x 20 | 21 | usage(){ 22 | echo "usage: ${0##*/} file1.json file2.json" 23 | exit 3 24 | } 25 | 26 | if ! [ $# -eq 2 ]; then 27 | usage 28 | fi 29 | 30 | for arg; do 31 | case "$arg" in 32 | -*) usage 33 | ;; 34 | esac 35 | done 36 | 37 | diff <(jq -S . "$1") <(jq -S . "$2") 38 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/git/git_summary_line.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-03-31 19:29:38 +0100 (Tue, 31 Mar 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # Prints concise git log for $PWD repo - used by all repos headers to signify their release in CI logs 17 | 18 | set -eu #o pipefail 19 | [ -n "${DEBUG:-}" ] && set -x 20 | 21 | # setting TERM and --no-pager are attempted workarounds to breakage in CircleCI, hangs with 'WARNING: terminal is not fully functional' (press RETURN) 22 | export TERM=xterm 23 | git --no-pager log -n 1 --pretty=format:'>>> %H %ai (%an) %s%n' 24 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.bash.d/k3d.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2023-04-03 20:30:17 +0100 (Mon, 03 Apr 2023) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # ============================================================================ # 17 | # K 3 d 18 | # ============================================================================ # 19 | 20 | #bash_tools="${bash_tools:-$(dirname "${BASH_SOURCE[0]}")/..}" 21 | 22 | # shellcheck disable=SC1090,SC1091 23 | #type add_PATH &>/dev/null || . "$bash_tools/.bash.d/paths.sh" 24 | 25 | autocomplete k3d 26 | -------------------------------------------------------------------------------- /.github/SCRIPTS/commit-all.doc.sh: -------------------------------------------------------------------------------- 1 | for file in *; do 2 | [ -d "$file" ] || continue 3 | 4 | if [ "$file" == "config" ] || [ "$file" == "examples" ] || [ "$file" == "models" ] || [ "$file" == "algorithms" ] || [ "$file" == "code" ]; then 5 | continue 6 | fi 7 | 8 | echo "cd $file" 9 | cd ./$file 10 | 11 | docsify-x-auto-sidebar -s -d . 12 | docsify-sync-to-hugo -d . -t /Users/zhangzixiong/Desktop/Workspace/Github/ngte/wx-chevalier.github.com/content/books 13 | 14 | # git lfs uninstall 15 | # git lfs track *.pdf 16 | # git lfs track *.zip 17 | 18 | git add --all 19 | git commit -m "feat: update articles" 20 | git pull 21 | git push --set-upstream origin master 22 | 23 | git checkout gh-pages 24 | git merge master 25 | git push --set-upstream origin gh-pages 26 | 27 | git checkout master 28 | # 将 gh-pages 合并进来,避免提交过程中的修改 29 | git merge gh-pages 30 | cd .. 31 | done 32 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/portage-packages-dockapps.txt: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sts=4:sw=4:et 2 | # 3 | # Author: Hari Sekhon 4 | # Date: Fri Oct 20 16:44:03 2006 +0000 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 11 | # 12 | # https://www.linkedin.com/in/HariSekhon 13 | # 14 | 15 | # Gentoo Portage packages to install - one per line 16 | 17 | asmon 18 | mountapp 19 | wmbio 20 | wmblob 21 | wmbutton 22 | wmclockmon 23 | wmcpuload 24 | wmcube 25 | wmdots 26 | wmdiskmon 27 | wmdrawer 28 | wmfire 29 | wmfsm 30 | wmhdplop 31 | wmifinfo 32 | wminet 33 | wmix 34 | wmlongrun 35 | wmMatrix 36 | wmmemmon 37 | wmmisc 38 | wmmon 39 | wmnd 40 | wmnetload 41 | wmnetmon 42 | wmpiki 43 | wmpower 44 | wmtop 45 | wmwave 46 | xscreensaver-app 47 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/wercker/wercker_app_id.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-03-02 17:53:39 +0000 (Mon, 02 Mar 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # fetch Wercker repo details - needed for getting Wercker CI build IDs (eg. for shields.io) 17 | 18 | set -euo pipefail 19 | [ -n "${DEBUG:-}" ] && set -x 20 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 21 | 22 | usage(){ 23 | echo "${0##*/} /" 24 | exit 3 25 | } 26 | 27 | if [ $# -ne 1 ]; then 28 | usage 29 | fi 30 | 31 | "$srcdir/wercker_api_app.sh" "$@" | 32 | jq -r '.id' 33 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.bash.d/trivy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2023-05-12 06:50:49 +0100 (Fri, 12 May 2023) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # ============================================================================ # 17 | # T r i v y 18 | # ============================================================================ # 19 | 20 | #bash_tools="${bash_tools:-$(dirname "${BASH_SOURCE[0]}")/..}" 21 | 22 | # shellcheck disable=SC1090,SC1091 23 | #type add_PATH &>/dev/null || . "$bash_tools/.bash.d/paths.sh" 24 | 25 | #autocomplete trivy 26 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.bash.d/bash_it.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-02-26 15:21:46 +0000 (Wed, 26 Feb 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # ============================================================================ # 17 | # B a s h I T 18 | # ============================================================================ # 19 | 20 | return 21 | 22 | if ! [ -d ~/.bash_it ]; then 23 | git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it 24 | fi 25 | 26 | export BASH_IT=~/.bash_it 27 | 28 | export BASH_IT_THEME='bobby' 29 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.bash.d/skaffold.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2021-07-05 16:31:14 +0100 (Mon, 05 Jul 2021) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # ============================================================================ # 17 | # S k a f f o l d 18 | # ============================================================================ # 19 | 20 | #bash_tools="${bash_tools:-$(dirname "${BASH_SOURCE[0]}")/..}" 21 | 22 | # shellcheck disable=SC1090,SC1091 23 | #type add_PATH &>/dev/null || . "$bash_tools/.bash.d/paths.sh" 24 | 25 | #autocomplete skaffold 26 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.cirrus.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2020-02-24 16:55:36 +0000 (Mon, 24 Feb 2020) 4 | # 5 | # vim:ts=2:sts=2:sw=2:et 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # ============================================================================ # 17 | # C i r r u s C I 18 | # ============================================================================ # 19 | 20 | # https://cirrus-ci.org/guide/writing-tasks/ 21 | 22 | container: 23 | image: ubuntu:18.04 24 | 25 | task: 26 | env: 27 | TMPDIR: /var/tmp 28 | script: 29 | - setup/ci_bootstrap.sh 30 | - make init 31 | - make ci test 32 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # vim:ts=2:sts=2:sw=2:et 2 | # 3 | # Author: Hari Sekhon 4 | # Date: Sun Feb 23 19:02:10 2020 +0000 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback 11 | # to help improve or steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # ============================================================================ # 17 | # G i t L a b C I 18 | # ============================================================================ # 19 | 20 | # https://docs.gitlab.com/ee/ci/yaml/README.html 21 | 22 | #include: '.gitlab/*.y*ml' 23 | 24 | image: ubuntu:18.04 25 | 26 | job: 27 | before_script: 28 | - setup/ci_bootstrap.sh 29 | script: 30 | - make init && make ci test 31 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/configs/.perlcriticrc: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sts=4:sw=4:et 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2019-10-29 22:33:20 +0000 (Tue, 29 Oct 2019) 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 11 | # 12 | # https://www.linkedin.com/in/HariSekhon 13 | # 14 | 15 | severity = 5 16 | # gives full explanations 17 | #verbose = 11 18 | 19 | #verbose = %f: [%p] %m at line %l, column %c.\n%d\n 20 | # 21 | # this output is ok, but I prefer the default 22 | #verbose = %f: [%p] %m at line %l, column %c.\n 23 | 24 | theme = core 25 | 26 | [TestingAndDebugging::RequireUseWarnings] 27 | severity = 5 28 | 29 | # doesn't find this file with $HOME or ~ 30 | #[Modules::ProhibitEvilModules] 31 | #modules_file = ~/.perlcritic_forbidden_modules 32 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.bash.d/grype.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2022-01-10 17:58:03 +0000 (Mon, 10 Jan 2022) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # ============================================================================ # 17 | # G r y p e 18 | # ============================================================================ # 19 | 20 | #set -euo pipefail 21 | [ -n "${DEBUG:-}" ] && set -x 22 | 23 | #eval "$(grype completion bash)" 24 | 25 | # generates auto-completion file to avoid repeating running auto-completion command, and sources from there 26 | #autocomplete grype 27 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/checks/check_docker_clean.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2017-10-06 00:58:45 +0200 (Fri, 06 Oct 2017) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -euo pipefail 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # shellcheck source=lib/docker.sh 21 | . "$srcdir/lib/docker.sh" 22 | 23 | if is_inside_docker; then 24 | "$srcdir/check_caches_clean.sh" 25 | if [ -n "$(find / -type f -name pytools_checks)" ]; then 26 | echo "pytools_checks detected, should have been removed from docker build" 27 | exit 1 28 | fi 29 | fi 30 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/kafka/kafka_topics.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-07-30 15:16:58 +0100 (Tue, 30 Jul 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -u 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | # sources heap, kerberos, brokers, zookeepers etc 21 | # shellcheck source=.bash.d/kafka.sh 22 | . "$srcdir/.bash.d/kafka.sh" 23 | 24 | # old version of kafka used --zookeeper, deprecated now 25 | #kafka-topics.sh $kafka_zookeeper "$@" 26 | 27 | # it's assigned in .bash.d/kafka.sh 28 | # shellcheck disable=SC2154,SC2086 29 | exec kafka-topics.sh $bootstrap_server "$@" 30 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.github/workflows/actions-allowed.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2022-01-26 19:04:03 +0000 (Wed, 26 Jan 2022) 4 | # 5 | # vim:ts=4:sts=4:sw=4:et 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # ============================================================================ # 17 | # 3rd Party GitHub Actions Allow List 18 | # ============================================================================ # 19 | 20 | # technically should fix to a SHA, but I trust these authors, if I didn't, I wouldn't run their actions at all 21 | 22 | checkmarx/kics-action@* 23 | fairwindsops/pluto/github-action@* 24 | megalinter/megalinter@v5 25 | returntocorp/semgrep-action@v1 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To Reproduce** 13 | Steps to reproduce the behavior: 14 | 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | 28 | - OS: [e.g. iOS] 29 | - Browser [e.g. chrome, safari] 30 | - Version [e.g. 22] 31 | 32 | **Smartphone (please complete the following information):** 33 | 34 | - Device: [e.g. iPhone6] 35 | - OS: [e.g. iOS8.1] 36 | - Browser [e.g. stock browser, safari] 37 | - Version [e.g. 22] 38 | 39 | **Additional context** 40 | Add any other context about the problem here. 41 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_sdkman_all_sdks.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2019-10-08 16:48:17 +0100 (Tue, 08 Oct 2019) 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying LICENSE file 9 | # 10 | # https://www.linkedin.com/in/HariSekhon 11 | # 12 | 13 | # Installs SDKman's most commonly used build tools e.g Java, Scala, Groovy + Maven, SBT, Gradle 14 | # 15 | # you may need to run ./install_sdkman.sh first 16 | 17 | set -eo pipefail 18 | [ -n "${DEBUG:-}" ] && set -x 19 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 20 | 21 | sdks=" 22 | java 23 | scala 24 | groovy 25 | maven 26 | gradle 27 | sbt 28 | " 29 | 30 | if ! type sdk &>/dev/null; then 31 | "$srcdir/install_sdkman.sh" 32 | fi 33 | 34 | if [ -s ~/.sdkman/bin/sdkman-init.sh ]; then 35 | # shellcheck disable=SC1090,SC1091 36 | . ~/.sdkman/bin/sdkman-init.sh 37 | fi 38 | 39 | for x in $sdks; do 40 | set +o pipefail 41 | yes | sdk install "$x" 42 | done 43 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/lib/dockerfile_keywords.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: Mon Nov 2 17:26:28 2015 +0000 4 | # 5 | # vim:ts=2:sts=2:sw=2:et:filetype=conf 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn 12 | # and optionally send me feedback to help improve or steer this or other code I publish 13 | # 14 | # https://www.linkedin.com/in/HariSekhon 15 | # 16 | 17 | # ============================================================================ # 18 | # D o c k e r f i l e K e y w o r d s 19 | # ============================================================================ # 20 | 21 | # Copied from https://github.com/HariSekhon/SQL-keywords 22 | 23 | FROM 24 | MAINTAINER 25 | RUN 26 | CMD 27 | LABEL 28 | EXPOSE 29 | ENV 30 | ARG 31 | ADD 32 | COPY 33 | ENTRYPOINT 34 | VOLUME 35 | USER 36 | WORKDIR 37 | ONBUILD 38 | STOPSIGNAL 39 | HEALTHCHECK 40 | SHELL 41 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bigdata/cloudera_manager_yarn_apps_failed.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-01-23 16:13:06 +0000 (Thu, 23 Jan 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # Script to fetch failed Yarn Apps / jobs via Cloudera Manager API 17 | # 18 | # Dumps the raw JSON for further processing, see cloudera_manager_yarn_apps.sh for the format 19 | 20 | # Tested on Cloudera Enterprise 5.10 21 | 22 | set -euo pipefail 23 | [ -n "${DEBUG:-}" ] && set -x 24 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 25 | 26 | "$srcdir/cloudera_manager_yarn_apps.sh" | 27 | jq -r '.applications[] | select(.state | test("RUNNING|SUCCEEDED|FINISHED|ACCEPTED") | not)' 28 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_rvm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2019-10-04 16:36:18 +0100 (Fri, 04 Oct 2019) 5 | # (circa 2016 originally) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying LICENSE file 10 | # 11 | # https://www.linkedin.com/in/HariSekhon 12 | # 13 | 14 | # Installs Ruby RVM 15 | 16 | set -eu 17 | [ -n "${DEBUG:-}" ] && set -x 18 | 19 | if type apk >/dev/null 2>&1; then 20 | apk --no-cache add bash curl procps 21 | elif type apt-get >/dev/null 2>&1; then 22 | apt-get update 23 | apt-get install -y curl procps 24 | elif type yum >/dev/null 2>&1; then 25 | echo "rhel based systems aleady have curl" 26 | fi 27 | 28 | exec bash </dev/null; then 20 | echo "Vim not installed, aborting..." 21 | exit 1 22 | fi 23 | 24 | target=~/.vim/bundle/Vundle.vim 25 | 26 | mkdir -pv "${target%/*}" 27 | 28 | if ! [ -e "$target" ]; then 29 | git clone https://github.com/gmarik/Vundle.vim.git "$target" 30 | fi 31 | 32 | date "+%F %T Installing Vim Vundle plugins..." 33 | # this tends to mess up the terminal and requires a reset afterwards 34 | vim --not-a-term +PluginInstall +qall >/dev/null 35 | date "+%F %T Finished installing Vim Vundle plugins" 36 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/deb-packages-optional.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2020-04-10 13:35:58 +0100 (Fri, 10 Apr 2020) 4 | # 5 | # https://github.com/HariSekhon/DevOps-Bash-tools 6 | # 7 | # License: see accompanying LICENSE file 8 | # 9 | # https://www.linkedin.com/in/HariSekhon 10 | # 11 | 12 | # ============================================================================ # 13 | # Deb Packages Optional 14 | # ============================================================================ # 15 | 16 | direnv 17 | shellcheck 18 | yq 19 | 20 | # prevents this error: 21 | # bash-tools/lib/utils.sh: line 41: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory 22 | locales-all 23 | 24 | # on Ubuntu but not Debian 25 | golang-race-detector-runtime 26 | 27 | # Ubuntu 20.04 has Python3, python installs Python2 but python-pip package is no longer available 28 | python 29 | python3 30 | python-pip 31 | python3-pip 32 | python-setuptools # needed by 'pip install awscli' 33 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bigdata/zookeeper_shell.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-07-30 15:16:58 +0100 (Tue, 30 Jul 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # Kafka's zookeeper-shell wrapper to auto-populate common options like the zookeeper addresses and znode parent 17 | 18 | set -u 19 | [ -n "${DEBUG:-}" ] && set -x 20 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 21 | 22 | # sources heap, kerberos, brokers, zookeepers etc 23 | # shellcheck source=.bash.d/kafka.sh 24 | . "$srcdir/.bash.d/kafka.sh" 25 | 26 | # it's assigned in .bash.d/kafka.sh 27 | # shellcheck disable=SC2154 28 | exec zookeeper-shell.sh "${KAFKA_ZOOKEEPERS:-}${KAFKA_ZOOKEEPER_ROOT:-}" "$@" 29 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/python_install_snakebite.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-03-06 10:37:29 +0000 (Fri, 06 Mar 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # Tries to installs Python snakebite module for Python 3 or Python 2 downgrading each time to try another version 17 | 18 | set -euo pipefail 19 | [ -n "${DEBUG:-}" ] && set -x 20 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 21 | 22 | "$srcdir/../python/python_pip_install.sh" "snakebite-py3[kerberos]" || 23 | "$srcdir/../python/python_pip_install.sh" "snakebite-py3" || 24 | "$srcdir/../python/python_pip_install.sh" "snakebite[kerberos]" || 25 | "$srcdir/../python/python_pip_install.sh" "snakebite" 26 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bin/center.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2016-01-23 00:02:17 +0000 (Sat, 23 Jan 2016) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # borrowed from here: 17 | # 18 | # http://codereview.stackexchange.com/questions/94449/text-centering-function-in-bash 19 | 20 | # This is only for local use, there is a much better Python version in my DevOps Python Tools repo: 21 | # 22 | # https://github.com/HariSekhon/DevOps-Python-tools 23 | 24 | set -euo pipefail 25 | 26 | textsize="${#1}" 27 | # I want this to only match my hr() function, not 27" iMac 5K screens 28 | #width=$(tput cols) 29 | width="${2:-${WIDTH:-80}}" 30 | span="$(((width + textsize) / 2))" 31 | printf "%${span}s\\n" "${1:-NO_MESSAGE_GIVEN_TO_CENTER}" 32 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/apk-packages.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2019-03-16 20:35:14 +0000 (Sat, 16 Mar 2019) 4 | # 5 | # https://github.com/HariSekhon/DevOps-Bash-tools 6 | # 7 | # License: see accompanying LICENSE file 8 | # 9 | # https://www.linkedin.com/in/HariSekhon 10 | # 11 | 12 | # ============================================================================ # 13 | # Alpine Package Requirements 14 | # ============================================================================ # 15 | 16 | bash 17 | bc 18 | coreutils 19 | curl 20 | findutils 21 | gcc 22 | git 23 | go 24 | grep 25 | jq 26 | libxml2-utils # needed for xmllint 27 | make 28 | openssh-client 29 | parallel 30 | perl 31 | perl-app-cpanminus 32 | ruby-dev # to build Travis CI gem 33 | wget 34 | which 35 | zip 36 | unzip 37 | 38 | # causes errors now so moved to apk-packages-optional.txt to allow failures 39 | # 40 | # python (missing): 41 | # ERROR: unsatisfiable constraints: 42 | # required by: world[python] 43 | #python 44 | #py-pip 45 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/yamllint/config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=2:sts=2:sw=2:et:filetype=yaml 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-10-10 10:32:04 +0100 (Thu, 10 Oct 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | extends: default 17 | 18 | rules: 19 | # don't warn on no --- at start since many yamls don't have this 20 | document-start: disable 21 | 22 | # often want to differentiate no space commented out '#code' from '# intentional human comments' 23 | comments: disable 24 | 25 | # > 80 char length? Really? I love the 80s but this one should have been left there... 26 | line-length: disable 27 | 28 | # too many spaces after colons - meh - sometimes it's nice to align adjacent lines values 29 | colons: disable 30 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2016 Hari Sekhon 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/git/git_repos.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # shellcheck disable=SC2230 3 | # vim:ts=4:sts=4:sw=4:et 4 | # 5 | # Author: Hari Sekhon 6 | # Date: 2020-04-04 18:54:17 +0100 (Sat, 04 Apr 2020) 7 | # 8 | # https://github.com/HariSekhon/DevOps-Bash-tools 9 | # 10 | # License: see accompanying Hari Sekhon LICENSE file 11 | # 12 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish 13 | # 14 | # https://www.linkedin.com/in/HariSekhon 15 | # 16 | 17 | set -euo pipefail 18 | [ -n "${DEBUG:-}" ] && set -x 19 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 20 | 21 | repofile="$srcdir/../setup/repos.txt" 22 | 23 | if [ -f "$repofile" ]; then 24 | echo "processing repos from local file: $repofile" >&2 25 | cat "$repofile" 26 | else 27 | echo "fetching repos from GitHub repos.txt:" >&2 28 | curl -sSL https://raw.githubusercontent.com/HariSekhon/bash-tools/master/setup/repos.txt 29 | fi | 30 | sed 's/#.*//; s/.*://; /^[[:space:]]*$/d' 31 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/Gemfile: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2022-05-13 15:25:18 +0100 (Fri, 13 May 2022) 4 | # 5 | # vim:ts=4:sts=4:sw=4:et 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # ============================================================================ # 17 | # G e m f i l e 18 | # ============================================================================ # 19 | 20 | # https://bundler.io/gemfile.html 21 | 22 | # This isn't automatically installed since ruby code is not much used in this repo 23 | 24 | # see also: 25 | # 26 | # setup/gem-packages.txt 27 | # setup/gem-packages-desktop.txt # optional for desktop use 28 | 29 | source 'https://rubygems.org' 30 | 31 | gem 'cfn-nag' 32 | gem 'json' 33 | gem 'gitlab' 34 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/hadolint.yaml: -------------------------------------------------------------------------------- 1 | # vim:ts=4:sts=4:sw=4:et 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2019-10-01 16:14:15 +0100 (Tue, 01 Oct 2019) 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying Hari Sekhon LICENSE file 9 | # 10 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish 11 | # 12 | # https://www.linkedin.com/in/HariSekhon 13 | # 14 | 15 | # sourced by check_dockerfiles.sh if no \$PWD/.hadolint.yaml is found 16 | 17 | ignored: 18 | # Maintainer is deprecated 19 | - DL4000 20 | # FROM latest - dev images build on upstream latest tag intentionally 21 | - DL3007 22 | # apt-get install versions need not be pinned 23 | - DL3008 24 | # apk add versions need not be pinned 25 | - DL3018 26 | #- SC1010 27 | # - for dev images it's ok to use both curl and wget as they are dependencies of different scripts 28 | - DL4001 29 | 30 | trustedRegistries: 31 | - docker.io 32 | #- my-company.com:5000 33 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/ccmenu_cp_plist.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2019-11-02 20:53:06 +0000 (Sat, 02 Nov 2019) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -euo pipefail 17 | [ -n "${DEBUG:-}" ] && set -x 18 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19 | 20 | plist_dir="Library/Containers/net.sourceforge.cruisecontrol.CCMenu/Data/Library/Preferences" 21 | 22 | plist_file="net.sourceforge.cruisecontrol.CCMenu.plist" 23 | 24 | cd "$srcdir/.." 25 | 26 | cp -vf -- ~/"$plist_dir/$plist_file" "$PWD/$plist_dir/$plist_file" 27 | plutil -convert xml1 "$PWD/$plist_dir/$plist_file" 28 | echo 29 | 30 | echo "git diff $PWD/$plist_dir/$plist_file" 31 | git diff "$PWD/$plist_dir/$plist_file" 32 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/aws/aws_budget_sns_access_policy.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2008-10-17", 3 | "Id": "__default_policy_ID", 4 | "Statement": [ 5 | { 6 | "Sid": "AWSBudgets-notification", 7 | "Effect": "Allow", 8 | "Principal": { 9 | "Service": "budgets.amazonaws.com" 10 | }, 11 | "Action": "SNS:Publish", 12 | "Resource": "" 13 | }, 14 | { 15 | "Sid": "__default_statement_ID", 16 | "Effect": "Allow", 17 | "Principal": { 18 | "AWS": "*" 19 | }, 20 | "Action": [ 21 | "SNS:GetTopicAttributes", 22 | "SNS:SetTopicAttributes", 23 | "SNS:AddPermission", 24 | "SNS:RemovePermission", 25 | "SNS:DeleteTopic", 26 | "SNS:Subscribe", 27 | "SNS:ListSubscriptionsByTopic", 28 | "SNS:Publish", 29 | "SNS:Receive" 30 | ], 31 | "Resource": "", 32 | "Condition": { 33 | "StringEquals": { 34 | "AWS:SourceOwner": "" 35 | } 36 | } 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_talosctl.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2023-03-06 13:21:08 +0000 (Mon, 06 Mar 2023) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # https://www.talos.dev/v1.3/introduction/quickstart/ 17 | 18 | set -euo pipefail 19 | [ -n "${DEBUG:-}" ] && set -x 20 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 21 | 22 | # shellcheck disable=SC1090,SC1091 23 | . "$srcdir/../lib/utils.sh" 24 | 25 | # shellcheck disable=SC2034,SC2154 26 | usage_description=" 27 | Installs Talos 'talosctl' client binary 28 | " 29 | 30 | # used by usage() in lib/utils.sh 31 | # shellcheck disable=SC2034 32 | usage_args="" 33 | 34 | help_usage "$@" 35 | 36 | curl -sSL https://talos.dev/install | sh 37 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/prometheus.yml: -------------------------------------------------------------------------------- 1 | # my global config 2 | global: 3 | scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. 4 | evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. 5 | # scrape_timeout is set to the global default (10s). 6 | 7 | # Alertmanager configuration 8 | alerting: 9 | alertmanagers: 10 | - static_configs: 11 | - targets: 12 | # - alertmanager:9093 13 | 14 | # Load rules once and periodically evaluate them according to the global 'evaluation_interval'. 15 | rule_files: 16 | # - "first_rules.yml" 17 | # - "second_rules.yml" 18 | 19 | # A scrape configuration containing exactly one endpoint to scrape: 20 | # Here it's Prometheus itself. 21 | scrape_configs: 22 | # The job name is added as a label `job=` to any timeseries scraped from this config. 23 | - job_name: "prometheus" 24 | 25 | # metrics_path defaults to '/metrics' 26 | # scheme defaults to 'http'. 27 | 28 | static_configs: 29 | - targets: ["localhost:9090"] 30 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/deb-packages.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2019-03-16 20:35:14 +0000 (Sat, 16 Mar 2019) 4 | # 5 | # https://github.com/HariSekhon/DevOps-Bash-tools 6 | # 7 | # License: see accompanying LICENSE file 8 | # 9 | # https://www.linkedin.com/in/HariSekhon 10 | # 11 | 12 | # ============================================================================ # 13 | # Deb Package Requirements 14 | # ============================================================================ # 15 | 16 | bash 17 | bc 18 | build-essential 19 | ca-certificates 20 | cpanminus 21 | curl 22 | #direnv 23 | git 24 | #gnupg 25 | golang 26 | groovy # needed by check_groovyc.sh in Jenkins shared library CI/CD workflow in GitHub Actions 27 | iputils-ping 28 | jq 29 | less 30 | libperl-dev # needed for PAR:Packer 31 | libxml2-utils # needed for xmllint 32 | make 33 | openssh-client 34 | parallel 35 | perl 36 | procps 37 | psmisc # for fuser for apt_wait.sh 38 | ruby-dev # to build Travis CI gem 39 | time 40 | wget 41 | # included in distro 42 | #which 43 | zip 44 | unzip 45 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/install/install_docker_compose.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Author: Hari Sekhon 4 | # Date: 2020-03-19 19:31:41 +0000 (Thu, 19 Mar 2020) 5 | # 6 | # https://github.com/HariSekhon/DevOps-Bash-tools 7 | # 8 | # License: see accompanying LICENSE file 9 | # 10 | # https://www.linkedin.com/in/HariSekhon 11 | # 12 | 13 | set -euo pipefail 14 | [ -n "${DEBUG:-}" ] && set -x 15 | srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 16 | 17 | # shellcheck disable=SC1090,SC1091 18 | . "$srcdir/../lib/utils.sh" 19 | 20 | # shellcheck disable=SC2034,SC2154 21 | usage_description=" 22 | Installs Docker Compose 23 | " 24 | 25 | # used by usage() in lib/utils.sh 26 | # shellcheck disable=SC2034 27 | usage_args="[]" 28 | 29 | export PATH="$PATH:$HOME/bin" 30 | 31 | help_usage "$@" 32 | 33 | #version="${1:-2.4.0}" 34 | version="${1:-latest}" 35 | 36 | arch="$(get_arch)" 37 | if [ "$arch" = amd64 ]; then 38 | arch=x86_64 39 | fi 40 | 41 | export RUN_VERSION_ARG=1 42 | 43 | "$srcdir/../github/github_install_binary.sh" docker/compose "docker-compose-{os}-$arch" "$version" 44 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/lib/utils-bourne.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2015-05-25 01:38:24 +0100 (Mon, 25 May 2015) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | set -eu 17 | [ -n "${DEBUG:-}" ] && set -x 18 | #srcdir_bash_tools_utils_bourne="$(cd "$(dirname "$0")" && pwd)" 19 | 20 | if [ "${bash_tools_utils_bourne_imported:-0}" = 1 ]; then 21 | return 0 22 | fi 23 | bash_tools_utils_bourne_imported=1 24 | 25 | am_root(){ 26 | # shellcheck disable=SC2039,SC3028 27 | [ "${EUID:-${UID:-$(id -u)}}" -eq 0 ] 28 | } 29 | 30 | if am_root; then 31 | sudo="" 32 | else 33 | sudo=sudo 34 | fi 35 | export sudo 36 | 37 | export support_msg="Please raise a GitHub Issue at https://github.com/HariSekhon/DevOps-Bash-tools/issues" 38 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/.mdl.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # vim:ts=4:sts=4:sw=4:et:filetype=ruby 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2024-08-22 01:58:12 +0200 (Thu, 22 Aug 2024) 6 | # 7 | # https///github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | all 17 | #exclude_rule 'MD001' 18 | #exclude_rule 'MD003' 19 | #exclude_rule 'MD005' 20 | exclude_rule 'MD007' # leave 2 space indentation for lists, 3 space is ugly af 21 | #exclude_rule 'MD012' 22 | exclude_rule 'MD013' # long lines cannot be split if they are URLs 23 | #exclude_rule 'MD022' 24 | #exclude_rule 'MD025' 25 | #exclude_rule 'MD031' 26 | #exclude_rule 'MD032' 27 | exclude_rule 'MD033' # inline HTML is important for formatting 28 | exclude_rule 'MD036' # emphasis used instead of header for footer Ported from lines 29 | #exclude_rule 'MD039' 30 | #exclude_rule 'MD056' 31 | -------------------------------------------------------------------------------- /.github/META/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true, 3 | "python.formatting.provider": "autopep8", 4 | "files.exclude": { 5 | "**/.classpath": true, 6 | "**/.project": true, 7 | "**/.settings": true, 8 | "**/.factorypath": true, 9 | "**/*.ts": true, 10 | "**/*.go": true, 11 | "**/*.java": true 12 | }, 13 | "files.watcherExclude": { 14 | "**/algorithms/**": true, 15 | "**/examples/**": true, 16 | "**/models/**": true, 17 | "**/code/**": true, 18 | "**/boilerplates/**": true, 19 | "**/*.ipynb": true 20 | }, 21 | "search.exclude": { 22 | "**/node_modules": true, 23 | "**/bower_components": true, 24 | "build/": true, 25 | "temp/": true, 26 | "library/": true, 27 | "**/.git": true, 28 | "**/*.o": true, 29 | "**/*.cmd": true, 30 | "**/*.tmp*": true, 31 | "**/*.git*": true, 32 | "**/*.symvers": true, 33 | "**/*.order": true, 34 | "**/algorithms/**": true, 35 | "**/examples/**": true, 36 | "**/models/**": true, 37 | "**/code/**": true, 38 | "**/boilerplates/**": true 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/setup/rpm-packages.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Hari Sekhon 3 | # Date: 2019-03-16 20:35:14 +0000 (Sat, 16 Mar 2019) 4 | # 5 | # https://github.com/HariSekhon/DevOps-Bash-tools 6 | # 7 | # License: see accompanying LICENSE file 8 | # 9 | # https://www.linkedin.com/in/HariSekhon 10 | # 11 | 12 | # ============================================================================ # 13 | # RPM Package Requirements 14 | # ============================================================================ # 15 | 16 | bash 17 | bc 18 | #binutils # contains old C tools like 'strings' 19 | bind-utils # host / nslookup / dig commands 20 | curl 21 | #direnv 22 | gcc 23 | git 24 | golang 25 | findutils # find and xargs 26 | iputils 27 | jq 28 | libxml2 # needed for xmllint - usually already installed 29 | make 30 | openssh-clients 31 | parallel 32 | perl 33 | #perl-App-cpanminus # not available on RHEL6, moved to rpm-packages-optional.txt 34 | #ShellCheck # not available in RHEL8, moved to rpm-packages-optional.txt 35 | ruby-devel # to build Travis CI gem 36 | wget 37 | which 38 | zip 39 | unzip 40 | -------------------------------------------------------------------------------- /脚本工具集/DevOps-Bash-tools/bigdata/cloudera_manager_impala_queries_metadata_refresh.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim:ts=4:sts=4:sw=4:et 3 | # 4 | # Author: Hari Sekhon 5 | # Date: 2020-01-23 11:51:09 +0000 (Thu, 23 Jan 2020) 6 | # 7 | # https://github.com/HariSekhon/DevOps-Bash-tools 8 | # 9 | # License: see accompanying Hari Sekhon LICENSE file 10 | # 11 | # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish 12 | # 13 | # https://www.linkedin.com/in/HariSekhon 14 | # 15 | 16 | # Script to show recent Impala metadata refresh calls via Cloudera Manager API 17 | # 18 | # TSV output format: 19 | # 20 | #