Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Evgeny erudinsky

🎯
Focusing
  • Amsterdam, NL
View GitHub Profile
View pv-hvm-latest-v2.sh
#!/bin/bash
VER="0.94.2";
SCRIPTTITLE="PV - HVM - version $VER";
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
NORMAL=$(tput sgr0)
# Configure logging
tmp="/tmp"
logfile="$tmp/$(basename $0).$$.log"
@erudinsky
erudinsky / basic
Last active Mar 20, 2019
kubectl Cheat Sheet
View basic
#toread: https://kubernetes.io/docs/reference/kubectl/cheatsheet/
## Prepare to work:
to show available contexts (saved in ~/.kube/config): kubectl config view
to use specific context: kubectl config use-context <your-context>
set default namespace for the context: kubectl config set-context <your-context> --namespace=<your-namespace>
Namespaces documentation: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
@erudinsky
erudinsky / lang
Created Jan 6, 2019
setlocale: LC_CTYPE: cannot change locale (UTF-8)
View lang
# to fix -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8) add /etc/environment
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@erudinsky
erudinsky / powershell
Created Feb 7, 2018
AWS EC2 advanced user script (Windows), Software install
View powershell
// you can read details about this snipper here: https://erudinsky.com/2017/09/27/aws-ec2-user-data-script-windows
<powershell>
# Variables
$temp = "c:\temp\"
$link = LINK_TO_BINARIES
$file = "cloudberry-backup.exe"
@erudinsky
erudinsky / AWS CLI
Last active Sep 29, 2017
AWS EC2 deploy with User Data (CloudBerry Backup for Linux pre-installed), full description of gotchas here - https://erudinsky.com/2017/09/21/ec2-user-data-script-example
View AWS CLI
aws ec2 run-instances --image-id AMI-ID --count 1 --instance-type INSTANCE_TYPE \
--key-name PEM_KEY --security-group-ids SG_ID \
--user-data file://ec2-linux-user-data.sh
@erudinsky
erudinsky / random_pictures.rb
Last active Sep 29, 2017
Download random pictures (cats) using Google Search API. Full tutorial - https://erudinsky.com/2017/08/05/how-to-download-random-pictures
View random_pictures.rb
require 'google_custom_search_api'
require "open-uri"
GOOGLE_API_KEY = ENV["GOOGLE_API_KEY"]
GOOGLE_SEARCH_CX = ENV["GOOGLE_SEARCH_CX"]
options = {}
options[:searchType] = "image"
results = GoogleCustomSearchApi.search("cats", options)
View Bash deploy with capistrano
#!/bin/bash
read -p "Commit message: " message
git add . && \
git add -u && \
git commit -m "$message" && \
git push origin master && \
cap production deploy
@erudinsky
erudinsky / README.md
Created Mar 27, 2017
FreeBSD & Minio
View README.md
  1. Install FreeBSD (follow : https://www.freebsd.org/doc/handbook/bsdinstall-start.html)
  2. Update ports tree: portsnap fetch extract update
  3. Try installing minio from ports i. cd /usr/ports/www/minio ii. make install clean If this works, ignore the rest, if not ...
  4. Download & install minio i. cd /tmp ii. pkg install curl
@erudinsky
erudinsky / gist:8e9d4e7e58b7d19ead087988163547f3
Created Mar 10, 2017
CloudBerry Backup for macOS, MBS [Remote install]
View gist:8e9d4e7e58b7d19ead087988163547f3
#!/bin/bash
read -p "Email" email
read -p "Password" password
ssh username@remote && \
wget <path_to_pkg> && \
sudo installer -pkg mac_CloudBerryLab_CloudBerryBackup_v1.11.0.51_20170110193619.pkg && \
sudo cbb -e $email -p $password
@erudinsky
erudinsky / iterm2.md
Created Jan 4, 2017
iterm2 cheatsheet
View iterm2.md

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [
You can’t perform that action at this time.