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
| // -*- mode: groovy -*- | |
| // vim: set filetype=groovy : | |
| node( 'some_node' ) { | |
| stage( "Phase 1" ) { | |
| sshagent( credentials: [ 'some_creds' ] ) { | |
| checkout scm | |
| def lastSuccessfulCommit = getLastSuccessfulCommit() | |
| def currentCommit = commitHashForBuild( currentBuild.rawBuild ) | |
| if (lastSuccessfulCommit) { |
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
| REM If you want to set metrics on interfaces go to the confguration of the network interface: | |
| REM (THIS IS NOT POSSIBLE WITH THE route COMMAND !!) | |
| REM Goto: 'Internet Protocol Version 4 (TCP/IPv4)' -> Properties | |
| REM Goto: 'General' -> Advanced | |
| REM Goto: 'IP Settings' | |
| REM Uncheck 'Automatic metric' | |
| REM Type in the metric you want for that interface in 'Interface metric' | |
| REM Find out what the interface number is | |
| route print |
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 find(find_object, result, keys=[]): | |
| if isinstance(find_object, dict): | |
| for key, value in find_object.iteritems(): | |
| find(value, result, keys + [key]) | |
| else: | |
| if not(result): | |
| result['values'] = [find_object] | |
| result['keys'] = [keys] | |
| else: | |
| result['values'].append(find_object) |
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 | |
| # | |
| # adb_with_reconnect.sh: Wrapper around Android Debug Bridge which auto reconnects when network connection has to reestablished (Useful in case of unstable Android device or poor network connection. Also makes use of nmap for an analysis of the Android device, so installation of nmap is recommended | |
| # | |
| # Copyright (C) 2016 Sander Bel | |
| # | |
| # This program is free software: you can redistribute it and/or modify it under the terms of the | |
| # GNU General Public License as published by the Free Software Foundation, either version 3 of the | |
| # License, or (at your option) any later version. | |
| # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without |
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
| #!/usr/bin/python | |
| """football-data.co.uk_convert.py: Convert xslx files to one or more workable csv file(s) | |
| Copyright (C) 2016 Sander Bel | |
| This program is free software: you can redistribute it and/or modify it under the terms of the | |
| GNU General Public License as published by the Free Software Foundation, either version 3 of the | |
| License, or (at your option) any later version. | |
| This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without |
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
| # Basic examples | |
| >>> var1 = 100 | |
| >>> eval("50 + var1") | |
| 150 | |
| >>> eval("var1 = 25") | |
| Traceback (most recent call last): | |
| File "<stdin>", line 1, in <module> | |
| File "<string>", line 1 | |
| var1 = 25 | |
| ^ |
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
| # Code below behaves the same as eval() | |
| eval(compile(str_source_code, “<string>”, “eval”)) | |
| # Code below behaves the same as exec() | |
| exec(compile(str_source_code, “<string>”, “exec”)) |
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
| var = <any valid Python syntax you can place here is an expression> |
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 dbus | |
| class dbus_parse(object): | |
| __slots__ = ("__dbus_parse_dict", "__parse_dbus_dict", "__parse_dbus_list", "__parse_dbus_tuple", "__parse_dbus_var", "parse_dbus_vars") | |
| def __init__(self): | |
| self.__dbus_parse_dict = { dbus.String: str, | |
| dbus.Int16: int, dbus.Int32: int, dbus.Int64: int, | |
| dbus.UInt16: int, dbus.UInt32: int, dbus.UInt64: int, | |
| dbus.Double: float, | |
| dbus.Boolean: bool, |
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
| zip([iterable, ...]) | |
| # Example | |
| >>> test_list1 = ["a", "b", "c"] | |
| >>> test_list2 = [1, 2, 3] | |
| >>> zip(test_list1, test_list2) | |
| [('a', 1), ('b', 2), ('c', 3)] | |
| >>> dict(zip(test_list1, test_list2)) | |
| {'a': 1, 'c': 3, 'b': 2} | |
| >>> test_list2 = [1, 2, 3, 4] |
NewerOlder