Allgemein

gitlab-rake: How to list tasks

gitlab-rake --tasks

or, on Docker/docker-compose:

docker-compose exec gitlab gitlab-rake --tasks

Example output

(for Gitlab 14)

rake about                                                                                          # List versions of all Rails frameworks and the environment
rake acts_as_taggable_on:sharded_db:install_initializer                                             # Install initializer setting custom base class
rake acts_as_taggable_on_engine:install:migrations                                                  # Copy migrations from acts_as_taggable_on_engine to application
rake acts_as_taggable_on_engine:tag_names:collate_bin                                               # Forcing collate of tag names to utf8_bin
rake acts_as_taggable_on_engine:tag_names:collate_ci                                                # Forcing collate of tag names to utf8_general_ci
rake app:template                                                                                   # Applies the template supplied by LOCATION=(/path/to/template) or URL
rake app:update                                                                                     # Update configs and some other initially generated files (or use just update:configs or update:bin)
rake assets:clean[keep]                                                                             # Remove old compiled assets
rake assets:clobber                                                                                 # Remove compiled assets
rake assets:environment                                                                             # Load asset compile environment
rake assets:precompile                                                                              # Compile all the assets named in config.assets.precompile
rake cache:clear:redis                                                                              # GitLab | Cache | Clear redis cache
rake cache_digests:dependencies                                                                     # Lookup first-level dependencies for TEMPLATE (like messages/show or comments/_comment.html)
rake cache_digests:nested_dependencies                                                              # Lookup nested dependencies for TEMPLATE (like messages/show or comments/_comment.html)
rake ci:cleanup:builds                                                                              # GitLab | CI | Clean running builds
rake config_lint                                                                                    # Checks syntax for shell scripts and nginx config files in 'lib/support/'
rake css:build                                                                                      # Build your CSS bundle
rake css:clobber                                                                                    # Remove CSS builds
rake css:install                                                                                    # Install JavaScript dependencies
rake css:install:bootstrap                                                                          # Install Bootstrap
rake css:install:bulma                                                                              # Install Bulma
rake css:install:postcss                                                                            # Install PostCSS
rake css:install:sass                                                                               # Install Sass
rake css:install:tailwind                                                                           # Install Tailwind
rake danger_local                                                                                   # Run local Danger rules
rake db:create                                                                                      # Creates the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db:create:...
rake db:drop                                                                                        # Drops the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db:drop:all ...
rake db:encryption:init                                                                             # Generate a set of keys for configuring Active Record encryption in a given environment
rake db:environment:set                                                                             # Set the environment value for the database
rake db:fixtures:load                                                                               # Loads fixtures into the current environment's database
rake db:migrate                                                                                     # Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
rake db:migrate:down                                                                                # Runs the "down" for a given migration VERSION
rake db:migrate:redo                                                                                # Rolls back the database one migration and re-migrates up (options: STEP=x, VERSION=x)
rake db:migrate:status                                                                              # Display status of migrations
rake db:migrate:up                                                                                  # Runs the "up" for a given migration VERSION
rake db:obsolete_ignored_columns                                                                    # Show a list of obsolete `ignored_columns`
rake db:prepare                                                                                     # Runs setup if database does not exist, or runs migrations if it does
rake db:reset                                                                                       # Drops and recreates all databases from their schema for the current environment and loads the seeds
rake db:rollback                                                                                    # Rolls the schema back to the previous version (specify steps w/ STEP=n)
rake db:schema:cache:clear                                                                          # Clears a db/schema_cache.yml file
rake db:schema:cache:dump                                                                           # Creates a db/schema_cache.yml file
rake db:schema:dump                                                                                 # Creates a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['SCHEMA_FORM...
rake db:schema:load                                                                                 # Loads a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['SCHEMA_FORMAT...
rake db:seed                                                                                        # Loads the seed data from db/seeds.rb
rake db:seed:replant                                                                                # Truncates tables of each database for current environment and loads the seeds
rake db:seed_fu                                                                                     # Loads seed data for the current environment
rake db:setup                                                                                       # Creates all databases, loads all schemas, and initializes with the seed data (use db:reset to also drop...
rake db:version                                                                                     # Retrieves the current schema version number
rake dev:fixtures:load[fixture_name]                                                                # GitLab | Dev | Load specific fixture
rake dev:load                                                                                       # GitLab | Dev | Eager load application
rake dev:setup                                                                                      # GitLab | Dev | Setup developer environment (db, fixtures)
rake dev:terminate_all_connections                                                                  # Used to drop all connections in development
rake file_hooks:validate                                                                            # Validate existing file hooks
rake gems:error_tracking_open_api:generate                                                          # Generate OpenAPI client for Error Tracking
rake gettext:compile                                                                                # Compile po files to json, for usage in the frontend
rake gettext:lint                                                                                   # Lint all po files in `locale/
rake gettext:regenerate                                                                             # Regenerate gitlab.pot file
rake gettext:updated_check                                                                          # Check whether gitlab.pot needs updates, used during CI
rake gitlab:app:check                                                                               # GitLab | App | Check the configuration of the GitLab Rails app
rake gitlab:artifacts:check                                                                         # GitLab | Artifacts | Check integrity of uploaded job artifacts
rake gitlab:artifacts:migrate                                                                       # GitLab | Artifacts | Migrate files for artifacts to comply with new storage format
rake gitlab:assets:check_page_bundle_mixins_css_for_sideeffects                                     # GitLab | Assets | Check that scss mixins do not introduce any sideffects
rake gitlab:assets:clean                                                                            # GitLab | Assets | Clean up old compiled frontend assets
rake gitlab:assets:compile                                                                          # GitLab | Assets | Compile all frontend assets
rake gitlab:assets:fix_urls                                                                         # GitLab | Assets | Fix all absolute url references in CSS
rake gitlab:assets:hash_sum                                                                         # GitLab | Assets | Return the hash sum of all frontend assets
rake gitlab:assets:purge                                                                            # GitLab | Assets | Remove all compiled frontend assets
rake gitlab:assets:purge_modules                                                                    # GitLab | Assets | Uninstall frontend dependencies
rake gitlab:assets:vendor                                                                           # GitLab | Assets | Compile vendor assets
rake gitlab:background_migrations:finalize[job_class_name,table_name,column_name,job_arguments]     # Synchronously finish executing a batched background migration
rake gitlab:background_migrations:status                                                            # Display the status of batched background migrations
rake gitlab:backup:create                                                                           # GitLab | Backup | Create a backup of the GitLab system
rake gitlab:backup:restore                                                                          # GitLab | Backup | Restore a previously created backup
rake gitlab:banzai:render                                                                           # GitLab | Banzai | Render markdown using our FullPipeline (input will be requested)
rake gitlab:check                                                                                   # GitLab | Check the configuration of GitLab and its environment
rake gitlab:ci_secure_files:check                                                                   # GitLab | CI Secure Files | Check integrity of uploaded Secure Files
rake gitlab:ci_secure_files:migrate                                                                 # GitLab | CI Secure Files | Migrate Secure Files to remote storage
rake gitlab:cleanup:block_removed_ldap_users                                                        # GitLab | Cleanup | Block users that have been removed in LDAP
rake gitlab:cleanup:delete_orphan_job_artifact_final_objects                                        # GitLab | Cleanup | Delete orphan job artifact objects stored in the @final directory based on the CSV file
rake gitlab:cleanup:list_orphan_job_artifact_final_objects[provider]                                # GitLab | Cleanup | Generate a CSV file of orphan job artifact objects stored in the @final directory
rake gitlab:cleanup:orphan_job_artifact_files                                                       # GitLab | Cleanup | Clean orphan job artifact files in local storage
rake gitlab:cleanup:orphan_lfs_file_references                                                      # GitLab | Cleanup | Clean orphan LFS file references
rake gitlab:cleanup:orphan_lfs_files                                                                # GitLab | Cleanup | Clean orphan LFS files
rake gitlab:cleanup:project_uploads                                                                 # GitLab | Cleanup | Clean orphaned project uploads
rake gitlab:cleanup:remote_upload_files                                                             # GitLab | Cleanup | Clean orphan remote upload files that do not exist in the db
rake gitlab:cleanup:remove_missed_source_branches                                                   # GitLab | Cleanup | Clean missed source branches to be deleted
rake gitlab:cleanup:sessions:active_sessions_lookup_keys                                            # GitLab | Cleanup | Sessions | Clean ActiveSession lookup keys
rake gitlab:clickhouse:migrate[skip_unless_configured]                                              # GitLab | ClickHouse | Migrate the databases (options: VERSION=x, VERBOSE=false, SCOPE=y)
rake gitlab:clickhouse:migrate:main[skip_unless_configured]                                         # GitLab | ClickHouse | Migrate the main database (options: VERSION=x, VERBOSE=false, SCOPE=y)
rake gitlab:clickhouse:rollback:main                                                                # GitLab | ClickHouse | Rolls the main database back to the previous version (specify steps w/ STEP=n)
rake gitlab:container_registry:configure                                                            # GitLab | Container Registry | Configure
rake gitlab:db:active                                                                               # Check if there have been user additions to the database
rake gitlab:db:cells:bump_cell_sequences[increase_by]                                               # Bump sequences for cell-local tables on the cells database
rake gitlab:db:clean_structure_sql                                                                  # This adjusts and cleans db/structure.sql - it runs after db:schema:dump
rake gitlab:db:configure                                                                            # GitLab | DB | Configures the database by running migrate, or by loading the schema and seeding if needed
rake gitlab:db:create_dynamic_partitions                                                            # Create missing dynamic database partitions
rake gitlab:db:decomposition:connection_status                                                      # Check if PostgreSQL max_connections needs to be increased
rake gitlab:db:decomposition:migrate                                                                # Migrate single database to two database setup
rake gitlab:db:decomposition:rollback:bump_ci_sequences[increase_by]                                # Bump all the CI tables sequences on the Main Database
rake gitlab:db:dictionary:generate                                                                  # Generate database docs yaml
rake gitlab:db:drop_tables                                                                          # GitLab | DB | Drop all tables on all configured databases
rake gitlab:db:enqueue_reindexing_action[index_name,database]                                       # Enqueue an index for reindexing
rake gitlab:db:execute_batched_migrations                                                           # Run all pending batched migrations
rake gitlab:db:lock_writes                                                                          # GitLab | DB | Install prevent write triggers on all databases
rake gitlab:db:mark_migration_complete[version]                                                     # GitLab | DB | Manually insert schema migration version on all configured databases
rake gitlab:db:migration_testing:down:ci                                                            # Run down migrations on ci in current branch with instrumentation
rake gitlab:db:migration_testing:down:main                                                          # Run down migrations on main in current branch with instrumentation
rake gitlab:db:migration_testing:down:main_clusterwide                                              # Run down migrations on main_clusterwide in current branch with instrumentation
rake gitlab:db:migration_testing:sample_background_migrations[duration_s]                           # Sample traditional background migrations with instrumentation
rake gitlab:db:migration_testing:sample_batched_background_migrations[database,duration_s]          # Sample batched background migrations with instrumentation (legacy)
rake gitlab:db:migration_testing:sample_batched_background_migrations:ci[duration_s]                # Sample batched background migrations on ci with instrumentation
rake gitlab:db:migration_testing:sample_batched_background_migrations:main[duration_s]              # Sample batched background migrations on main with instrumentation
rake gitlab:db:migration_testing:sample_batched_background_migrations:main_clusterwide[duration_s]  # Sample batched background migrations on main_clusterwide with instrumentation
rake gitlab:db:migration_testing:up:ci                                                              # Run migrations on ci with instrumentation
rake gitlab:db:migration_testing:up:main                                                            # Run migrations on main with instrumentation
rake gitlab:db:migration_testing:up:main_clusterwide                                                # Run migrations on main_clusterwide with instrumentation
rake gitlab:db:reindex                                                                              # Reindex database without downtime to eliminate bloat
rake gitlab:db:reset_as_non_superuser[username]                                                     # Run migration as gitlab non-superuser
rake gitlab:db:schema_checker:run                                                                   # Checks schema inconsistencies
rake gitlab:db:squash[version]                                                                      # GitLab | DB | squash | squash as of a version
rake gitlab:db:truncate_legacy_tables:ci[min_batch_size]                                            # GitLab | DB | Truncate Main Tables on CI
rake gitlab:db:truncate_legacy_tables:main[min_batch_size]                                          # GitLab | DB | Truncate CI Tables on Main
rake gitlab:db:unattended                                                                           # GitLab | DB | Run database migrations and print `unattended_migrations_completed` if action taken
rake gitlab:db:unlock_writes                                                                        # GitLab | DB | Remove all triggers that prevents writes from all databases
rake gitlab:db:validate_config                                                                      # Validates `config/database.yml` to ensure a correct behavior is configured
rake gitlab:dependency_proxy:migrate                                                                # GitLab | Dependency Proxy | Migrate dependency proxy files to remote storage
rake gitlab:docs:check_deprecations                                                                 # Check that the deprecation documentation is up to date
rake gitlab:docs:compile_deprecations                                                               # Generate deprecation list from individual files
rake gitlab:docs:redirect[old_path,new_path]                                                        # GitLab | Docs | Create a doc redirect
rake gitlab:doctor:reset_encrypted_tokens                                                           # GitLab | Reset encrypted tokens for specific models
rake gitlab:doctor:secrets                                                                          # GitLab | Check if the database encrypted values can be decrypted using current secrets
rake gitlab:env:info                                                                                # GitLab | Env | Show information about GitLab and its environment
rake gitlab:exclusive_lease:clear[scope]                                                            # GitLab | Exclusive Lease | Clear existing exclusive leases for specified scope (default: *)
rake gitlab:external_diffs:force_object_storage                                                     # Override external diffs in file storage to be in object storage instead
rake gitlab:feature_categories:index                                                                # GitLab | Feature categories | Build index page for groups
rake gitlab:git:checksum_projects                                                                   # GitLab | Git | Generate checksum of project repository refs
rake gitlab:git:fsck                                                                                # GitLab | Git | Check all repos integrity
rake gitlab:gitaly:check                                                                            # GitLab | Gitaly | Check the health of Gitaly
rake gitlab:gitaly:clone[dir,storage_path,repo]                                                     # GitLab | Gitaly | Clone and checkout gitaly
rake gitlab:gitaly:install[dir,storage_path,repo]                                                   # GitLab | Gitaly | Install or upgrade gitaly
rake gitlab:gitlab_shell:check                                                                      # GitLab | GitLab Shell | Check the configuration of GitLab Shell
rake gitlab:import:all_users_to_all_groups                                                          # GitLab | Import | Add all users to all groups (admin users are added as owners)
rake gitlab:import:all_users_to_all_projects                                                        # GitLab | Import | Add all users to all projects (admin users are added as maintainers)
rake gitlab:import:user_to_groups[email]                                                            # GitLab | Import | Add a specific user to all groups (as a developer)
rake gitlab:import:user_to_projects[email]                                                          # GitLab | Import | Add a specific user to all projects (as a developer)
rake gitlab:import_export:bump_version                                                              # GitLab | Import/Export | Bumps the Import/Export version in fixtures and project templates
rake gitlab:import_export:data                                                                      # GitLab | Import/Export | Display exported DB structure
rake gitlab:import_export:export[username,namespace_path,project_path,archive_path]                 # GitLab | Import/Export | EXPERIMENTAL | Export large project archives
rake gitlab:import_export:import[username,namespace_path,project_path,archive_path]                 # GitLab | Import/Export | EXPERIMENTAL | Import large project archives
rake gitlab:import_export:version                                                                   # GitLab | Import/Export | Show Import/Export version
rake gitlab:incoming_email:check                                                                    # GitLab | Incoming Email | Check the configuration of Reply by email
rake gitlab:incoming_email:secret:edit                                                              # GitLab | Incoming Email | Secret | Edit Incoming Email secrets
rake gitlab:incoming_email:secret:show                                                              # GitLab | Incoming Email | Secret | Show Incoming Email secrets
rake gitlab:incoming_email:secret:write                                                             # GitLab | Incoming Email | Secret | Write Incoming Email secrets
rake gitlab:ldap:rename_provider[old_provider,new_provider]                                         # GitLab | LDAP | Rename provider
rake gitlab:ldap:secret:edit                                                                        # GitLab | LDAP | Secret | Edit LDAP secrets
rake gitlab:ldap:secret:show                                                                        # GitLab | LDAP | Secret | Show LDAP secrets
rake gitlab:ldap:secret:write                                                                       # GitLab | LDAP | Secret | Write LDAP secrets
rake gitlab:lfs:check                                                                               # GitLab | LFS | Check integrity of uploaded LFS objects
rake gitlab:lfs:migrate                                                                             # GitLab | LFS | Migrate LFS objects to remote storage
rake gitlab:packages:migrate                                                                        # GitLab | Packages | Migrate packages files to remote storage
rake gitlab:password:reset[username]                                                                # GitLab | Password | Reset a user's password
rake gitlab:praefect:replicas[project_id]                                                           # GitLab | Praefect | Check replicas
rake gitlab:redis:secret:edit[instance_name]                                                        # GitLab | Redis | Secret | Edit Redis secret
rake gitlab:redis:secret:show[instance_name]                                                        # GitLab | Redis | Secret | Show Redis secret
rake gitlab:redis:secret:write[instance_name]                                                       # GitLab | Redis | Secret | Write Redis secret
rake gitlab:refresh_project_statistics_build_artifacts_size[csv_path]                               # GitLab | Refresh build artifacts size project statistics for given list of Project IDs from CSV
rake gitlab:security:update_banned_ssh_keys[git_url,output_file]                                    # GitLab | Security | Update banned_ssh_keys config file from a remote Git repository
rake gitlab:seed:ci_catalog_resources[group_path,seed_count,publish]                                # Seed CI Catalog resources
rake gitlab:seed:ci_variables_group[name,seed_count,environment_scope,prefix]                       # Seed group with CI Variables
rake gitlab:seed:ci_variables_instance[seed_count,prefix]                                           # Seed instance with CI Variables
rake gitlab:seed:ci_variables_project[project_path,seed_count,environment_scope,prefix]             # Seed project with CI Variables
rake gitlab:seed:dependencies                                                                       # GitLab | Seed | Seed a new group with dependencies
rake gitlab:seed:group_seed[subgroups_depth,username]                                               # Seed groups with sub-groups/projects/epics/milestones for Group Import testing
rake gitlab:seed:issues[project_full_path,backfill_weeks,average_issues_per_week]                   # GitLab | Seed | Seeds issues
rake gitlab:seed:project_environments[project_path,seed_count,prefix]                               # Seed project with environments
rake gitlab:seed:runner_fleet[username,registration_prefix,runner_count,job_count]                  # Seed groups with sub-groups/projects/runners/jobs for Runner Fleet testing
rake gitlab:seed:vulnerabilities[project_full_path]                                                 # GitLab | Seed | Seed a project with vulnerabilities
rake gitlab:service_desk_email:secret:edit                                                          # GitLab | Service Desk Email | Secret | Edit Service Desk Email secrets
rake gitlab:service_desk_email:secret:show                                                          # GitLab | Service Desk Email | Secret | Show Service Desk Email secrets
rake gitlab:service_desk_email:secret:write                                                         # GitLab | Service Desk Email | Secret | Write Service Desk Email secrets
rake gitlab:setup                                                                                   # GitLab | Setup production application
rake gitlab:shell:install[repo]                                                                     # GitLab | Shell | Install or upgrade gitlab-shell
rake gitlab:shell:setup                                                                             # GitLab | Shell | Setup gitlab-shell
rake gitlab:sidekiq:all_queues_yml:check                                                            # GitLab | Sidekiq | Validate that all_queues.yml matches worker definitions
rake gitlab:sidekiq:all_queues_yml:generate                                                         # GitLab | Sidekiq | Generate all_queues.yml based on worker definitions
rake gitlab:sidekiq:check                                                                           # GitLab | Sidekiq | Check the configuration of Sidekiq
rake gitlab:sidekiq:migrate_jobs:queued                                                             # GitLab | Sidekiq | Migrate jobs in queues outside of routing rules
rake gitlab:sidekiq:migrate_jobs:retry                                                              # GitLab | Sidekiq | Migrate jobs in the retry set to new queue names
rake gitlab:sidekiq:migrate_jobs:schedule                                                           # GitLab | Sidekiq | Migrate jobs in the scheduled set to new queue names
rake gitlab:sidekiq:queues:check                                                                    # GitLab | Sidekiq | Validate all_queues.yml and sidekiq_queues.yml match worker definitions
rake gitlab:sidekiq:sidekiq_queues_yml:check                                                        # GitLab | Sidekiq | Validate that sidekiq_queues.yml matches worker definitions
rake gitlab:sidekiq:sidekiq_queues_yml:generate                                                     # GitLab | Sidekiq | Generate sidekiq_queues.yml based on worker definitions
rake gitlab:smtp:secret:edit                                                                        # GitLab | SMTP | Secret | Edit SMTP secrets
rake gitlab:smtp:secret:show                                                                        # GitLab | SMTP | Secret | Show SMTP secrets
rake gitlab:smtp:secret:write                                                                       # GitLab | SMTP | Secret | Write SMTP secrets
rake gitlab:snippets:list_non_migrated                                                              # GitLab | Show non migrated snippets
rake gitlab:snippets:migrate[ids]                                                                   # GitLab | Migrate specific snippets to git
rake gitlab:snippets:migration_status                                                               # GitLab | Show whether there are snippet background migrations running
rake gitlab:tcp_check[host,port]                                                                    # GitLab | Check TCP connectivity to a specific host and port
rake gitlab:terraform_states:migrate                                                                # GitLab | Terraform | Migrate Terraform states to remote storage
rake gitlab:two_factor:disable_for_all_users                                                        # GitLab | 2FA | Disable Two-factor authentication (2FA) for all users
rake gitlab:two_factor:rotate_key:apply                                                             # GitLab | 2FA | Rotate Key | Encrypt user OTP secrets with a new encryption key
rake gitlab:two_factor:rotate_key:rollback                                                          # GitLab | 2FA | Rotate Key | Rollback to secrets encrypted with the old encryption key
rake gitlab:update_project_templates                                                                # GitLab | Update project templates
rake gitlab:update_templates                                                                        # GitLab | Update templates
rake gitlab:uploads:check                                                                           # GitLab | Uploads | Check integrity of uploaded files
rake gitlab:uploads:migrate[uploader_class,model_class,mounted_as]                                  # GitLab | Uploads | Migrate the uploaded files of specified type to object storage
rake gitlab:uploads:migrate:all                                                                     # GitLab | Uploads | Migrate all uploaded files to object storage
rake gitlab:uploads:migrate_to_local[uploader_class,model_class,mounted_as]                         # GitLab | Uploads | Migrate the uploaded files of specified type to local storage
rake gitlab:uploads:migrate_to_local:all                                                            # GitLab | Uploads | Migrate all uploaded files to local storage
rake gitlab:uploads:sanitize:remove_exif[start_id,stop_id,dry_run,sleep_time,uploader,since]        # GitLab | Uploads | Remove EXIF from images
rake gitlab:usage_data:dump_non_sql_in_json                                                         # GitLab | UsageData | Generate non SQL data for usage ping in JSON
rake gitlab:usage_data:dump_sql_in_json                                                             # GitLab | UsageData | Generate raw SQLs for usage ping in JSON
rake gitlab:usage_data:dump_sql_in_yaml                                                             # GitLab | UsageData | Generate raw SQLs for usage ping in YAML
rake gitlab:usage_data:generate                                                                     # GitLab | UsageData | Generate usage ping in JSON
rake gitlab:usage_data:generate_and_send                                                            # GitLab | UsageData | Generate usage ping and send it to Versions Application
rake gitlab:usage_data:generate_from_yaml                                                           # GitLab | UsageDataMetrics | Generate usage ping from metrics definition YAML files in JSON
rake gitlab:usage_data:generate_sql_metrics_queries                                                 # GitLab | UsageDataMetrics | Generate raw SQL metrics queries for RSpec
rake gitlab:user_management:disable_project_and_group_creation[group_id]                            # GitLab | User management | Update all users of a group with personal project limit to 0 and can_create_...
rake gitlab:web_hook:add                                                                            # GitLab | Webhook | Adds a webhook to the projects
rake gitlab:web_hook:list                                                                           # GitLab | Webhook | List webhooks
rake gitlab:web_hook:rm                                                                             # GitLab | Webhook | Remove a webhook from a namespace
rake gitlab:workhorse:install[dir,repo]                                                             # GitLab | Workhorse | Install or upgrade gitlab-workhorse
rake gitlab:x509:update_signatures                                                                  # GitLab | X509 | Update signatures when certificate store has changed
rake grape:path_helpers                                                                             # Print route helper methods
rake grape:routes                                                                                   # Print compiled grape routes
rake import:github[token,gitlab_username,project_path]                                              # GitLab | Import | Import a GitHub project - Example: import:github[ToKeN,root,root/blah,my/github_repo]...
rake jira:generate_consumer_key                                                                     # Generate a consumer key for your application
rake jira:generate_public_cert                                                                      # Run the system call to generate a RSA public certificate
rake log:clear                                                                                      # Truncates all/specified *.log files in log/ to zero bytes (specify which logs with LOGS=test,development)
rake metrics:setup_common_metrics                                                                   # GitLab | Metrics | Setup common metrics
rake middleware                                                                                     # Prints out your Rack middleware stack
rake migrate_iids                                                                                   # GitLab | Build internal ids for issues and merge requests
rake migration_fix_15_11                                                                            # db | migration_fix_15_11
rake postgresql_md5_hash                                                                            # GitLab | Generate PostgreSQL Password Hash
rake raven:test[dsn]                                                                                # Send a test event to the remote Sentry server
rake restart                                                                                        # Restart app by touching tmp/restart.txt
rake secret                                                                                         # Generate a cryptographically secure secret key (this is typically used to generate a secret for cookie ...
rake setup                                                                                          # GitLab | Setup gitlab db
rake stats                                                                                          # Report code statistics (KLOCs, etc) from the application or engine
rake tanuki_emoji:aliases                                                                           # Generates Emoji aliases fixtures
rake tanuki_emoji:digests                                                                           # Generates Emoji SHA256 digests
rake tanuki_emoji:import                                                                            # Import emoji assets from TanukiEmoji to versioned folder
rake test                                                                                           # GitLab | List rake tasks for tests
rake test:all                                                                                       # Runs all tests, including system tests
rake test:db                                                                                        # Run tests quickly, but also reset db
rake test:system                                                                                    # Run system tests only
rake time:zones[country_or_offset]                                                                  # List all time zones, list by two-letter country code (`bin/rails time:zones[US]`), or list by UTC offse...
rake tmp:clear                                                                                      # Clear cache, socket and screenshot files from tmp/ (narrow w/ tmp:cache:clear, tmp:sockets:clear, tmp:s...
rake tmp:create                                                                                     # Creates tmp directories for cache, sockets, and pids
rake tokens:reset_all_email                                                                         # Reset all GitLab incoming email tokens
rake tokens:reset_all_feed                                                                          # Reset all GitLab feed tokens
rake tw:codeowners                                                                                  # Generates a list of codeowners for documentation pages
rake yarn                                                                                           # Install Node dependencies with Yarn
rake yarn:available                                                                                 # Ensure Yarn is installed
rake yarn:check                                                                                     # Ensure Node dependencies are installed
rake yarn:clobber                                                                                   # Remove Node dependencies
rake yarn:install                                                                                   # Install Node dependencies with Yarn / Install all JavaScript dependencies as specified via Yarn
rake zeitwerk:check                                                                                 # Checks project structure for Zeitwerk compatibility

 

Posted by Uli Köhler in Allgemein

ESP32 rmt_tx sync manager minimal example

See ESP32 rmt_tx simple pulse example (ESP-IDF) for an example without sync manager

#include <driver/rmt_tx.h>
rmt_channel_handle_t channel;
rmt_tx_channel_config_t tx_chan_config = {
    .gpio_num = GPIO_NUM_19,          // GPIO number
    .clk_src = RMT_CLK_SRC_DEFAULT,   // select source clock
    .resolution_hz = 1 * 1000 * 1000, // 1 MHz resolution
    .mem_block_symbols = 64,          // memory block size, 64 * 4 = 256 Bytes
    .trans_queue_depth = 1,           // set the number of transactions that can pend in the background
};
ESP_ERROR_CHECK(rmt_new_tx_channel(&tx_chan_config, &channel));
ESP_ERROR_CHECK(rmt_enable(channel));

rmt_symbol_word_t txdata[64];
txdata[0] = {
    .duration0 = 100,
    .level0 = 1,
    .duration1 = 0,
    .level1 = 0,
};

// install sync manager
rmt_channel_handle_t tx_channels[] = {channel};
rmt_sync_manager_handle_t synchro = NULL;
rmt_sync_manager_config_t synchro_config = {
    .tx_channel_array = tx_channels,
    .array_size = sizeof(tx_channels) / sizeof(rmt_channel_handle_t),
};
ESP_ERROR_CHECK(rmt_new_sync_manager(&synchro_config, &synchro));

// Create simple encoder
rmt_copy_encoder_config_t encoder_config;
rmt_encoder_handle_t encoder;
ESP_ERROR_CHECK(rmt_new_copy_encoder(&encoder_config, &encoder));

rmt_transmit_config_t tx_config = {
    .loop_count = 0, // no transfer loop
};

while(true)
{
    ESP_ERROR_CHECK(rmt_transmit(channel, encoder, pulseRMT, 1*sizeof(rmt_symbol_word_t), &tx_config));
    // Wait for one second
    vTaskDelay(10 / portTICK_PERIOD_MS);
}

 

Posted by Uli Köhler in Allgemein, ESP8266/ESP32

Recommended open-source screenshot software

My recommended software for screenshots is Flameshot

Posted by Uli Köhler in Allgemein

ESP32S3 maximum SPI speed

The ESP32-S3 supports the following maximum speeds on the SPI peripheral:

  • As SPI master: 80 MHz
  • As SPI slave: 60 MHz

Note that the same clock speeds work for dual and quad SPI

Source: ESP32S3 datasheet,

Posted by Uli Köhler in Allgemein

How to install Syncthing on Ubuntu

sudo curl -s -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg   
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list 
sudo apt -y install syncthing

 

Posted by Uli Köhler in Allgemein

How to read length-prefixed binary message from Serial using Arduino

The following function allows you to read a binary message, prefixed by a single length byte, from Serial:

#include <Arduino.h>

void setup() {
    Serial.begin(115200);
}

void HandleMessage(String msg) {
    // TODO: Your code to handle the message goes here.
    // See https://techoverflow.net/2022/11/15/how-to-print-string-as-sequence-of-hex-bytes-in-arduino/
    // for an example of how to print the message as a sequence of hex bytes.
}

void ReadMessageFromSerial() {
    // Wait until the length byte is available on Serial
    while (Serial.available() == 0);

    // Read the length of the message
    int length = Serial.read();

    // Read the rest of the message
    String message = "";
    for (int i = 0; i < length; i++) {
      while (Serial.available() == 0);
      message += char(Serial.read());
    }

    // Handle the message
    HandleMessage(message);
}

void loop() {
    ReadMessageFromSerial();
}

 

 

Posted by Uli Köhler in Allgemein, Arduino, Electronics, Embedded

How to fix InvenTree remote_image: Downloading images from remote URL is not enabled

Problem:

While trying to create an InvenTree object using a remote_image URL, you see an error message like

requests.exceptions.HTTPError: {'detail': 'Error occurred during API request', 'url': 'https://inventree-test.mydomain.com/api/company/', 'method': 'POST', 'status_code': 400, 'body': '{"remote_image":["Downloading images from remote URL is not enabled"]}', 'headers': {'AUTHORIZATION': 'Token 6daae3817756e9c1a3603b14d9582e61f50db388'}, 'params': {'format': 'json'}, 'data': {'name': 'DigiKey', 'website': 'https://www.digikey.de/', 'remote_image': 'https://logodix.com/logo/1667872.jpg', 'description': '', 'is_manufacturer': False, 'is_supplier': True, 'is_customer': False, 'currency': 'EUR'}}

Solution:

Open the InvenTree webinterface, open Server Configuration on the left

and enable Download from URL.

The setting will be effective immediately. There is no need to click any Apply button or restart the server.

 

Posted by Uli Köhler in Allgemein

How to fix zincati not updating CoreOS: rpm-ostree deploy failed: error: Packages not found: …

Problem:

My zincati service – the service that automatically updates CoreOS could not update CoreOS due to the following logs (view with journalctl -xfu zincati.service):

[ERROR zincati::update_agent::actor] failed to stage deployment: rpm-ostree deploy failed:
    error: Packages not found: magic-wormhole

Solution:

The solution typically involves uninstalling the package – in this case magic-wormhole using

sudo rpm-ostree uninstall magic-wormhole

Note that this might uninstall a service that is required for your infrastructure, and it will delete files associated with the package in the process of uninstalling it. You should make a backup of valuable data in any case.

Posted by Uli Köhler in Allgemein, CoreOS

How to prevent redmine always logging out

In Redmine, by default you are always logged out after a very short period of time.

You can fix this by logging in as an administrator and opening Administration -> Settings -> Authentication and setting Autologin to 365 days. You can also choose a lower value if you want sessions to automatically expire sooner.

Posted by Uli Köhler in Allgemein

Python curses keycode to key mapping

The following mapping is helpful in order to determine the mapping of a keycode to the corresponding curses.KEY_... constant.

I extracted this mapping by using

import curses
print(curses.__dict__)

Curses key mapping

'A_ATTRIBUTES': 4294967040,
'A_NORMAL': 0,
'A_STANDOUT': 65536,
'A_UNDERLINE': 131072,
'A_REVERSE': 262144,
'A_BLINK': 524288,
'A_DIM': 1048576,
'A_BOLD': 2097152,
'A_ALTCHARSET': 4194304,
'A_INVIS': 8388608,
'A_PROTECT': 16777216,
'A_CHARTEXT': 255,
'A_COLOR': 65280,
'A_HORIZONTAL': 33554432,
'A_LEFT': 67108864,
'A_LOW': 134217728,
'A_RIGHT': 268435456,
'A_TOP': 536870912,
'A_VERTICAL': 1073741824,
'A_ITALIC': 2147483648,
'COLOR_BLACK': 0,
'COLOR_RED': 1,
'COLOR_GREEN': 2,
'COLOR_YELLOW': 3,
'COLOR_BLUE': 4,
'COLOR_MAGENTA': 5,
'COLOR_CYAN': 6,
'COLOR_WHITE': 7,
'BUTTON1_PRESSED': 2,
'BUTTON1_RELEASED': 1,
'BUTTON1_CLICKED': 4,
'BUTTON1_DOUBLE_CLICKED': 8,
'BUTTON1_TRIPLE_CLICKED': 16,
'BUTTON2_PRESSED': 64,
'BUTTON2_RELEASED': 32,
'BUTTON2_CLICKED': 128,
'BUTTON2_DOUBLE_CLICKED': 256,
'BUTTON2_TRIPLE_CLICKED': 512,
'BUTTON3_PRESSED': 2048,
'BUTTON3_RELEASED': 1024,
'BUTTON3_CLICKED': 4096,
'BUTTON3_DOUBLE_CLICKED': 8192,
'BUTTON3_TRIPLE_CLICKED': 16384,
'BUTTON4_PRESSED': 65536,
'BUTTON4_RELEASED': 32768,
'BUTTON4_CLICKED': 131072,
'BUTTON4_DOUBLE_CLICKED': 262144,
'BUTTON4_TRIPLE_CLICKED': 524288,
'BUTTON5_PRESSED': 2097152,
'BUTTON5_RELEASED': 1048576,
'BUTTON5_CLICKED': 4194304,
'BUTTON5_DOUBLE_CLICKED': 8388608,
'BUTTON5_TRIPLE_CLICKED': 16777216,
'BUTTON_SHIFT': 67108864,
'BUTTON_CTRL': 33554432,
'BUTTON_ALT': 134217728,
'ALL_MOUSE_EVENTS': 268435455,
'REPORT_MOUSE_POSITION': 268435456,
'KEY_BREAK': 257,
'KEY_DOWN': 258,
'KEY_UP': 259,
'KEY_LEFT': 260,
'KEY_RIGHT': 261,
'KEY_HOME': 262,
'KEY_BACKSPACE': 263,
'KEY_F0': 264,
'KEY_F1': 265,
'KEY_F2': 266,
'KEY_F3': 267,
'KEY_F4': 268,
'KEY_F5': 269,
'KEY_F6': 270,
'KEY_F7': 271,
'KEY_F8': 272,
'KEY_F9': 273,
'KEY_F10': 274,
'KEY_F11': 275,
'KEY_F12': 276,
'KEY_F13': 277,
'KEY_F14': 278,
'KEY_F15': 279,
'KEY_F16': 280,
'KEY_F17': 281,
'KEY_F18': 282,
'KEY_F19': 283,
'KEY_F20': 284,
'KEY_F21': 285,
'KEY_F22': 286,
'KEY_F23': 287,
'KEY_F24': 288,
'KEY_F25': 289,
'KEY_F26': 290,
'KEY_F27': 291,
'KEY_F28': 292,
'KEY_F29': 293,
'KEY_F30': 294,
'KEY_F31': 295,
'KEY_F32': 296,
'KEY_F33': 297,
'KEY_F34': 298,
'KEY_F35': 299,
'KEY_F36': 300,
'KEY_F37': 301,
'KEY_F38': 302,
'KEY_F39': 303,
'KEY_F40': 304,
'KEY_F41': 305,
'KEY_F42': 306,
'KEY_F43': 307,
'KEY_F44': 308,
'KEY_F45': 309,
'KEY_F46': 310,
'KEY_F47': 311,
'KEY_F48': 312,
'KEY_F49': 313,
'KEY_F50': 314,
'KEY_F51': 315,
'KEY_F52': 316,
'KEY_F53': 317,
'KEY_F54': 318,
'KEY_F55': 319,
'KEY_F56': 320,
'KEY_F57': 321,
'KEY_F58': 322,
'KEY_F59': 323,
'KEY_F60': 324,
'KEY_F61': 325,
'KEY_F62': 326,
'KEY_F63': 327,
'KEY_DL': 328,
'KEY_IL': 329,
'KEY_DC': 330,
'KEY_IC': 331,
'KEY_EIC': 332,
'KEY_CLEAR': 333,
'KEY_EOS': 334,
'KEY_EOL': 335,
'KEY_SF': 336,
'KEY_SR': 337,
'KEY_NPAGE': 338,
'KEY_PPAGE': 339,
'KEY_STAB': 340,
'KEY_CTAB': 341,
'KEY_CATAB': 342,
'KEY_ENTER': 343,
'KEY_SRESET': 344,
'KEY_RESET': 345,
'KEY_PRINT': 346,
'KEY_LL': 347,
'KEY_A1': 348,
'KEY_A3': 349,
'KEY_B2': 350,
'KEY_C1': 351,
'KEY_C3': 352,
'KEY_BTAB': 353,
'KEY_BEG': 354,
'KEY_CANCEL': 355,
'KEY_CLOSE': 356,
'KEY_COMMAND': 357,
'KEY_COPY': 358,
'KEY_CREATE': 359,
'KEY_END': 360,
'KEY_EXIT': 361,
'KEY_FIND': 362,
'KEY_HELP': 363,
'KEY_MARK': 364,
'KEY_MESSAGE': 365,
'KEY_MOVE': 366,
'KEY_NEXT': 367,
'KEY_OPEN': 368,
'KEY_OPTIONS': 369,
'KEY_PREVIOUS': 370,
'KEY_REDO': 371,
'KEY_REFERENCE': 372,
'KEY_REFRESH': 373,
'KEY_REPLACE': 374,
'KEY_RESTART': 375,
'KEY_RESUME': 376,
'KEY_SAVE': 377,
'KEY_SBEG': 378,
'KEY_SCANCEL': 379,
'KEY_SCOMMAND': 380,
'KEY_SCOPY': 381,
'KEY_SCREATE': 382,
'KEY_SDC': 383,
'KEY_SDL': 384,
'KEY_SELECT': 385,
'KEY_SEND': 386,
'KEY_SEOL': 387,
'KEY_SEXIT': 388,
'KEY_SFIND': 389,
'KEY_SHELP': 390,
'KEY_SHOME': 391,
'KEY_SIC': 392,
'KEY_SLEFT': 393,
'KEY_SMESSAGE': 394,
'KEY_SMOVE': 395,
'KEY_SNEXT': 396,
'KEY_SOPTIONS': 397,
'KEY_SPREVIOUS': 398,
'KEY_SPRINT': 399,
'KEY_SREDO': 400,
'KEY_SREPLACE': 401,
'KEY_SRIGHT': 402,
'KEY_SRSUME': 403,
'KEY_SSAVE': 404,
'KEY_SSUSPEND': 405,
'KEY_SUNDO': 406,
'KEY_SUSPEND': 407,
'KEY_UNDO': 408,
'KEY_MOUSE': 409,
'KEY_RESIZE': 410,
'KEY_MIN': 257,
'KEY_MAX': 511}

 

Posted by Uli Köhler in Allgemein

How to setup ZeroTier One & ZTNCUI using docker-compose in just 2 minutes

First, create a directory for the ZeroTier One / ZTNCUI files to reside in, e.g.:

mkdir /opt/zerotier-mydomain

Now, create docker-compose.yml in that directory

version: '3.4'

services:
  ztncui:
    container_name: ztncui
    restart: always
    image: keynetworks/ztncui
    ports:
      - 9993:9993/udp
      - 3180:3180
      - 3443:3443
    volumes:
      - ./etc:/opt/key-networks/ztncui/etc
      - ./zt1:/var/lib/zerotier-one   

After that, create .env in said directory containing some info about your node:

NODE_ENV=production
HTTPS_PORT=3443
MYDOMAIN=zerotier.mydomain.com

Now we’ll use the script from Create a systemd service for your docker-compose project in 10 seconds in order to create a systemd service to automatically run the service:

curl -fsSL https://techoverflow.net/scripts/create-docker-compose-service.sh | sudo bash /dev/stdin

This script will also automatically start the service (i.e. docker-compose up). ZTNCUI (which comes packaged with ZeroTier One) will generate a temporary admin password automatically, which we can extract from the log using this simple command:

docker-compose exec ztncui cat /var/log/docker-ztncui.log | grep "Current Password" | tail -n 1

Example output:

2022/08/19 14:32:37 Current Password: esh0Eengai

Be sure to open the ports 9993/udp, 3180 and (unless you are using a reverse proxy) 3443 in your firewall, for example:

sudo ufw allow 9993/udp
sudo ufw allow 3180
sudo ufw allow 3443

Now we can open https://[IP]:3443 to open the webinterface (ignore the certificate validation error). You can also setup a reverse proxy at this stage, which we’ll cover in future posts.

You should see a page like this one:

Click Login at the top right:

Enter admin as username and the password we extracted above (esh0Eengai in this example).

You will be asked to change your password, and after that you can create ZeroTier networks.

Posted by Uli Köhler in Allgemein, Networking, ZeroTier

Where to find ESP32S2 bare chip reference schematic?

If you are not using the ESP32S2 as a module but as a chip, you need a reference schematic to check if you have errors in a schematic.

A good place to start is by checking out the schematic of the ESP32S2-MINI, which you can find on page 19 & 20 of the module datasheet.

Posted by Uli Köhler in Allgemein

How to import mbox file in Thunderbird

  1. Install ImportExportTools NG
  2. Right click on Local folders and in the context menu, in the ImportExportTools NG menu, click on Import mbox file
Posted by Uli Köhler in Allgemein

How to add filename extension to every file in directory

This shell script will rename every file in a directory recursively and add a .docx extension to its filename (even if there is already an extension), preventing overwriting existing files of the same name via mv --backup=numbered:

find . -type f -exec mv -v --backup=numbered "{}" "{}.docx" \;

 

Posted by Uli Köhler in Allgemein

How to configure SMTP server on MikroTik RouterOS

Use the following command in order to configure SMTP settings for a MikroTik router:

/tool e-mail set address=smtp.mydomain.com from="MikroTik <[email protected]>" tls=starttls [email protected] password=uFoome0Noh

Alternatively, you can configure these settings directly on the web interface at WebFig => Tools => EMail.

Posted by Uli Köhler in Allgemein

SSH to LXC container with Pubkey

ssh [user]@[my-container-address]

Problem

[user]@[my-container-address] Permission denied (publickey). 

Solution

Change the sshd_config

vim /etc/ssh/sshd_config 

from this

# PubkeyAuthentication no

to this

PubkeyAuthentication yes

.
Do not forget to add your pubkey to your authorized keys.

mkdir /home/[myuser]/.ssh & vim /home/[myuser]/.ssh/authorized_keys
Posted by Joshua Simon in Allgemein

LXC container share host network

Goal

You want to share the host network with all your lxc containers.

Check network settings of your containers by typing:

lxc network list

If it displays something like that:

+---------+----------+---------+-------------+---------+
|  NAME   |   TYPE   | MANAGED | DESCRIPTION | USED BY |
+---------+----------+---------+-------------+---------+
| docker0 | bridge   | NO      |             | 0       |
+---------+----------+---------+-------------+---------+
| eth0    | physical | NO      |             | 0       |
+---------+----------+---------+-------------+---------+

Solution

Set up your container with the default settings of LXD, creating a network for all containers attached to the newly created lxdbr0 adapter on the host system with

lxd init

and accept the defaults:

Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:                                                             

and have your containers already connected to the lxdbr0 bridge on your host.
You might now see something like this.

+---------+----------+---------+-------------+---------+
|  NAME   |   TYPE   | MANAGED | DESCRIPTION | USED BY |
+---------+----------+---------+-------------+---------+
| docker0 | bridge   | NO      |             | 0       |
+---------+----------+---------+-------------+---------+
| eth0    | physical | NO      |             | 0       |
+---------+----------+---------+-------------+---------+
| lxdbr0  | bridge   | YES     |             | 5       |
+---------+----------+---------+-------------+---------+

Now try it

lxc exec [mycontainer] /bin/bash                                               
curl https://techoverflow.net
Posted by Joshua Simon in Allgemein

OctoPrint: Pause/Resume G-Code to move nozzle away

This pause / resume G-Code for OctoPrint (will likely also work with other platforms, but we only tested using OctoPrint) will move the nozzle 100mm away from the part being printed during the pause and (after clicking resume) will move to the original position i.e. it will continue the print normally.

This is useful to prevent heat damage to the part and also allow you to clean the nozzle during pause

Pause G-Code:

G91 ; Set relative positioning mode
G0Z100 ; Move Z up 100mm to assist nozzle cleaning
G90 ; Set absolute positioning mode

Resume G-Code:

G91 ; Set relative positioning mode
G0Z-100 ; Move Z down 100mm to return to print position
G90 ; Set absolute positioning mode
Posted by Uli Köhler in Allgemein

Excel: How to replace formula cell by its value

TL;DR: Press F2, then F9 to replace a cell by its value.

Click on the formula cell (click once, no need to click twice):

Now press the F2 key to edit the cell:

Now press the F9 key to replace the cell by its value:

Posted by Uli Köhler in Allgemein

How to fix MANIFEST.in graft having no effect on Windows

Problem:

In your MANIFEST.in, you have a line like

graft src/

but when you run

python setup.py sdist

some file in src is not included in the archive

Solution:

This is due to the slash at the end of src/! The slash works fine on Linux, but on Windows, backslashes are used to separate directory names. You can just remove the slash after src, it doesn’t serve any purpose on Windows or Linux:

graft src

After that, retry and you should see your file being included in the sdist archive.

Posted by Uli Köhler in Allgemein