Skip to content

Instantly share code, notes, and snippets.

Vlad Didenko didenko

Block or report user

Report or block didenko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fusr.func
function fusr() {
[ -f "${1}" ] || return 1;
find /proc -lname "${1}" 2>/dev/null | cut -d/ -f3 | sort -nu | xargs ps -fp;
}
@didenko
didenko / timein.sh
Last active Nov 11, 2018
Cross-timezone calculations
View timein.sh
function timein ()
{
[ "${#}" -lt 3 ] && {
echo 'timein <dest loc> [when] <src loc> [is] <src time>' 1>&2
echo -e 'e.g.:\ntimein America/Chicago when Europe/Berlin is tomorrow 14:30' 1>&2
echo -e 'or:\ntimein Asia/Ho_Chi_Minh America/New_York 2019/01/02 08:00' 1>&2
return 1
}
dest=${1}; shift
@didenko
didenko / yubikey_install.sh
Last active Jan 21, 2018
Yubikey on openSUSE
View yubikey_install.sh
sudo zypper install u2f-server u2f-host pam_u2f ykclient
View http_error.go
package main
import (
"fmt"
"log"
"github.com/pkg/errors"
)
type HTTPError struct {
View gist:9f9eed12fca838c02736d2971b3b7d6a
package main
import (
"fmt"
"log"
"github.com/pkg/errors"
)
type HTTPError struct {
View CLA.md

Preamble

This Contributor License Agreement is a derivative from the GitHub, Inc's version 298f3afd updated August 9, 2017, copied and modified under the individually granted CC-BY-4.0 terms on November 14, 2017.

Contributor License Agreement

The following terms are used throughout this agreement:

  • You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
View DCO_1_1_license_ref.md

The license file referred to in this Developer Certificate of Origin is the LICENSE.md file located in the root directory of this project's repository.

Developer Certificate of Origin

Version 1.1

Copyright © 2004, 2006 The Linux Foundation and its contributors.

1 Letterman Drive

@didenko
didenko / syncthing.sh
Created Aug 28, 2017
Enable Syncthing automatic startup on login in macOS
View syncthing.sh
#!/bin/bash
#----------------------------------------------------
#
# Copyright (C) 2017 Vlad Didenko
#
# This Source Code Form is subject to the terms
# of the Mozilla Public License, v. 2.0. If a copy
# of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/
@didenko
didenko / mermaid_sd.html
Last active Apr 28, 2017
mermaid diagramming library template
View mermaid_sd.html
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.rawgit.com/knsv/mermaid/7.0.0/dist/mermaid.min.js"></script>
<script>mermaid.initialize({ startOnLoad: true });</script>
<style>
@import url('https://fonts.googleapis.com/css?family=Dosis');
body { width: 95%; margin: 1em auto; text-align: center; }
.note { width: 180px; }
.noteText { font-family: 'Dosis', sans-serif; }
@didenko
didenko / Powershell confirmation wrapper
Last active Apr 1, 2017
Confirmation PowerShell script
View Powershell confirmation wrapper
powershell.exe -nologo -command "&" C:\bin\confirm.ps1 shutdown /r /t 15 /f /d p:0:0
You can’t perform that action at this time.