Skip to content

Instantly share code, notes, and snippets.

View double-z's full-sized avatar

Zack Zondlo double-z

View GitHub Profile
@double-z
double-z / vm_login.sh
Created February 16, 2019 13:01 — forked from Daniel-Abrecht/vm_login.sh
Server scripts
#!/bin/bash
# This sctipt can be added in /etc/inittab in any system with traditional init systems
# to replace the login prompt whith a selection of VMs
# This script uses virsh to get list of all local lxc and qemu VMs managed using libvirt.
# The list will be displayed using dialog. When selecting a VM, this script attempts to
# get a spice or vnc display. It will connect to those with spice-client or directvnc.
# If no display is available, virsh console is used to connect to the vm console.
@double-z
double-z / kvm-qemu.sh
Created February 13, 2019 06:19 — forked from doomedraven/kvm-qemu.sh
Linux - KVM + QEMU installer from sources :)
#!/bin/bash
#
# For latest version please check https://github.com/doomedraven/Tools/blob/master/Virtualization/kvm-qemu.sh
#
# https://www.doomedraven.com/2016/05/kvm.html
# Use Ubuntu 18.04 LTS
#!/sbin/openrc-run
#
# OpenRc Script to create a service that can configure a Internal or Host-Only Network
# it create tun/tap and bridge interfaces, you'll able to use them how do you like
#
# INSTRUCTIIONS:
# 1- create file /etc/ttapnetqemu/network.conf put follow lines
#
# mode=hostonly|inet #hostonly -> Host Only Network or inet -> Internal Network
# host_numbers=2 #Number of hosts to configure. it create same number of tun/tap and bro interface depending to mode
@double-z
double-z / disable.sh
Created December 9, 2017 17:37
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi
@double-z
double-z / registrations_controller.rb
Created June 25, 2017 04:44 — forked from jwo/registrations_controller.rb
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
@double-z
double-z / linux-el-capitan-vm.md
Created April 4, 2017 04:20 — forked from nstarke/linux-el-capitan-vm.md
How to create an OS X El Capitan VM that will run on Linux

How to create an OS X El Capitan VM that will run on Linux

VirtualBox only officially supports OS X guests on an OS X host, but it is possible to create one on an OS X host and transfer it over to a Linux host. This tutorial will go over one possible way to accomplish this task.

What you will need

  • An Apple computer running OS X 10.11
  • A Linux computer to transfer the VM over to
  • 20 GB free on the Apple Machine
  • 40 GB free on the Linux Machine
@double-z
double-z / hooks_health_check.sh
Created August 9, 2016 10:34
Plan to configure Consul with habitat.
#!/bin/sh
#
# Consul Health Check for Habitat
echo "health_check..."
echo ""
# The health_check script must return a valid exit code from the list below.
# 0 - ok
@double-z
double-z / step1.sh
Created August 9, 2016 10:32 — forked from X0nic/step1.sh
Habitat Rails Sample Comands
# hab studio enter
hab pkg export docker core/postgresql
hab pkg export docker core/ruby-rails-sample
# Terminal - 1
docker run -e HAB_POSTGRESQL='initdb_superuser_password = "rails_sample"' -p 9631:9631 -p 5432:5432 -v rails_pg_data:/hab/svc/postgresql/data -it core/postgresql
# Terminal - 2
@double-z
double-z / habitat-quickstart.md
Created August 9, 2016 10:32
Habitat Quickstart Guide