Skip to content

Instantly share code, notes, and snippets.

View asmodehn's full-sized avatar
💭
bootstrapping automaintenance

AlexV asmodehn

💭
bootstrapping automaintenance
View GitHub Profile
@asmodehn
asmodehn / gaaVLL.markdown
Created September 13, 2015 09:30
gaaVLL
@asmodehn
asmodehn / talkerunicode.py
Created December 15, 2015 01:20
talker with unicode name breaking rospy
#! /usr/bin/env python
import os
import sys
import pprint
import subprocess
command = ['bash', '-c', 'source /opt/ros/indigo/setup.bash && env']
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
@asmodehn
asmodehn / readme.txt
Created August 25, 2016 05:14
Rostful + rosbridge from @dhirajdhule
I have done little hack thing. There could be places where it can be cleaned up a bit.
I Imported 'rosbridge_websocket' tornado app into rostfuls server.py.
* ( make sure that rosbridge websocket python app is on your pythonpath. If you installed rosbridge using apt-get then make sure that
echo $PYTHONPATH shows /opt/ros/indigo/lib/python2.7/dist-packages)
And added rosapi(from rosbridge launchfile) node to the rostfuls launch file.
To launch I'm just launching above edited rostful.launch. The server.py will start rosbridge app.
So any configurations that we do using rosbridge launch file wont work. Port can be selected from rostful launcher.
All the socket urls are placed inside /websocket . So if you try to test websocket thing then do here localhost:port/websocket/
and rest urls are served from /
@asmodehn
asmodehn / bloom-release_2016-11-22.log
Created November 23, 2016 03:07
bloom log for faulty test_depends
[bloom] bloom version 0.5.23
[info] ROS Distro index file associate with commit '63fd877f8fa78317b878f5e3c407f8e9bb22ba57'
[info] New ROS Distro index url: 'https://raw.githubusercontent.com/ros/rosdistro/63fd877f8fa78317b878f5e3c407f8e9bb22ba57/index.yaml'
[error] Specified repository 'pyros' is not in the distribution file located at 'https://raw.githubusercontent.com/ros/rosdistro/63fd877f8fa78317b878f5e3c407f8e9bb22ba57/kinetic/distribution.yaml'
[info] Did you mean one of these: 'ros', 'pyros_test', 'p2os'?
[info] Could not determine release repository url for repository 'pyros' of distro 'kinetic'
[info] You can continue the release process by manually specifying the location of the RELEASE repository.
[info] To be clear this is the url of the RELEASE repository not the upstream repository.
[info] For release repositories on GitHub, you should provide the `https://` url which should end in `.git`.
[info] Here is the url for a typical release repository on GitHub: https://github.com/ros-gbp/rviz-release.
@asmodehn
asmodehn / pyftpd_gevent.py
Last active December 1, 2016 08:07
pyftpd with gevent simpler than concurrent.futures or direct threading...
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import time
import signal
@asmodehn
asmodehn / test_canon
Last active March 17, 2017 10:55
rostime canon fix demo
from __future__ import division
import pytest
import functools
import hypothesis
import hypothesis.strategies as st
def new_canon(secs, nsecs):
# canonical form: nsecs is always positive, nsecs < 1 second
@asmodehn
asmodehn / FileFinder2.py
Last active June 27, 2017 10:54
PEP 420 for python 2.7
from __future__ import absolute_import, division, print_function
# We need to be extra careful with python versions
# Ref : https://docs.python.org/dev/library/importlib.html#importlib.import_module
# Ref : http://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path
import os
import sys
import logging
import contextlib
import importlib
@asmodehn
asmodehn / backoff.cmd
Last active June 24, 2018 19:23
Windows Batch backoff delay
@echo off
setlocal enabledelayedexpansion
set /a backoff = 1
set /a backoff_max = 1
for /L %%a in (1,1,100) do (
set /a backoff_max= !backoff_max! *2
echo !backoff_max!
set /a backoff= %random% %% !backoff_max!
@asmodehn
asmodehn / click_repl_cmd.py
Last active June 4, 2019 12:32
Mixing cli and repl user interface in a sensible way, with extensive unit testing.
import hypothesis
from pydantic import BaseModel, ValidationError, validate_model
import unittest
class Answer(BaseModel):
# Data model of user interface (might be different than data model of Exchange interface)
data: int
```elixir
defmodule AlgaeTest do
@moduledoc """
From https://wiki.haskell.org/State_Monad
Example use of State monad
Passes a string of dictionary {a,b,c}
Game is to produce a number from the string.
By default the game is off, a C toggles the
game on and off. A 'a' gives +1 and a b gives -1.