Skip to content

Instantly share code, notes, and snippets.

Alexander Pyatkin aspyatkin

Block or report user

Report or block aspyatkin

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 .zshrc
autoload -U compinit colors vcs_info
colors
compinit
REPORTTIME=3
HISTFILE=~/.zhistory
HISTSIZE=5000
SAVEHIST=5000
setopt INC_APPEND_HISTORY
setopt EXTENDED_HISTORY
@Luzifer
Luzifer / README.md
Last active Aug 14, 2019
Running docker-compose as a systemd service
View README.md

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
@mosquito
mosquito / README.md
Last active Aug 12, 2019
Add doker-compose as a systemd unit
View README.md

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service

[Unit]
Description=%i service with docker compose
Requires=docker.service
After=docker.service
@scottstanfield
scottstanfield / .zshrc
Last active Jul 5, 2019
sensible, minimal .zshrc
View .zshrc
# Sensible, short .zshrc
# Gist page: git.io/vSBRk
# Raw file: curl -L git.io/sensible-zshrc
# GNU and BSD (macOS) ls flags aren't compatible
ls --version &>/dev/null
if [ $? -eq 0 ]; then
lsflags="--color --group-directories-first -F"
else
lsflags="-GF"
@magnetikonline
magnetikonline / README.md
Last active Aug 13, 2019
Install VirtualBox 6.0/5.2/5.1 guest additions on Ubuntu server guest.
View README.md
@evanwill
evanwill / gitBash_windows.md
Last active Aug 14, 2019
how to add more utilities to git bash for windows, wget, make
View gitBash_windows.md

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@mcornella
mcornella / build-zsh.txt
Last active Jun 6, 2016 — forked from thiagokokada/build-zsh.sh
This workaround is obsolete, build 14342 solves the issue. Please use that build instead. See https://github.com/Microsoft/BashOnWindows/issues/91#issuecomment-218379746
View build-zsh.txt
# THIS HAS BECOME OBSOLETE. IN BUILD 14342 THIS IS SOLVED, PLEASE USE THAT BUILD INSTEAD (OR MORE RECENT ONES)
# See https://github.com/Microsoft/BashOnWindows/issues/91#issuecomment-218379746
# Workaround to build ZSH on #BashOnUbuntuOnWindows.
# See https://github.com/Microsoft/BashOnWindows/issues/91#issuecomment-208077623
# RUN EACH LINE INDEPENDENTLY. THIS IS NOT AN AUTOMATIC BASH SCRIPT.
# Install dependencies
apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo checkinstall
@friskfly
friskfly / multiple-url-paths.lua
Created Feb 18, 2016 — forked from anonymous/multiple-url-paths.lua
Benchmark multiple url paths with wrk
View multiple-url-paths.lua
-- Resource: https://github.com/timotta/wrk-scripts/blob/master/multiplepaths.lua
-- Initialize the pseudo random number generator
-- Resource: http://lua-users.org/wiki/MathLibraryTutorial
math.randomseed(os.time())
math.random(); math.random(); math.random()
-- Shuffle array
-- Returns a randomly shuffled array
function shuffle(paths)
@aspyatkin
aspyatkin / generate_csr.rb
Last active Aug 12, 2019
Generate X509 CSR with SAN extension in Ruby
View generate_csr.rb
require 'openssl'
# Generate X509 CSR (certificate signing request) with SAN (Subject Alternative Name) extension and sign it with the RSA key
def generate_csr(common_name, organization, country, state_name, locality, domain_list)
# create signing key
signing_key = OpenSSL::PKey::RSA.new 2048
# create certificate subject
subject = OpenSSL::X509::Name.new [
['CN', common_name],
@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active Aug 9, 2019
Arrayzing - The JavaScript array cheatsheet
View LICENSE
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
You can’t perform that action at this time.