Skip to content

Instantly share code, notes, and snippets.

View TemaSM's full-sized avatar

Tema Smirnov TemaSM

View GitHub Profile
@ruohki
ruohki / 1-rbac.yaml
Last active January 5, 2019 22:01 — forked from carloscarnero/1-rbac.yaml
Traefik on Rancher
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
rules:
- apiGroups:
- ""
resources:
- services
@dinomite
dinomite / lxc-backup.sh
Last active November 2, 2024 03:22
Simple script to backup LXC containers
#!/usr/bin/env bash
set -ex
BACKUP_DIR=/path/to/where/backups/should/live
HOSTS=($(lxc list -c n --format csv))
for HOST in "${HOSTS[@]}"
do
BACKUP_NAME=${HOST}-$(date +"%Y-%m-%d")
@superseb
superseb / cluster.yml
Last active February 7, 2024 09:08
Rancher 2.x custom cluster YAML quicker node failure detection (k8s 1.13)
services:
kubelet:
extra_args:
node-status-update-frequency: 4s
kube-api:
extra_args:
default-not-ready-toleration-seconds: 30
default-unreachable-toleration-seconds: 30
kube-controller:
extra_args:
@varyen
varyen / vue-noindex.js
Last active March 27, 2019 19:14
Vue component: prevent childs from indexing by crawlers
export default {
name: 'NoIndex',
functional: true,
props: {
tag: {
type: String,
default: 'div',
},
@superseb
superseb / nginx.conf
Last active January 5, 2019 21:41
Example nginx.conf for SSL termination for Rancher
upstream rancher {
server rancher-server:80;
}
map $http_upgrade $connection_upgrade {
default Upgrade;
'' close;
}
server {
@jlblancoc
jlblancoc / Install_gcc7_ubuntu_16.04.md
Last active June 23, 2025 14:31
Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial

Run the following in the terminal:

Install the gcc-7 packages:

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y

Set it up so the symbolic links gcc, g++ point to the newer version:

@ajdruff
ajdruff / fix-git-line-endings
Last active July 2, 2025 19:35
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@dohomi
dohomi / FileContainer.vue
Last active January 13, 2019 09:23
File container for vuetify and graph.cool. It lists files provided by a prop with link to the public url. Below it shows a file upload field
<template>
<div>
<h3 class="subheading" v-if="!hideLabel">{{label}}</h3>
<v-list v-if="mediaList">
<v-list-tile v-for="(item,i) in mediaList" :key="i">
<v-list-tile-avatar @click="onItemClick(item.url)">
<img :src="item.url" :alt="item.name" :title="item.name"/>
</v-list-tile-avatar>
<v-list-tile-content @click="onItemClick(item.url)">
<v-list-tile-title>{{item.contentType}}</v-list-tile-title>
@zmts
zmts / info.md
Last active February 2, 2018 20:08
Vue.js Global SASS/SCSS variables

Используем SASS переменные в Vue.js (webpack template)

Есть несколько вариантов решить эту проблему

  • импортить файл с переменными в каждый компонент
  • использовать лоадер для Вебпака sass-resources-loader что бы переменные были доступны глабально

Ставим sass-resources-loader npm install sass-resources-loader --save-dev

Правим build/utils.js

@azimidev
azimidev / .htaccess
Last active August 19, 2023 05:53
The Best .htaccess with browser caching and gzip
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]