Skip to content

Instantly share code, notes, and snippets.

😎
¯\_(ツ)_/¯

Viktor Petersson vpetersson

😎
¯\_(ツ)_/¯
Block or report user

Report or block vpetersson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vpetersson
vpetersson / paho-connect-wott.py
Last active Jul 11, 2019
Example code for how to use Paho to connect to an MQTT server (such as Mosquitto).
View paho-connect-wott.py
#!/usr/bin/env python
import paho.mqtt.client as mqtt
def on_connect(client, obj, flags, rc):
print("rc: " + str(rc))
def on_message(client, obj, msg):
print(msg.topic + " " + str(msg.qos) + " " + str(msg.payload))
View ebpf-probe-clang7
root@arm-lab:/usr/src/falco-0.1.1dev/bpf# make
make -C /lib/modules/4.19.36-v7+/build M=$PWD
make[1]: Entering directory '/mnt/src/linux'
clang -I./arch/arm/include -I./arch/arm/include/generated -I./include -I./arch/arm/include/uapi -I./arch/arm/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h \
-D__KERNEL__ -mlittle-endian \
\
-D__KERNEL__ \
-D__BPF_TRACING__ \
-Wno-gnu-variable-sized-type-not-at-end \
-Wno-address-of-packed-member \
View ebpf-probe-clang8
root@arm-lab:/usr/src/falco-0.1.1dev/bpf# make
make -C /lib/modules/4.19.36-v7+/build M=$PWD
make[1]: Entering directory '/mnt/src/linux'
clang -I./arch/arm/include -I./arch/arm/include/generated -I./include -I./arch/arm/include/uapi -I./arch/arm/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h \
-D__KERNEL__ -mlittle-endian \
\
-D__KERNEL__ \
-D__BPF_TRACING__ \
-Wno-gnu-variable-sized-type-not-at-end \
-Wno-address-of-packed-member \
@vpetersson
vpetersson / clean-pkg.sh
Last active Jun 14, 2019
Helper script for cleaning up pkg files
View clean-pkg.sh
#!/bin/bash
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- sh-basic-offset: 4 -*-
set -euo pipefail
IFS=$'\n\t'
if [[ -z ${1} ]]; then
echo "Package name must be used as the argument."
@vpetersson
vpetersson / net-benchmark.md
Last active Mar 15, 2018
Raspberry Pi 3 Model B vs Raspberry Pi 3 Model B+ - network benchmark
View net-benchmark.md

Intro

  • Raspberry Pi Model B+: 192.168.202.28
  • Raspberry Pi Model B: 192.168.202.30

Raspberry Pi 3 Model B+

$ cat /sys/class/net/eth0/speed
1000
View screenly-ose-with-flick.py
#!/usr/bin/env python
import flicklib
import subprocess
from time import sleep
from copy import copy
@flicklib.move()
def move(x, y, z):
View cam1.yml
machinery:
image: kerberos/machinery
ports:
- "8889"
restart: always
volumes:
- /media/ext0/kerberosio/cam1/capture:/etc/opt/kerberosio/capture
- /media/ext0/kerberosio/cam1/logs:/etc/opt/kerberosio/logs
- /media/ext0/kerberosio/cam1/config:/etc/opt/kerberosio/config
View cam0.yml
machinery:
image: kerberos/machinery
ports:
- "8889"
restart: always
volumes:
- /media/ext0/kerberosio/cam0/capture:/etc/opt/kerberosio/capture
- /media/ext0/kerberosio/cam0/logs:/etc/opt/kerberosio/logs
- /media/ext0/kerberosio/cam0/config:/etc/opt/kerberosio/config
View screenly_sales_role_ad.md

We at Screenly are now looking to recruit our first consultant sales person. You will play a pivotal role in shaping the future of the company and structuring the sales organization.

Your responsibilities will include:

  • Find and qualify leads.
  • Manage our CRM.
  • Develop sales procedures.
  • Build relationships with new and existing customers.
  • Support various campaigns.
  • Work closely with our development and support team to provide feedback on the roadmap.
View gist:ff9b468240ab9b46f9be1ee79e4b749c
➜ upgrade kubectl get pods --namespace deis
NAME READY STATUS RESTARTS AGE
deis-builder-2199266375-rowzk 1/1 Running 1 51m
deis-controller-409370922-6sidv 1/1 Running 1 51m
deis-logger-9212198-kaxug 1/1 Running 4 51m
deis-logger-fluentd-7junn 1/1 Running 0 51m
deis-logger-fluentd-lxywg 1/1 Running 0 52m
deis-logger-redis-663064164-13kx9 1/1 Running 0 51m
deis-monitor-grafana-1178362579-eng6l 1/1 Running 0 51m
deis-monitor-influxdb-2729526471-6acfm 1/1 Running 0 51m
You can’t perform that action at this time.