This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def change_enum_items(type, parameter_name, new_items, default=None): | |
""" | |
Take an enum-typed parameter in the given autogenerated cfg type and reset its possible values to new_items. | |
You can then start a dynamic_reconfigure server which advertises the changed enum domain. | |
To achieve this, you need to call this function before creating the server. | |
:param type type: One of the autogenerated config types (package.cfg.*Config). | |
:param basestring parameter_name: Name of the enum parameter to change. | |
:param new_items: The items that will form the new domain of the enum. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Author: Martin Pecka ( martin.pecka@cvut.cz ) | |
// License: BSD | |
#ifndef DEM_GENERATION_SLOW_TOPIC_DIAG_UPDATE_H | |
#define DEM_GENERATION_SLOW_TOPIC_DIAG_UPDATE_H | |
#define private public | |
#include <diagnostic_updater/update_functions.h> | |
#undef private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -Nru @161/etc/config/resolver @/etc/config/resolver | |
--- @161/etc/config/resolver 2017-10-01 21:01:14.375423242 +0200 | |
+++ @/etc/config/resolver 2017-11-02 01:13:47.862130135 +0100 | |
@@ -21,6 +21,7 @@ | |
option log_stderr '1' | |
option log_stdout '1' | |
option forks '1' | |
+ option include_config '/etc/kresd/config.conf' | |
config resolver 'unbound' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import encodings | |
import pkgutil | |
bytes_to_decode = b"\xc4\x9b" | |
codecs = [] | |
for importer, modname, ispkg in pkgutil.iter_modules(encodings.__path__): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh /etc/rc.common | |
# This is a procd initscript, so put it in /etc/init.d/ | |
START=79 # Important: this number must be lower than the START number in /etc/init.d/mountd !!! | |
USE_PROCD=1 | |
PROGNAME="/usr/bin/ntfs-3g" | |
# Fill these values as desired |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import numpy as np | |
class PbModelExecutor: | |
def __init__(self, model_path, input_shape, input_name='input', output_name='output:0'): | |
self.session = tf.Session() | |
self.input = tf.placeholder(tf.float32, shape=input_shape) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################# | |
# START: THUMBNAIL HANDLING # | |
############################# | |
# Since handling thumbnails in Nette is painfully slow (loading the whole framework | |
# just to find out that the thumbnail has already existed), there is a workaround | |
# that finds all the generated thumbnails using mod_rewrite and only redirects to the | |
# script if generating a thumbnail is really needed. | |
# Even for generating thumbs the standard Nette usage is slow, so there is another workaround. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update_deb_from_github() { | |
repo=$1 # will use github.com/repos/${repo}/releases, so set to e.g. BoostIO/boostnote | |
pkg=$2 # name of the Deiban package e.g. apt can use, so e.g. boostnote | |
deb_type=$3 # a substring of the deb file on github releases which uniquely tells the requested deb from other deb files on the latest releases page | |
version_installed=$(LANG=C aptitude show boostnote | grep Version | grep -o '[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}') | |
download_link=$(curl -s https://api.github.com/repos/${repo}/releases/latest | jq -r ".assets[] | .browser_download_url" | grep "${deb_type}.*\.deb") | |
version_upstream=$(echo ${download_link} | grep -o '[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}' | head -n1) | |
if [[ "${version_installed}" != "${version_upstream}" ]]; then | |
wget -O "/tmp/${pkg}.deb" "${download_link}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Based on the script from https://forum.odroid.com/viewtopic.php?t=29298 | |
# Changes to that script are released under BSD license (c) Martin Pecka, 2019. | |
# raidmgr_static can be downloaded here: https://wiki.odroid.com/_media/accessory/add-on_boards/xu4_cloudshell2/raidmgr_static_cloudshell2.zip | |
RAID_MANAGER="/usr/bin/raidmgr_static" | |
STATUS="$(echo -e "SR C0\nEX\n" | $RAID_MANAGER)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Subprocess > gazebo:make `cd /media/data/gazebo/build/gazebo; catkin build --get-env gazebo | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -` | |
[gazebo:make] /usr/bin/cmake -H/media/data/gazebo/src/gazebo -B/media/data/gazebo/build/gazebo --check-build-system CMakeFiles/Makefile.cmake 0 | |
[gazebo:make] /usr/bin/cmake -E cmake_progress_start /media/data/gazebo/build/gazebo/CMakeFiles /media/data/gazebo/build/gazebo/CMakeFiles/progress.marks | |
[gazebo:make] /usr/bin/make -f CMakeFiles/Makefile2 all | |
[gazebo:make] make[1]: Vstupuje se do adresáře „/media/data/gazebo/build/gazebo“ | |
[gazebo:make] /usr/bin/make -f deps/opende/ou/CMakeFiles/gazebo_opende_ou.dir/build.make deps/opende/ou/CMakeFiles/gazebo_opende_ou.dir/depend | |
[gazebo:make] /us |
OlderNewer