Skip to content

Instantly share code, notes, and snippets.

View bibendi's full-sized avatar

Misha Merkushin bibendi

View GitHub Profile
@palkan
palkan / Dockefile
Last active May 14, 2020 06:09
hybrid dockerfile
ARG RUBY_VERSION
# === Base image ===
FROM ruby:${RUBY_VERSION}-slim-buster as base
ARG NODE_MAJOR
ARG POSTGRES_VERSION
ARG BUNDLER_VERSION
ARG YARN_VERSION
# Common dependencies
@norman
norman / earthdistance.rb
Last active November 3, 2022 21:20
Geographic Searches With Postgres's Earthdistance and Cube Extensions
#!/usr/bin/env ruby
=begin
= Geographic Searches With Postgres's Earthdistance and Cube Extensions
This program shows how to easily create a Postgres database that uses the Cube
and Earthdistance extensions to perform fast queries on geographic data.
Briefly, the problem this code solves is "show me all places within 50
kilometers of New York City."
@senko
senko / onchange.sh
Last active July 14, 2023 07:54
OnChange - Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
@roberto
roberto / _flash_messages.html.erb
Created August 13, 2012 22:47
Rails flash messages using Twitter Bootstrap
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
@furdarius
furdarius / rkn_unblock.md
Last active January 10, 2024 19:08
Настройка обхода РКН на роутере
@MarkBennett
MarkBennett / installing-ruby-2.5.1-on-m1.md
Last active March 23, 2024 10:21
Installing Ruby 2.5 on Mac M1
@ogrrd
ogrrd / dnsmasq OS X.md
Last active April 16, 2024 20:28
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@seebk
seebk / README.md
Last active April 24, 2024 07:17
Extract embedded certificates and keys from OpenVPN config files

This python script is intended to automate the extraction of embedded certificates and keys from OpenVPN config files.

Unfortunately the GNOME Network-Manager is not able to automatically import OpenVPN config files with embedded certificates and keys. A workaround is to manually extract these and store them in separate files (e.g. see https://naveensnayak.wordpress.com/2013/03/04/ubuntu-openvpn-with-ovpn-file/).

Instructions:

  • Make shure all the required packages are installed. For example on Ubuntu and Debian run:

    $ sudo apt-get install python3 network-manager-openvpn-gnome