Skip to content

Instantly share code, notes, and snippets.

View thehar's full-sized avatar

Harley Alaniz thehar

View GitHub Profile
@thehar
thehar / docker_debian.md
Created November 9, 2023 13:40 — forked from bndw/docker_debian.md
How to install an older version of Docker on Debian
kubectl get services # List all services
kubectl get pods # List all pods
kubectl get nodes -w # Watch nodes continuously
kubectl version # Get version information
kubectl cluster-info # Get cluster information
kubectl config view # Get the configuration
kubectl describe node <node> # Output information about a node
kubectl get pods # List the current pods
kubectl describe pod <name> # Describe pod <name>
kubectl get rc # List the replication controllers
@thehar
thehar / chefdk-rvm.sh
Last active September 29, 2018 01:26 — forked from asnodgrass/chefdk-rvm.sh
Making ChefDK work with RVM
brew cask install chef/chef/chefdk
CHEFDK="/opt/chefdk/embedded"
CHEFDK_USER="$HOME/.chefdk/gem/ruby/2.5.0"
RVM_GEMS="$HOME/.rvm/gems"
RVM_RUBIES="$HOME/.rvm/rubies"
RUBY_NAME="ext-chefdk-ruby"
mkdir -p $RVM_RUBIES/$RUBY_NAME
ln -s $CHEFDK/bin $RVM_RUBIES/$RUBY_NAME
@thehar
thehar / codeship-ami-builder.py
Created December 5, 2017 18:10 — forked from rosstimson/codeship-ami-builder.py
Scheduled Lambda that uses the Codeship API in order to trigger a build.
import boto3
import http.client
import json
import logging
import os
from base64 import b64decode
conn = http.client.HTTPSConnection("api.codeship.com")
payload = "{}"
@thehar
thehar / tmux-cheatsheet.markdown
Created August 7, 2017 23:23 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@thehar
thehar / README.md
Created August 9, 2016 17:34 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@thehar
thehar / remote_pairing_setup.md
Created December 22, 2015 18:06 — forked from alvarobp/remote_pairing_setup.md
Setting up a remote pair station with SSH + TMUX and/or Reverse SSH Tunnel

Disclaimer: The following examples try to give an overview of the process followed in different scenarios. Some commands were actually written from memory. Some tools might exist simplifying all this. Furthermore, I'm no expert so if anyone ever reads this and knows any improvement, please let me know.

Case 1: Direct access to Pairing Station

Given that the Guest User can access the Pairing Station directly, either because the station is publicly available or because NAT port forwarding can be used, there's only one thing we need to do, give ssh access to the Guest User by adding his ssh public key to our Local User (pair) .ssh/authorized_keys file.

The local user would open up a tmux session with

tmux new-session -s pairing
begin
require 'ruby-shadow'
user_pw = u['password']
rescue LoadError
user_pw = nil
end
# Create user object.
# Do NOT try to manage null home directories.
user u['id'] do
@thehar
thehar / ebs_raid.rb
Created September 27, 2011 21:32 — forked from tnine/ebs_raid.rb
Ebs raid mounting. Links to this jira issue http://tickets.opscode.com/browse/CHEF-2275
include Opscode::Aws::Ec2
#Auto locates and attached ebs devices based on the data bag they reside in. The following test cases need to be performed
# Create multiple resources with new node: PASS
#
# Re-attach multiple resources after a reboot: PASS
#
# Create resources across 2 runs. First run creates first raid set, second run re-attaches then creates: PASS
#
@thehar
thehar / ebs_raid6_provider.rb
Created September 27, 2011 21:32 — forked from fujin/ebs_raid6_provider.rb
aws_ebs_raid6 lwrp
include Chef::Mixin::Command
action :create do
size = new_resource.size
volumes = new_resource.volumes.times.map{|i| (i == 0 ? "/dev/sdf" : "/dev/sdf#{i}") }
setra = new_resource.blockdev_setra
volume_group = new_resource.volume_group
logical_volume = new_resource.name
mdadm_device = new_resource.mdadm_device
mount_point = new_resource.mount_point