Skip to content

Instantly share code, notes, and snippets.

View Opalo's full-sized avatar

Maciek Opala Opalo

View GitHub Profile
@anikolaienko
anikolaienko / github_repo_admins_list.sh
Last active August 24, 2022 08:36
Get list of Github repo Admins
# Check all page numbers starting 1 until result is empty
curl "https://api.github.com/repos/ORG/REPO/collaborators?per_page=100&page=1" -H "Authorization: Token ACCESS_TOKEN" | \
jq '[ .[] | select(.permissions.admin == true) | .html_url ]'
@tyrells
tyrells / disable-service.yml
Last active October 19, 2023 20:53
Ansible task to stop service even if it doesn't exist
# This task will stop and disable a service without failing if the service does not exist.
# Requires Ansible 1.4 or newer.
# Update Dec 2016: Have rewritten this for the latest version of ansible and put conditions for both Ubuntu and CentOS
- name: "disable unused services"
service: name={{item}} state=stopped enabled=no
register: command_result
failed_when: "unused_disable|failed and ('find' not in unused_disable.msg and 'found' not in unused_disable.msg)"
with_items:
@ge0ffrey
ge0ffrey / gist:5909266
Last active August 13, 2019 11:31
Is this progress? ... KieBase (drools 6) versus RuleBase (drools 4)
Given List<String< scoreDrlList, how do we build a RuleBase/KieBase?
Drools 4 (building a RuleBase):
PackageBuilder packageBuilder = new PackageBuilder();
for (String scoreDrl : scoreDrlList) {
InputStream scoreDrlIn = getClass().getResourceAsStream(scoreDrl);
packageBuilder.addPackageFromDrl(new InputStreamReader(scoreDrlIn, "UTF-8"));
}
RuleBaseConfiguration ruleBaseConfiguration = new RuleBaseConfiguration();