- edit
.gitmodules>[submodule "path/to/submodule"] - edit
.git/config>[submodule "path/to/submodule"] - edit
path/to/submodule/.git>gitdir - edit
.git/modules/path/to/submodule/config>worktree - move
.git/modules/path/to/submoduleto its new path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def fmt_table( | |
| table, between_column_padding_size=5, alternate_brightness=True, left_padding_size=0 | |
| ): | |
| output_lines = [] | |
| assert all( | |
| len(row) <= len(table[0]) for row in table | |
| ), "no row can have more elements than the header row" | |
| column_widths = [0] * len(table[0]) | |
| for row in table: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| import sys | |
| import json | |
| from json import JSONDecodeError | |
| from urllib import request | |
| from urllib.error import HTTPError | |
| from http.client import HTTPResponse | |
| """ | |
| helps locate release files from github |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foo | |
| bar | |
| baz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table> | |
| <tr> | |
| <th>End Date:</th> | |
| <td> | |
| <a href=""> | |
| <span><i class="fas fa-redo-alt" aria-hidden="true"></i> | |
| Expires in {{ allocation.expires_in }} day{{ allocation.expires_in|pluralize }} - Click to renew | |
| </span> | |
| </a> | |
| </td> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import urllib.parse | |
| import xml.etree.ElementTree as ET | |
| from ansible.errors import AnsibleError | |
| from ansible.utils.display import Display | |
| from ansible.plugins.lookup import LookupBase | |
| DOCUMENTATION = """ | |
| name: incommon_scopes | |
| author: Simon Leary <simon.leary42@proton.me> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| from typing import Any, List | |
| from ldap3 import BASE, MODIFY_ADD, MODIFY_DELETE, MODIFY_REPLACE, Connection | |
| from ldap3.core.exceptions import LDAPException | |
| from ldap3.utils.log import ERROR, set_library_log_detail_level | |
| """ | |
| wrapper interface for ldap3 | |
| sacrifices performance for simlicity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - name: add gitlab to /root/.ssh/known_hosts | |
| ansible.builtin.known_hosts: | |
| name: "{{ (item | split())[0] }}" | |
| key: "{{ item }}" | |
| loop: "{{ lookup('pipe', 'ssh-keyscan gitlab.rc.umass.edu gitlab.unity.rc.umass.edu') | split('\n') | reject('match', '^#') }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR | |
| # usage: backup.bash /path/to/backup/dir num_backups_to_keep | |
| # backup dir must contain a file called 'index' which must contain just a number | |
| # this index number is used to delete older backup files | |
| # if this script fails, the index will be modified so that no backups will be deleted in the future | |
| # to re-enable deletion of old backups, overwrite index back to a number | |
| # recommended usage is with cron jobs of varying frequency | |
| # this way it is easy to keep logs from recently, yesterday, last week, last month, ... |
NewerOlder