Skip to content

Instantly share code, notes, and snippets.

View cschlote's full-sized avatar

Carsten Schlote cschlote

View GitHub Profile
@Xiol
Xiol / README.md
Last active August 31, 2024 07:47
Extend Gitlab access token expiry dates

Extend Gitlab Access Tokens

Gitlab enforced token expiry limits to 365 days last year, and the time is now upon us.

They don't have an opt-out for this, and haven't provided a way to easily extend tokens in the web interface. They have also gated their credential management interface behind their Ultimate license.

This quickly thrown together script will allow you to add an extra year to all tokens that expire in the next 30 days. It will not reactivate tokens that have already expired.

Requires the python-gitlab module. Edit your self-hosted Gitlab instance details into the script and run it. It will dump out CSVs of all expiring tokens, and then dump out a list of commands you can paste into a gitlab-rails console session to extend the expiry date by another year. If you need them to be active for longer, change 1.year.from_now to the value of your choice, e.g. `10.years.fro

@SingingBush
SingingBush / dlang_version_check.md
Last active January 6, 2023 18:32
a collection of D version checks for compatibility
// https://dlang.org/changelog/2.101.0.html#logger
static if(__traits(compiles, (){ import std.logger; } )) {
    import std.logger;
} else {
    // logger was in 'std.experimental' for a long time but you could optionally check that too
    import std.experimental.logger;
}