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 ip2hex(cidr, router): | |
| addr, mask = cidr.split("/") | |
| mask = int(mask) | |
| addr = [("%2s" % hex(int(i))[2:]).replace(" ", "0") for i in addr.split(".") if i != "0"] | |
| parts = mask/8 - len(addr) | |
| if mask%8 > 0: | |
| parts += 1 | |
| if parts > 0: | |
| for i in range(int(parts)): | |
| addr.append("00") |
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
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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 debian:latest | |
| ARG DEBIAN_FRONTEND=noninteractive | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends curl gnupg ca-certificates apt-transport-https lsb-release git && \ | |
| echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] \ | |
| https://packages.cloud.google.com/apt cloud-sdk main" | \ | |
| tee /etc/apt/sources.list.d/google-cloud-sdk.list && \ | |
| curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \ | |
| apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \ |
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
| Started by user rtyler | |
| Loading library pipeline-library@acme-test | |
| > git rev-parse --is-inside-work-tree # timeout=10 | |
| Fetching changes from the remote Git repository | |
| > git config remote.origin.url git://github.com/jenkins-infra/pipeline-library.git # timeout=10 | |
| Fetching upstream changes from git://github.com/jenkins-infra/pipeline-library.git | |
| > git --version # timeout=10 | |
| > git fetch --tags --progress git://github.com/jenkins-infra/pipeline-library.git +refs/heads/*:refs/remotes/origin/* | |
| > git rev-parse refs/remotes/origin/acme-test^{commit} # timeout=10 | |
| > git rev-parse refs/remotes/origin/origin/acme-test^{commit} # timeout=10 |
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/env bash | |
| # Time-stamp: <2017-04-27 09:57:21 kmodi> | |
| # Time-stamp: <2018-03-20 12:58:02 bobpaul> | |
| # derived from kmodi's gist: https://gist.github.com/kaushalmodi/74e9875d5ab0a2bc1010447f1bee5d0a | |
| # | |
| # Example of using getopt to parse command line options | |
| # http://stackoverflow.com/a/29754866/1219634 Limitation: All the options | |
| # starting with - have to be listed in --options/--longoptions, else getopt will | |
| # error out. | |
| # The downside is that if you intend to use this as a wrapper to some other program, |
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
| #!groovy | |
| def handleCheckout = { | |
| if (env.gitlabMergeRequestId) { | |
| sh "echo 'Merge request detected. Merging...'" | |
| def credentialsId = scm.userRemoteConfigs[0].credentialsId | |
| checkout ([ | |
| $class: 'GitSCM', | |
| branches: [[name: "${env.gitlabSourceNamespace}/${env.gitlabSourceBranch}"]], | |
| extensions: [ |
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/env python3 | |
| # CSR OTAU binary parser | |
| # https://developer.qualcomm.com/qfile/34081/csr102x_otau_overview.pdf | |
| # For use with test and demonstration only. This is obviously not official and | |
| # is not affiliated with Qualcomm. | |
| import io | |
| import os | |
| import sys |
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
| # Client Bridged / Client Mode / RelayD and IGMPProxy (It works) | |
| # RelayD is to redirect packages and IGMP is for redirect IGMP packages | |
| # Our network is 192.168.1.0/24 | |
| # Steps: | |
| # Configure WAN as static | |
| # We should edit our wan iface and put static IP | |
| uci set network.wan='interface' | |
| uci set network.wan.proto='static' | |
| uci set network.wan.ipaddr='192.168.1.239' # Main Network IP |
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
| diff --git a/bundle.cc b/bundle.cc | |
| index e7e3a51..70fdef2 100644 | |
| --- a/bundle.cc | |
| +++ b/bundle.cc | |
| @@ -11,6 +11,7 @@ | |
| #include "message.hh" | |
| #include "adler32.hh" | |
| #include "compression.hh" | |
| +#include "debug.hh" | |
NewerOlder