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
$ jython | |
Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06) | |
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_38 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> test = "key=http\:\/\/example.com/?urlkey\=urlval" | |
>>> import java.util.Properties | |
>>> p = java.util.Properties() | |
>>> import java.io.StringReader | |
>>> sr = java.io.StringReader(test) | |
>>> p.load(sr) |
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
Status Code: 500 | |
Exception: | |
Stacktrace: | |
java.lang.NullPointerException | |
at configurationslicing.BooleanSlice.get(BooleanSlice.java:39) | |
at configurationslicing.BooleanSlicer.transform(BooleanSlicer.java:36) | |
at configurationslicing.BooleanSlicer.transform(BooleanSlicer.java:8) | |
at configurationslicing.ConfigurationSlicing$SliceExecutor.transform(ConfigurationSlicing.java:135) | |
at configurationslicing.ConfigurationSlicing$SliceExecutor.doSliceconfigSubmit(ConfigurationSlicing.java:179) |
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
from glob import glob | |
bullshit = "<hudson.plugins.statusmonitor.MonitorPublisher/>" | |
for cfile in glob("jobs/*/config.xml"): | |
ftxt = open(cfile).read() | |
ftxt = ftxt.replace(bullshit, "\n") | |
f = open(cfile, 'w') | |
f.write(ftxt) | |
f.close() |
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 os | |
from glob import glob | |
# check for build jobs without sane retention policies | |
data = [] | |
for bdir in glob("jobs/*/builds"): | |
walkgen = os.walk(bdir) | |
dirpath, dirnames, filenames = walkgen.next() | |
data.append((len(dirnames), bdir)) |
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
from glob import glob | |
import xml.etree.ElementTree as ET | |
# fix bad retention policies | |
maxkeep = 20 | |
maxakeep = 20 | |
nopolicy = [] | |
for cfile in glob("jobs/*/config.xml"): | |
tree = ET.parse(cfile) |
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
$ grep -h "sed" jobs/*/config.xml | sed s/\&apos\;/\'/ | sed s/\"\;/\"/ | sort | uniq | less |
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
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system-- | |
usr sys idl wai hiq siq| read writ| recv send| in out | int csw | |
1 0 98 0 0 0| 219k 300k| 0 0 | 102B 134B| 806 1227 | |
13 16 47 23 0 0| 163M 3444k| 842k 932k| 0 0 |5471 4033 | |
7 16 58 20 0 0| 180M 1680k| 106k 188k| 0 0 |4999 3946 | |
1 6 55 38 0 0| 46M 90M| 38k 55k| 0 0 |1868 1618 | |
0 12 69 18 0 0| 126M 40M| 28k 34k| 0 0 |3124 2820 | |
1 2 59 39 0 0|2692k 125M| 32k 45k| 0 0 |1014 822 | |
0 1 50 48 0 0|4096k 6916k| 13k 16k| 0 0 |1134 839 | |
1 3 42 55 0 0|4480k 130M| 17k 19k| 0 0 | 953 955 |
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
from glob import glob | |
import xml.etree.ElementTree as ET | |
credentials = {"example.com": ("username", "jumbledpassword") } | |
for cfile in glob("jobs/*/subversion.credentials"): | |
tree = ET.parse(cfile) | |
entries = tree.findall('//entry') | |
for entry in entries: | |
url = entry.find('string') |
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 os | |
import os.path as osp | |
import hashlib | |
data = [] | |
for path, dirnames, fnames in os.walk('.'): | |
if path.endswith('art'): | |
for fname in fnames: | |
sha1 = hashlib.sha1(open(osp.join(path, fname)).read()).hexdigest() |
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
$ python | |
Python 2.7.4 (default, Sep 26 2013, 03:20:26) | |
[GCC 4.7.3] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from aptsources import distro | |
>>> d = distro.get_distro() | |
>>> d.description | |
u'Linux Mint 15 Olivia' | |
>>> isinstance(d, distro.DebianDistribution) | |
False |
OlderNewer