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 / preseed.cfg
Created March 18, 2019 01:53
preseed
# Verbose output and no boot splash screen.
d-i debian-installer/quiet boolean false
d-i debian-installer/splash boolean false
# Disable that annoying WEP key dialog.
# boot param d-i netcfg/do_not_use_netplan=true
d-i netcfg/wireless_wep string
# Network configuration
d-i netcfg/choose_interface select auto
@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.
#!/usr/bin/python
#
# Low-level QEMU shell on top of QMP.
#
# Copyright (C) 2009, 2010 Red Hat Inc.
#
# Authors:
# Luiz Capitulino <lcapitulino@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2. See
@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
sub_var_text() {
local variable=$1
read -r -d '' VAR <<-EOT
text also with $variable inside\n
EOT
printf "$VAR"
}
#!/bin/bash
#
# BASH script to install DC/OS on a node
#
# Usage:
#
# dcos_install.sh <role>...
#
#
# Metadata:
@double-z
double-z / gist:2bb882c58de6e7431ac0ffc4a3d880dc
Created July 29, 2017 21:41
mesos make check libprocess resolv fail
make[6]: Leaving directory '/hab/cache/src/mesos-1.1.0/build/3rdparty/libprocess'
make check-local
make[6]: Entering directory '/hab/cache/src/mesos-1.1.0/build/3rdparty/libprocess'
make all-recursive
make[7]: Entering directory '/hab/cache/src/mesos-1.1.0/build/3rdparty/libprocess'
Making all in .
make[8]: Entering directory '/hab/cache/src/mesos-1.1.0/build/3rdparty/libprocess'
make[8]: Nothing to be done for 'all-am'.
make[8]: Leaving directory '/hab/cache/src/mesos-1.1.0/build/3rdparty/libprocess'
Making all in include
@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