Skip to content

Instantly share code, notes, and snippets.

View romantomjak's full-sized avatar

Roman Tomjak romantomjak

View GitHub Profile
#!/usr/bin/env python3
#
# This script sets the service name (i.e. drive group) for the given OSDs
# on the host on which it is executed.
#
# For example, to set service_name=osd.foo for OSDs 1, 2 and 3, you'd run:
#
# ./set-osd-service-name.py osd.foo 1 2 3
#
# For each OSD specified, it will set service_name in that OSD's unit.meta
@romantomjak
romantomjak / ANSI.md
Created October 5, 2021 21:03 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
@romantomjak
romantomjak / ffmpeg.md
Created April 28, 2021 18:10 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
@romantomjak
romantomjak / attributes.rb
Created January 14, 2020 22:07 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'

Keybase proof

I hereby claim:

  • I am romantomjak on github.
  • I am romantomjak (https://keybase.io/romantomjak) on keybase.
  • I have a public key ASC56kTxpnBqfuyYjh5xUbdEmI91P4Ihf_KNgRKC407UaAo

To claim this, I am signing this object:

@romantomjak
romantomjak / GIF-Screencast-OSX.md
Created April 18, 2018 22:50 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

/*
* Apple - apple.com
* SF Pro Display used on apple.com as of iPhone 7 (RED) launch (March 21st 2017)
usage:
- font-family: "SF Pro Display","SF Pro Icons","Helvetica Neue","Helvetica","Arial",sans-serif;
- known issues:
- Access to Font at 'http://www.apple.com/wss/fonts/SF-Pro-Display/v1/sf-pro-display_bold.woff' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 404.
index.html:1 Access to Font at 'http://www.apple.com/wss/fonts/SF-Pro-Display/v1/sf-pro-display_bold.ttf' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 404.
@romantomjak
romantomjak / ssh-autocompletion.md
Created January 15, 2018 20:34
Bash autocomplete for hosts defined in SSH config

Open or create ~/.bash_profile and add the following lines:

# ssh autocomplete
function _ssh_autocomplete() {
  COMPREPLY=()
  CURRENT_WORD="${COMP_WORDS[COMP_CWORD]}"
  if [[ ${CURRENT_WORD} == -* || ${COMP_CWORD} -eq 1 ]] ; then
    WORD_LIST=$(sed -nE "s/Host\ ([a-zA-Z0-9].+)/\1/p" ~/.ssh/config | tr '\n' ' ' )
 COMPREPLY=( $(compgen -W "$WORD_LIST" -- ${CURRENT_WORD}) )
@romantomjak
romantomjak / sublime3-alias.md
Created January 15, 2018 20:00
Bash alias for Sublime Text 3

Open or create ~/.bash_profile and add the following lines:

# Sublime
alias sublime='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl'

This will allow you to type sublime in the Terminal to open Sublime Text 3.

To open files with Sublime type the following command:

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets