Skip to content

Instantly share code, notes, and snippets.

@bbinet
bbinet / pepper_format.py
Last active March 15, 2021 14:13
Use salt outputters to format pepper output, see https://github.com/saltstack/pepper/issues/3
#!/home/bruno/.virtualenvs/salt/bin/python
"""
This script formats pepper output using salt outputters.
It can both format sync and async jobs, and can be used in the following ways:
```
$ pepper \* state.sls core | pepper_format.py -o highstate
$ pepper --client=local_async \* state.highstate | pepper_format.py
$ pepper_format.py 20170504160400750792
```
@bbinet
bbinet / weekday_in_month.sh
Created September 27, 2017 07:40
Get dates for Nth weekday in month: eg. get every 3rd tuesday of next 12 months
#!/bin/bash
if [ $# -lt 2 ]
then
echo "Usage: $0 <day_in_week> <week_in_month> [<nb_months>]"
echo " day_in_week: [0-6] (Sun=0 Mon=1 Tue=2 Wed=3 Thu=4 Fri=5 Sat=6)"
echo " week_in_month: [1-5]"
fi
day_in_week=$1
@bbinet
bbinet / resin host contamination
Created March 1, 2018 08:36
resin host contamination
Build Configuration:
BB_VERSION = "1.34.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal-4.9"
TARGET_SYS = "x86_64-poky-linux"
MACHINE = "genericx86-64"
DISTRO = "resin-os"
DISTRO_VERSION = "2.9.7"
TUNE_FEATURES = "m64 core2"
TARGET_FPU = ""
Building JSON manifest...
up to date in 0.149s
...Done
You had no conf/local.conf file. This configuration file has therefore been
created for you with some default values. You may wish to edit it to, for
example, select a different MACHINE (target hardware). See conf/local.conf
for more information as common configuration options are commented.
You had no conf/bblayers.conf file. This configuration file has therefore been
created for you with some default values. To add additional metadata layers
[Tue Mar 13 09:42:37 2018] overlayfs: failed to resolve '/var/lib/docker/overlay2/l/7I3ZTA3E3WL6NE37L7ZWXYVMHJ': -2
[Tue Mar 13 09:57:20 2018] mmc0: timeout waiting for hardware interrupt.
[Tue Mar 13 09:57:20 2018] [109eef30] PRD1 dd827e10 0
[Tue Mar 13 09:57:20 2018] [109eef3a] PRD2 4 0
[Tue Mar 13 09:57:20 2018] [109eef46] PRD3 dceb2784 0
[Tue Mar 13 09:57:20 2018] [109eef46] PDM> dca12628 0
[Tue Mar 13 09:57:20 2018] [109eef47] REQ< dca12558 10801
[Tue Mar 13 09:57:20 2018] [109eef49] CMD< 19 5b30a8
[Tue Mar 13 09:57:20 2018] [109eef4f] CMDD 20 200
[Tue Mar 13 09:57:20 2018] [109eef51] SDMA dca12628 dd827e10
-- Logs begin at Wed 2018-03-28 17:12:02 CEST, end at Wed 2018-03-28 17:12:56 CEST. --
Mar 28 17:12:02 hltest-mc-2 systemd[1]: Started Resin persistent logs.
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: Found user 'avahi' (UID 995) and group 'avahi' (GID 994).
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: Successfully dropped root privileges.
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: avahi-daemon 0.6.32 starting up.
Mar 28 17:12:02 hltest-mc-2 systemd[1]: Started Avahi mDNS/DNS-SD Stack.
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: Successfully called chroot().
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: Successfully dropped remaining capabilities.
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: Loading service file /services/ssh.service.
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: Joining mDNS multicast group on interface resin-dns.IPv6 with address fe80::dce3:b7ff:fe59:9ade.
-- Logs begin at Sun 2018-04-08 05:09:44 UTC, end at Mon 2018-04-09 12:36:55 UTC. --
Apr 08 05:09:52 raspberrypi systemd[1]: Starting Network Manager...
Apr 08 05:09:53 hlnew-mc-armv6hf NetworkManager[621]: <info> [1523164193.6113] NetworkManager (version 1.10.0) is starting... (for the first time)
Apr 08 05:09:53 hlnew-mc-armv6hf NetworkManager[621]: <info> [1523164193.6208] Read config: /etc/NetworkManager/NetworkManager.conf
Apr 08 05:09:53 hlnew-mc-armv6hf NetworkManager[621]: <info> [1523164193.8423] manager[0x13fd0b8]: monitoring kernel firmware directory '/lib/firmware'.
Apr 08 05:09:54 hlnew-mc-armv6hf NetworkManager[621]: <info> [1523164194.4005] hostname: hostname: using hostnamed
Apr 08 05:09:54 hlnew-mc-armv6hf NetworkManager[621]: <info> [1523164194.4028] hostname: hostname changed from (none) to "hlnew-mc-armv6hf"
Apr 08 05:09:54 hlnew-mc-armv6hf NetworkManager[621]: <info> [1523164194.4101] dns-mgr[0x13ecc18]: init: dns=default, rc-manager=resolvconf
Apr 08 05:09:54 hlnew-mc-armv6hf Netwo
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
Access point 'helioslite-tracker' created
Starting HTTP server on 192.168.42.1:80
Timeout reached. Exiting...
Stopping access point 'helioslite-tracker'...
Access point 'helioslite-tracker' stopped
Starting WiFi Connect
WiFi device: wlan0
[wifi_connect::network:WARN] No access points found - giving up...
Starting access point...
Access point 'helioslite-tracker' created
-- Logs begin at Thu 2019-02-07 05:02:42 UTC, end at Thu 2019-02-07 15:51:19 UTC. --
Feb 07 05:02:48 hltest-mc-1 systemd[1]: Started Hindsight monitoring server.
Feb 07 05:02:50 hltest-mc-1 hindsight[129]: 1549515770199951605 [info] hindsight starting
Feb 07 05:02:52 hltest-mc-1 hindsight[129]: 1549515772310011313 [info] input.proc_net_wireless starting
Feb 07 05:02:52 hltest-mc-1 hindsight[129]: 1549515772669716047 [info] input.checkpoint_manager starting
Feb 07 05:02:52 hltest-mc-1 hindsight[129]: 1549515772962899201 [info] input.statsdp_udp starting
Feb 07 05:02:53 hltest-mc-1 hindsight[129]: 1549515773284811173 [info] analysis.aggregate_metric-3s-parking adding to thread: 0
Feb 07 05:02:53 hltest-mc-1 hindsight[129]: 1549515773413648361 [info] analysis.forward_checkpoint_manager adding to thread: 0
Feb 07 05:02:53 hltest-mc-1 hindsight[129]: 1549515773632524983 [info] analysis.aggregate_metric-60m-park adding to thread: 0
Feb 07 05:02:53 hltest-mc-1 hindsight[129]: 1549515773876170448 [info] analysis.aggr