Skip to content

Instantly share code, notes, and snippets.

View tenhishadow's full-sized avatar
🙃
I may be slow to respond.

tenhi tenhishadow

🙃
I may be slow to respond.
  • - yes
  • Earth, Milky Way
View GitHub Profile
@tenhishadow
tenhishadow / update.rsc
Created December 22, 2021 10:39
mikrotik auto-update
/system scheduler
add interval=1d name=upgrade on-event=":log info \"UPGRADE: Checking SOFTWARE...\";\
\nsystem package update check-for-updates\
\n:if ([/system package update get installed-version] != [/system package update get latest-version]) do={\
\n :log info \"UPGRADE: updating SOFTWARE\";\
\n /system package update install;\
\n } else={\
\n :log info \"UPGRADE: no updates for SOFTWARE\"\
\n }\
\n:log info \"UPGRADE: Checking FIRMWARE...\";\
#!/bin/bash
set -eu
set -o pipefail
sleep 10m
# check mandatory variables
#[[ -n $BKP_APP_NAME ]]
#[[ -n $BKP_AWS_ACCESS_KEY_ID ]]
#[[ -n $BKP_AWS_SECRET_ACCESS_KEY ]]
#[[ -n $BKP_AWS_S3_BUCKET ]]

Keybase proof

I hereby claim:

  • I am tenhishadow on github.
  • I am tenhi (https://keybase.io/tenhi) on keybase.
  • I have a public key ASBLCukgJs0E93dvrOclHdVEIKWKBfCEyTa4rGTsdBcExQo

To claim this, I am signing this object:

irb
require 'match'
git_url = 'git@github.com:sdasdfsdfsds/secrets.git'
shallow_clone = false
ENV["MATCH_PASSWORD"] = '123'
branch = 'master'
storage = Match::Storage.for_mode('git', { git_url: git_url, shallow_clone: shallow_clone, git_branch: branch, clone_branch_directly: false})
storage.download
#!/bin/bash
## script for setting env vars in circleci for per-env deployment
##
# for current flow:
# fix/hotfix/feature/any -> integration -> staging -> master
##
# check if it's CircleCI to fail if not
[[ -z ${CI} ]] && echo "var is empty" && exit 1
@tenhishadow
tenhishadow / ansible_smart_mdadm.md
Last active June 14, 2019 16:23
automation for smart check and resync raid

Playbook for mdadm check and SMART check automation

- hosts: all
  gather_facts: yes
  become: yes
  vars:
    cron_start_hour: "3"
  tasks:
  - name: find all disks
    set_fact:
#!/bin/bash
# This scripts supplies one or more servers with a HTTP proxy dynamically.
# Requires Node.js with npm. After running the script, set the proxy vars
# on the remote server like this:
#
# export http_proxy=http://127.0.0.1:3128
# export https_proxy=http://127.0.0.1:3128
# export HTTP_PROXY=http://127.0.0.1:3128
# export HTTPS_PROXY=http://127.0.0.1:3128
@tenhishadow
tenhishadow / readme.md
Last active March 18, 2019 18:19
Mikrotik auto-upgrade
:log info "UPGRADE: Checking SOFTWARE...";
system package update check-for-updates
:if ([/system package update get installed-version] != [/system package update get latest-version]) do={
     :log info "UPGRADE: updating SOFTWARE";
     /system package update install;
     } else={
 :log info "UPGRADE: no updates for SOFTWARE"
- hosts: [test_network]
gather_facts: true
vars:
amazon_metadata: "http://169.254.169.254/latest/meta-data"
tasks:
- name: get mac addresses for all interfaces
uri:
url: "{{ amazon_metadata }}/network/interfaces/macs/"
return_content: 'yes'
@tenhishadow
tenhishadow / aws_s3_yum_repo.md
Last active February 6, 2019 11:13
AWS s3 yum repo and artifacts

GIST. create mirror for repo

Just a quick note for mirroring repos

RHEL/CentOS

RHEL Wiki Page