Skip to content

Instantly share code, notes, and snippets.

View bbl's full-sized avatar

Bogdan bbl

View GitHub Profile
@stefanbuck
stefanbuck / upload-github-release-asset.sh
Last active August 27, 2024 08:46
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
@maxivak
maxivak / readme.md
Last active October 19, 2017 08:37
Backups

Backups

Backup strategy

Storage

Store backups

  • Local disk
  • Remote storage - copy by scp
  • Remote storage - sync using Rsync

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@negz
negz / kubedump.sh
Last active July 11, 2024 10:57
Dump Kubernetes cluster resources as YAML
#!/usr/bin/env bash
set -e
CONTEXT="$1"
if [[ -z ${CONTEXT} ]]; then
echo "Usage: $0 KUBE-CONTEXT"
exit 1
fi
@maxivak
maxivak / ubuntu16_rename_eth.md
Last active October 17, 2017 08:26
Rename interface to eth0 on Ubuntu 16.04

Fix interface to 'eth0'

for ubuntu 16.04:

sudo sed -i "s/GRUB_CMDLINE_LINUX_DEFAULT=\"\(.*\)\"/GRUB_CMDLINE_LINUX_DEFAULT=\"\1 net.ifnames=0\"/" /etc/default/grub 
sudo update-grub2
  • reboot
@maxivak
maxivak / readme.md
Last active April 22, 2025 03:02
Restore repo from Gitlab bundle file

Gitlab exports repositories to tar archive which contains .bundle files.

We have repo.bundle file and we want to restore files from it.

  • create bare repo from bundle file
git clone --mirror myrepo.bundle my.git
@dmytrotkk
dmytrotkk / RunAProxyOnAmazonEC2VPC.md
Created August 28, 2017 20:15 — forked from webinista/RunAProxyOnAmazonEC2VPC.md
Create a proxy server on an Amazon EC2 (VPC) instance

This will create a proxy server in whatever your availability zone your VPC is in. For me, that's us-east-1b. For you, that may be something different. Steps 10+ should more or less work regardless of your provider since those steps cover the setup and configuration of TinyProxy.

  1. Click the Launch Instance button.
  2. Choose Ubuntu Server 14.04 LTS (HVM), SSD Volume Type. This isn't strictly necessary. If you choose another OS, check its documentation for how to install new packages.
  3. On the Choose an Instance Type screen, select t2.micro. It's Free Tier eligible.
  4. Click the Next: ... buttons until you reach the Configure Security Group screen.
    • You may wish to reduce the amount of storage on the Add Storage screen. This is optional.
    • You may wish to add a tag on the Tag Instance screen. This is also optional.
  5. On the Configure Security Group screen:
  • Select Create a new security group.
@dmytrotkk
dmytrotkk / rails_error_handling.md
Created November 8, 2017 14:42
Handling errors in Rails with ActiveSupport

Handling errors in Rails with ActiveSupport

Rails provide a clean way to rescue exceptions in a controller with a defined method.

Let's suppose that you have a class with method create that could raise ActiveRecord::RecordInvalid exception:

class ExampleController < ApplicationController

    def create
@dmytrotkk
dmytrotkk / rails_lib_services.md
Created November 14, 2017 13:07
Rails app: Organizing `lib` directory with static services

Organizing lib directory with static services

base_service.rb
    module Core end

    module Core::BaseService
 extend self
@EvGe22
EvGe22 / tensorflow_installation.md
Last active March 26, 2018 13:59
Installing Tensorflow 1.6 with CUDA 9.0 with cudnn 7.0 on Ubuntu 16.04 x86_64 | Anaconda