Skip to content

Instantly share code, notes, and snippets.

View rshev's full-sized avatar

Roman Shevtsov rshev

View GitHub Profile
@sbingner
sbingner / startSSL.pl
Last active April 28, 2016 11:31
StartSSL Certificate Creation
#!/usr/bin/perl
# USAGE: startSSL.pl DOMAIN1 DOMAIN2 ...
#
# Requires:
# - client.crt and client.key in same directory as startSSL.pl
# - DOMAIN.csr in the current directory for each domain (in PEM format)
#
# Outputs: DOMAIN.crt to current directory in PEM format
#
#!/bin/sh -x ## or just ` curl -Ls http://git.io/vRozn | sh `.
## Downloads the Mac OS X 10.10 Recovery Partition update,
## Copy's over the 10.10 version of Disk Utility.app, then
## use git to apply a binary patch so it will run on 10.11+.
cd /tmp
rm -rf DU1010
mkdir DU1010
@spinxz
spinxz / ddclient.conf
Created June 20, 2015 15:52
ddclient configuration file with support for upnp compatible routers or modems (e.g. Huawei HiLink modem)
# Configuration file for ddclient
#
# /etc/ddclient.conf
#
# ddclient configuration for servers behind a UPNP compatible NAT router or modem
#
# 1. Install ddclient, ssl support and upnpclient : sudo apt-get install ddclient libio-socket-ssl-perl miniupnpc
# 2. Copy this configuration file to /etc/ddclient.conf
# 3. Adapt the configuration below (especially the <...> fields)
@cristianca
cristianca / Create color with gradient
Last active April 14, 2023 18:25
Create a gradient UIColor from an array of colors.
func colorWithGradient(frame: CGRect, colors: [UIColor]) -> UIColor {
// create the background layer that will hold the gradient
let backgroundGradientLayer = CAGradientLayer()
backgroundGradientLayer.frame = frame
// we create an array of CG colors from out UIColor array
let cgColors = colors.map({$0.CGColor})
backgroundGradientLayer.colors = cgColors
@eric-hu
eric-hu / Open iterm tab here
Last active October 30, 2025 15:55
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder. To use: (1) Open Automator (2) Create a new service (3) Change "Service receives selected" drop downs to "Files or folders" in "Finder" (4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer:
@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@smileart
smileart / README.md
Last active March 16, 2024 15:42 — forked from agnoster/README.md
My ZSH Theme — Agnoster Mod

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility