Skip to content

Instantly share code, notes, and snippets.

@cwyark
cwyark / LICENSE
Created March 19, 2020 07:14 — forked from yamnikov-oleg/LICENSE
Shared (interprocess) mutexes on Linux
MIT License
Copyright (c) 2018 Oleg Yamnikov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@cwyark
cwyark / Jenkins Branch Parameter
Created March 3, 2020 13:22 — forked from jseed/Jenkins Branch Parameter
Groovy script for dynamically listing git repository branches as a jenkins build parameter using the extended choice parameter plugin
/*
* Variable bindings:
* user - credentials plugin user
* url - git repository url (.git)
*/
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials;
import jenkins.model.Jenkins
@cwyark
cwyark / delete_artifacts.groovy
Created February 26, 2020 13:02 — forked from perja12/delete_artifacts.groovy
Delete artifacts from Jenkins with Groovy script.
// Delete old artifacts that fills up the disk on the master node.
// Run this from the Jenkins console (Manage Jenkins, Manage Nodes, master, Script Console)
def project = Jenkins.get().getItemByFullName('your-project-id')
def jobs = project.getAllJobs()
def total_size = 0
jobs.each{ job ->
def builds = job.getBuilds()
@cwyark
cwyark / Vagrantfile
Created August 21, 2019 01:33
vagrant for ubuntu 16.04
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.hostname = "ros1-dev"
# config.vm.box_check_update = false
@cwyark
cwyark / Vagrantfile
Last active August 21, 2019 01:33
vagrant for ubuntu 18.04
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.hostname = "old-town-road"
# config.vm.box_check_update = false
repositories:
ros2/rmw_cyclonedds:
type: git
url: https://github.com/atolab/rmw_cyclonedds.git
version: master
repositories:
ament/ament_cmake:
type: git
url: https://github.com/ament/ament_cmake.git
version: master
ament/ament_index:
type: git
url: https://github.com/ament/ament_index.git
version: master
ament/ament_lint:
@cwyark
cwyark / ssd1306.py
Last active October 28, 2017 14:43
# MicroPython SSD1306 OLED driver, I2C and SPI interfaces
from micropython import const
import framebuf
# register definitions
SET_CONTRAST = const(0x81)
SET_ENTIRE_ON = const(0xa4)
SET_NORM_INV = const(0xa6)
@cwyark
cwyark / utils.py
Created October 17, 2017 06:01
utils.py for ameba
@micropython.asm_thumb
def fast_copy(r0, r1, r2):
movw(r3, 0)
label(loop)
ldr(r4, [r1, 0])
str(r4, [r0, 0])
add(r0, 1)
add(r1, 1)
add(r3, r3, 1)
cmp(r3, r2)
@cwyark
cwyark / flashbdev.py
Created October 17, 2017 06:00
flashbdev.py for Ameba
try:
import ameba
import time
import uio as io
import array
import uctypes
from utils import fast_copy
except:
raise ImportError("ameba module import failed")