Skip to content

Instantly share code, notes, and snippets.

View urpylka's full-sized avatar

Artem Smirnov urpylka

View GitHub Profile
@giripriyadarshan
giripriyadarshan / Debounce.ino
Created February 8, 2021 18:44
Arduino_Button_Debounce_for_interrupts
const byte led_pin = LED_BUILTIN;
const byte interrupt_pin = 2;
volatile byte state = LOW;
unsigned long interrupt_time = millis();
const unsigned long delay_time = 50; // Delay for every push button may vary
void setup() {
pinMode(led_pin, OUTPUT);
pinMode(interrupt_pin, INPUT_PULLUP);
@mrts
mrts / nexus-maven-repo-delete-artifacts.py
Last active December 25, 2020 09:37
Nexus 3 Maven repo artifact deletion with Python
# See API docs at http://nexus-url/#admin/system/api
import requests
USERNAME = 'user'
PASSWORD = 'password'
NEXUS_BASE_URL = 'http://nexus-url/service/rest/beta'
REPOSITORY = 'some-project-snapshots'
GROUP_FILTER = 'com.some.group'
@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
@nunomcruz
nunomcruz / checkpoint.sh
Last active April 24, 2020 08:41 — forked from phoob/checkpoint.sh
The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just from time to time.
#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
#
# Usage: ./checkpoint.sh
#
# The script checks if Enpoint Security VPN is running. If it is, then it shuts it down, if it is not, it fires it up.
# Or, make an Automator action and paste the script. You will need sudo power.
@tatesuke
tatesuke / GpsIdf.py
Created October 23, 2018 00:48
nmeaと突き合わせてjpg画像にexifタグを付加する
import piexif
import re
import datetime
class GpsIdf(object):
def __init__(self, gpsIdf):
self.gpsIdf = gpsIdf
@mikehardy
mikehardy / libvirt-forguests.sh
Created September 4, 2018 12:42
A script to manage suspend/resume/stop for all libvirt guests
#!/bin/sh
#
# Inspired by https://github.com/kumina/shutdown-kvm-guests/blob/master/shutdown-kvm-guests.sh
#
# Configure timeout (in seconds).
TIMEOUT=300
VIRSH=/usr/bin/virsh
# List running domains.
list_domains_by_state() {
@Ryanb58
Ryanb58 / install.md
Last active April 6, 2025 11:47
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@alexishida
alexishida / nginx-config-auth-cert-ssl.md
Last active November 26, 2024 15:48
Tutorial to configure Nginx client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Original: https://gist.github.com/mtigas/952344

Convert SSL certificate from CRT format to PEM

openssl x509 -in server.crt -out server.der -outform DER
openssl x509 -in server.der -inform DER -out server.pem -outform PEM
@remisarrailh
remisarrailh / tc358743.sh
Last active March 25, 2022 13:40
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
@monkeym4ster
monkeym4ster / docker.sh
Created July 6, 2017 06:04
Docker: save/load container using tgz file (tar.gz)
#for not running docker, use save:
docker save <dockernameortag> | gzip > mycontainer.tgz
#for running or paused docker, use export:
docker export <dockernameortag> | gzip > mycontainer.tgz
#load
gunzip -c mycontainer.tgz | docker load