Skip to content

Instantly share code, notes, and snippets.

Benedicte Emilie Brækken benedicteb

Block or report user

Report or block benedicteb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@benedicteb
benedicteb / find_orphaned_pkgs.py
Last active Jan 31, 2017
Script for finding pkg or dmg-files in a munki-repo that's not used in any pkginfo files.
View find_orphaned_pkgs.py
#!/usr/bin/env python
"""
Usage:
./find_orphaned_pkgs.py
./find_orphaned_pkgs.py | grep -ie libreoffice | xargs rm # Remove all orphaned libreoffice pkgs
./find_orphaned_pkgs.py --munki-repo path/to/munki/repo
./find_orphaned_pkgs.py --count
"""
import argparse
@benedicteb
benedicteb / munki_fix_categories.py
Created Mar 22, 2016
This is a script for fixing categories in a munki repo. Call it with the path to your repo.
View munki_fix_categories.py
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
This is a script for fixing categories in a munki repo. Call it with the path to
your repo.
./munki_fix_categories.py fix --munki-repo path/to/munki/repo
It will set the same category on items with the same name. If there are items
not categorized after the fix and the interactive flag is not disabled the
View keybase.md

Keybase proof

I hereby claim:

  • I am benedicteb on github.
  • I am benedebr (https://keybase.io/benedebr) on keybase.
  • I have a public key ASDI6tQKX8O_eJklU1PFmBNhNOOYS4nLtcIu3F5j4lMsLAo

To claim this, I am signing this object:

@benedicteb
benedicteb / pkgToDmg.py
Created Jan 12, 2016
Script for packaging a pkg into a dmg.
View pkgToDmg.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 2016-01-12 11:38
Short script for packaging a pkg into a dmg.
@author benediceb
"""
import sys
View args.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2015 benedicte <benedicte@natalie>
#
# Distributed under terms of the MIT license.
"""
View lesefil.py
#!/usr/bin/env python
import re
sr_Q = r'Q-value\s*=\s*([0-9\.Ee+\-]+)\s*'
sr_mass = r'mass\s*=\s*([0-9\.Ee+\-]+)\s*'
sr_E = r'E-threshold\s*=\s*([0-9\.Ee+\-]+)\s*'
sr_energies = r'energies\s*=\s*([0-9\.Ee+\-]+)\s*'
filename = 'rp030065.tot'
infile = open(filename, 'r')
You can’t perform that action at this time.