Skip to content

Instantly share code, notes, and snippets.

@gorvin
gorvin / chromecast_with_subtitles.html
Created September 23, 2018 01:24 — forked from guerrerocarlos/chromecast_with_subtitles.html
The chromecast documentation for Chrome is terrible, so to save other's some time, here is the straigt-forward way to stream something quickly and with subtitles
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
</head>
<body>
#!/bin/bash
### Insert a file before or after the pattern by sed
sed -e '/PATTERN/r file1' -e //N file2 # Before pattern
sed -e '/PATTERN/r file1' file2 # After pattern
#!/bin/bash
#Heavily inspired by clivewalkden/centos-7-package.sh
# ( https://gist.github.com/clivewalkden/b4df0074fc3a84f5bc0a39dc4b344c57 )
#However, this one was tested... 2017-JAN-09
vagrant init centos/7
vagrant up
vagrant ssh -c "sudo yum -y update"
vagrant ssh -c "sudo yum -y install wget nano kernel-devel gcc"
#
# This script installs and configures WSL to work with Docker Machine on Windows with VirtualBox.
# 1. Install WSL (check out [bowinstaller](https://github.com/xezpeleta/bowinstaller) for programmatic installation.
# 2. Run the contents of this script in Bash. (copy and paste works fine, no need to save)
#
sudo -sEH << 'EOM'
# Install the docker client and docker-compose
apt-get update && apt-get install -y curl ca-certificates
curl -sSL https://get.docker.com/ | sh
DOCKER_COMPOSE_VERSION="$(curl --silent "https://api.github.com/repos/docker/compose/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')"
@gorvin
gorvin / Install-Virtualbox-Additions.ps1
Last active April 26, 2018 21:39
Install Virtualbox Additions Powershell script
# original: http://codegists.com/snippet/powershell/install-virtualbox-additionsps1_brennanfee_powershell
$ErrorActionPreference = "Stop"
Write-Host "Installing guest additions..."
cmd /c "$env:ALLUSERSPROFILE\Chocolatey\choco.exe" install -y 7zip.commandline
if (-Not (Test-Path "$env:SYSTEMROOT\Temp\VBoxGuestAdditions.iso")) {
Write-Host "Downloading"
$virtualBoxVersion="5.2.10"
(New-Object System.Net.WebClient).DownloadFile("http://download.virtualbox.org/virtualbox/$virtualBoxVersion/VBoxGuestAdditions_$virtualBoxVersion.iso", "$env:SYSTEMROOT\Temp\VBoxGuestAdditions.iso")
}
Write-Host "Unzip the ISO"
@gorvin
gorvin / winrm-enable.cmd
Created March 23, 2018 21:41
winrm-enable.cmd
:: TODO: http://www.visualstudiogeeks.com/devops/how-to-configure-winrm-for-https-manually
powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
@set TMPPS1=%temp%\setprivatenet.ps1
@echo if([environment]::OSVersion.version.Major -lt 6 -or 1,3,4,5 -contains (Get-WmiObject win32_computersystem).DomainRole) { return }> "%TMPPS1%"
@echo $networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))>> "%TMPPS1%"
@echo $networkListManager.GetNetworkConnections() ^| foreach { $_.GetNetwork().SetCategory(1) }>> "%TMPPS1%"
type "%TMPPS1%"
powershell "%TMPPS1%"
@gorvin
gorvin / openvpn3-swig-java.ps1
Last active June 2, 2021 04:38
Building openvpn3 C++ library with Java bindings on Windows
choco install -y git python2 vcbuildtools jdk8 swig
$baseDir="C:\work\openvpn3lib\dep"
Write-Host "Preparing base dir $baseDir"
New-Item -Force "$baseDir\deps" -ItemType Directory
Set-Location "$baseDir"
Write-Host "Downloading dependencies..."
git clone https://github.com/OpenVPN/openvpn3.git openvpn3
@gorvin
gorvin / ansible-abspaths.yaml
Created June 1, 2017 08:05
Ensure absolute path in ansible playbook
- set_fact:
relpath: "one/two/three"
abspath: "/four/five/six"
- debug: var={{item}}
with_items:
- relpath
- abspath
- set_fact: