Skip to content

Instantly share code, notes, and snippets.

$ /opt/homebrew/bin/sl config paths.default
$ /opt/homebrew/bin/sl log -T '{node}' -r 'ancestor(., main)'
$ /opt/homebrew/bin/sl log -r 'max(descendants(.))' -T '{node}'
$ git --git-dir /Users/brandonbennett/Code/testsap/.sl/store/git rev-list --header '^b3cd6c01e96f7b2a50294d97cb8a60f327cd9875' faa7bc9df57fe920a29b41902e7a940c55224c8e
$ git --git-dir /Users/brandonbennett/Code/testsap/.sl/store/git rev-list --header '^b3cd6c01e96f7b2a50294d97cb8a60f327cd9875^@' b3cd6c01e96f7b2a50294d97cb8a60f327cd9875
$ git --git-dir /Users/brandonbennett/Code/testsap/.sl/store/git rev-parse '3e3f4c1dbbd23b9a70f815441bbc9d6688844d4b~^{tree}'
$ git --git-dir /Users/brandonbennett/Code/testsap/.sl/store/git config --get commit.gpgsign
$ git --git-dir /Users/brandonbennett/Code/testsap/.sl/store/git commit-tree -p b3cd6c01e96f7b2a50294d97cb8a60f327cd9875 dae37a0b9fecafee09c60547d255659eb9b5ed44
$ /opt/homebrew/bin/sl config paths.default
$ git --git-dir /Users/brandonbennett/Code/testsap/.sl/store/git push https://github.com/ne
This file has been truncated, but you can view the full file.
--- bindist 2021-07-07 16:49:29.363260904 -0600
+++ src-all 2021-07-07 17:06:15.439330977 -0600
@@ -565,6 +565,237 @@
./pkg/linux_amd64/archive/zip.a
./pkg/linux_amd64/bufio.a
./pkg/linux_amd64/bytes.a
+./pkg/linux_amd64/cmd
+./pkg/linux_amd64/cmd/asm
+./pkg/linux_amd64/cmd/asm/internal
+./pkg/linux_amd64/cmd/asm/internal/arch.a
256
32 1 255
31 2 254
30 4 252
29 8 248
28 16 240
27 32 224
26 64 192
25 128 128
24 256 0
switch#show ip dhcp relay | json
{
"errors": [
"This is an unconverted command"
]
}
SSH Tunneling for lab access
SSH to the rescue
- Local forwarding `-L`<local`port>:<remote`ip>:<remote`port>`
- Remote forwarding `-R`<port`on`jump`host>:<local`ip>:<local`port>`
ssh -L 8179:10.0.0.31:179 -R :11019:localhost:11019 ntc@<jump host>
import itertools
import operator
def range_str(l):
groups=[]
for _, g in itertools.groupby(enumerate(l), lambda (i,x):i-x):
group = map(operator.itemgetter(1), g)
if len(group) > 1:
groups.append("{}-{}".format(group[0], group[-1]))
else:
Warning: time of day goes back (-3646424684554121152us), taking countermeasures.
40 bytes from 8.8.8.8: icmp_seq=271 ttl=56 (truncated)
64 bytes from 8.8.8.8: icmp_seq=547 ttl=56 time=621 ms
64 bytes from 8.8.8.8: icmp_seq=548 ttl=56 time=654 ms
64 bytes from 8.8.8.8: icmp_seq=549 ttl=56 time=650 ms
64 bytes from 8.8.8.8: icmp_seq=550 ttl=56 time=690 ms
64 bytes from 8.8.8.8: icmp_seq=551 ttl=56 time=631 ms
Warning: time of day goes back (-3646424684549159756us), taking countermeasures.
40 bytes from 8.8.8.8: icmp_seq=292 ttl=56 (truncated)
64 bytes from 8.8.8.8: icmp_seq=552 ttl=56 time=717 ms
[2017-09-11T22:54:48-06:00] INFO: Processing dnf_package[dmidecode] action upgrade (cpe_ohai::default line 52)
[2017-09-11T22:54:48-06:00] DEBUG: Providers for generic dnf_package resource enabled on node include: [Chef::Provider::Package::Dnf]
[2017-09-11T22:54:48-06:00] DEBUG: Provider for action upgrade on resource dnf_package[dmidecode] is Chef::Provider::Package::Dnf
[2017-09-11T22:54:50-06:00] DEBUG: sending '{"action":"whatinstalled","provides":"dmidecode"}' to python helper
[2017-09-11T22:54:51-06:00] DEBUG: sending '{"action":"whatinstalled","provides":"dmidecode"}' to python helper
[2017-09-11T22:54:51-06:00] DEBUG: sending '{"action":"whatinstalled","provides":"dmidecode"}' to python helper
[2017-09-11T22:54:51-06:00] DEBUG: sending '{"action":"whatinstalled","provides":"dmidecode"}' to python helper
[2017-09-11T22:54:52-06:00] DEBUG: sending '{"action":"whatinstalled","provides":"dmidecode"}' to python helper
[2017-09-11T22:54:52-06:00] INFO: Retrying execution of dnf_package[dmidecode], 0 attempt
(vlan, port1, port2) = struct.unpack('HBB', '\x02\x00\x28\x0a')
slot = (port1&0xf0)>>4
mod = (port1&0x08) ^ (port2&0x08) << 1
port = (port1&0x07) ^ (port2&0x07)<<3
print "Gi{}/{}".format(slot, mod + port)
RulesSrcObjects = Table('rules_src_objects',
Column('id', Integer, primary_key=True),
Column('rule_id', Integer, ForeignKey('Rule.id')),
Column('object_id', Integer, ForeignKey('Object.id')),
RulesDstbjects = Table('rules_dst_objects',
Column('id', Integer, primary_key=True),
Column('rule_id', Integer, ForeignKey('Rule.id')),
Column('object_id', Integer, ForeignKey('Object.id')),