Skip to content

Instantly share code, notes, and snippets.

Bogdan metallica127

Block or report user

Report or block metallica127

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
@maxivak
maxivak / date_time_picker_rails.md
Last active Apr 4, 2019
Datetime picker in Rails app
View date_time_picker_rails.md

Date time picker in Rails app

There are several options to make Date input in Rails application:

  • Default inputs from simple_form
  • HTML 5 date input
  • Text input with jQuery UI Date time picker
  • Other plugins for date input with Bootstrap 4
@EvGe22
EvGe22 / tensorflow_installation.md
Last active Mar 26, 2018
Installing Tensorflow 1.6 with CUDA 9.0 with cudnn 7.0 on Ubuntu 16.04 x86_64 | Anaconda
View tensorflow_installation.md
@dmitry-tk
dmitry-tk / rails_lib_services.md
Created Nov 14, 2017
Rails app: Organizing `lib` directory with static services
View rails_lib_services.md

Organizing lib directory with static services

base_service.rb
    module Core end

    module Core::BaseService
      extend self
@dmitry-tk
dmitry-tk / rails_error_handling.md
Created Nov 8, 2017
Handling errors in Rails with ActiveSupport
View rails_error_handling.md

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
@dmitry-tk
dmitry-tk / RunAProxyOnAmazonEC2VPC.md
Created Aug 28, 2017 — forked from webinista/RunAProxyOnAmazonEC2VPC.md
Create a proxy server on an Amazon EC2 (VPC) instance
View RunAProxyOnAmazonEC2VPC.md

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.
@maxivak
maxivak / readme.md
Last active Dec 28, 2018
Restore repo from Gitlab bundle file
View readme.md

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
@maxivak
maxivak / ubuntu16_rename_eth.md
Last active Oct 17, 2017
Rename interface to eth0 on Ubuntu 16.04
View ubuntu16_rename_eth.md

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
View readme.md

Backups

Backup strategy

Storage

Store backups

  • Local disk
  • Remote storage - copy by scp
  • Remote storage - sync using Rsync
@dbathgate
dbathgate / vpc-ip-address-to-container-amazon.sh
Last active Jul 23, 2019
Assign VPC addresses to Docker containers associated as secondary IP addresses to an ENI in AWS
View vpc-ip-address-to-container-amazon.sh
# Description: How to assign VPC addresses to Docker containers associated as secondary IP addresses to an ENI in AWS
# Operating System: Amazon Linux AMI 2016.09.1 (HVM)
# Prerequisites:
# - Assign N number of secondary IP addresses to network interface on Docker host
# - Each new container requires additional assignment of secondary IP addresses
# - Containers can be launched with --net=none to avoid adding a Docker networked NIC (docker run --net=none -d imageId)
# Credit to https://github.com/jpetazzo/pipework for steps on linking IP address
################# Setup Bridge of eth0 ######################
yum install bridge-utils -y
@maxivak
maxivak / __readme.md
Last active Aug 4, 2018
Provisioning Remote server accessible by SSH with Chef and knife-zero
View __readme.md

Provisioning remote server accessible by SSH with Chef and knife-zero.

We have a server(node) accessible by SSH. We want to provision using Chef recipes stored on our local chef repo.

We will use gem knife-zero.

Find an example of Chef repo here.

knife-zero

You can’t perform that action at this time.