Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Nedim Hadzimahmutovic neidiom

🌴
On vacation
Block or report user

Report or block neidiom

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 Admin Coupon
ActiveAdmin.register Coupon do
menu label: proc { current_user.admin? ? 'Coupons' : 'My coupons' }
actions :all, except: [:destroy]
permit_params :name, :coupon_type, :picture, :note, :for_deleting, :business_owner_id
# ===== scopes =====
scope_to :current_user, if: proc { current_user.business_owner? }
scope :all, default: true do |coupons|
coupons
end
View ruby_sinatra_webhook.rb
require 'sinatra'
set :bind, '0.0.0.0'
set :port, 8080
post '/event' do
status 204 #successful request with no body content
request.body.rewind
@neidiom
neidiom / cleanup.rb
Created Apr 16, 2018 — forked from gregohardy/cleanup.rb
Azure Account Managment
View cleanup.rb
require 'azure_mgmt_compute'
require 'azure_mgmt_resources'
require 'azure_mgmt_storage'
require 'azure'
include Azure
include Azure::ARM::Compute
include Azure::ARM::Compute::Models
include Azure::ARM::Resources
View 01-azure-cli.sh
# Install Azure CLI
brew update
brew install azure-cli
# Authenticate cli client
az login
# Register providers
az provider register -n Microsoft.ContainerService
az provider register -n Microsoft.Compute
@neidiom
neidiom / create-acs-kubernetes.md
Created Apr 5, 2018 — forked from jcorioland/create-acs-kubernetes.md
Create an Azure Container Service Kubernetes Cluster with Azure CLI
View create-acs-kubernetes.md

Create an Azure Container Service Kubernetes Cluster with Azure CLI

Login (interactive) to your Azure subscription using Azure CLI

az login

Create a resource group

View chef_create_sites_dirs.rb
www_dir = '/var/www'
domain = 'nomimono.domain.com'
sajts = ['sajt99','sajt98','sajt97']
sajts.each do |sajt|
directory www_dir do
owner 'www-data'
group 'www-data'
mode '0755'
action :create
@neidiom
neidiom / change_dns_plesk.sh
Last active Feb 19, 2018 — forked from agarzon/googleize.sh
Change a domain's ip address from old one to new one via Plesk cli dns util
View change_dns_plesk.sh
#!/bin/bash
if [ -z "$1" ]
then
echo "Please provide a domain name as argument"
exit 1
fi
if [ -z "$2" ]
then
View capistrano-3-basic-set-up
#create a public key base on the link bellow
https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2
#the local public key has to be added on bitbucket.com and the remote server
https://help.github.com/articles/generating-ssh-keys/
#if you added a pass phrase to the key you need to add your public key to the remote server
http://capistranorb.com/documentation/getting-started/authentication-and-authorisation/#toc_3
#set up the public ssh to your account
@neidiom
neidiom / site.pp
Created Oct 16, 2016 — forked from seanhagen/site.pp
Simple PHP Puppet setup
View site.pp
group { 'puppet':
ensure => present,
}
class initial_setup {
exec { 'apt-get update':
command => '/usr/bin/apt-get update',
}
package { "essential-packages":
You can’t perform that action at this time.