Skip to content

Instantly share code, notes, and snippets.

View urpylka's full-sized avatar

Artem Smirnov urpylka

View GitHub Profile
#!/bin/sh
autorefresh() {
test -d /etc/cups || return 1
echo puk
/usr/bin/inotifywait -m -e close_write,moved_to,create /etc/cups |
while read -r directory events filename; do
if [ "$filename" = "printers.conf" ]; then
rm -rf /services/AirPrint-*.service
/root/airprint-generate.py -d /services
@urpylka
urpylka / useradd.yml
Created December 27, 2021 10:48
Ansible playbook to add user
# This playbook adds users to target linux servers with 'adm' group
# Author: Artem Smirnov <urpylka@gmail.com>
# Using:
# 1. You need to add user certificates to './files' dir or to ./,
# where it has a next name format '<username>.pub'
# <username> will be used as username on servers.
# 2. ansible-playbook useradd.yml -i hosts -e 'target=<some_targets>'
@urpylka
urpylka / matrix-rotate.py
Last active January 21, 2021 10:51
My implementation of rotating a quad matrix (90° clockwise)
#! /usr/bin/env python3
def rotate(matrix):
"""
Do not return anything, modify matrix in-place instead.
"""
n = len(matrix)
x = 0
y = 0
@urpylka
urpylka / tc358743.sh
Created October 5, 2020 13:09 — forked from maditnerd/tc358743.sh
Compile raspberry pi 3 kernel to add drivers (tc358743)
###########################
# bcm2835_unicam drivers #
###########################
# DESCRIPTION: Install bcm2835_unicam/tc358743 drivers from 6by9 Linux fork
# This should also work for adv7282m ov5647 (https://github.com/6by9/linux/commit/28ac7b3a2651d4b35204938e6c9ec2e4ba54c34e)
#
# CAUTION
# * Do not start this script! Copy/Paste each command.
# * Compilation will take over 1h30.
# * Any errors can potentially break the entire system
@urpylka
urpylka / pgpool.conf
Last active July 2, 2020 08:30
Conf pgpool load balancer for Postgres-XL
# ----------------------------
# pgPool-II configuration file
# ----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# Whitespace may be used. Comments are introduced with "#" anywhere on a line.
# The complete list of parameter names and allowed values can be found in the
@urpylka
urpylka / exif.py
Created November 23, 2019 09:52 — forked from c060604/exif.py
User python and piexif to write some gps info into jpg pictures.
import os
import piexif
from fractions import Fraction
def to_deg(value, loc):
"""convert decimal coordinates into degrees, munutes and seconds tuple
Keyword arguments: value is float gps-value, loc is direction list ["S", "N"] or ["W", "E"]
return: tuple like (25, 13, 48.343 ,'N')
"""
@urpylka
urpylka / GpsIdf.py
Created November 23, 2019 09:52 — forked from tatesuke/GpsIdf.py
nmeaと突き合わせてjpg画像にexifタグを付加する
import piexif
import re
import datetime
class GpsIdf(object):
def __init__(self, gpsIdf):
self.gpsIdf = gpsIdf
@urpylka
urpylka / get-forks.py
Last active December 2, 2020 22:37
Script prepare bash-file for adding all forks
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:set ts=4 sw=4 et:
# Copyright 2019 Artem Smirnov
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@urpylka
urpylka / README.md
Last active August 27, 2019 21:01
Сборка .deb пакетов из ROS пакетов

Сборка debian пакетов из ROS пакетов

Заметка основана на материалах:

  1. https://answers.ros.org/question/173804/generate-deb-from-ros-package/ (кстати, здесь описывается проблема иногда возникающая make[1]: *** [override_dh_auto_configure] Error 2)
  2. https://gist.github.com/awesomebytes/196eab972a94dd8fcdd69adfe3bd1152 (исходная инструкция)
  3. https://github.com/ros-infrastructure/ros_buildfarm/blob/master/doc/custom_rosdistro.rst (статья про использование кастомных зависимостей rosdep в rosbuildfarm)
  4. https://answers.ros.org/question/230104/using-bloom-to-generate-binaries-for-multiple-packages/ (вопрос про билдинг нескольких пакетов)
  5. https://answers.ros.org/question/292024/how-to-use-bloom-generate-with-private-dependencies/ (статья про билдинг с кастомными зависимостями)
  6. https://answers.ros.org/question/280213/generate-deb-from-dependent-res-package-locally/#280235 (исходная статья для предыдущей)