Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/php
<?php
# Define variables
$page_cache = 'page.cache';
$page_to_check = 'https://www.nvidia.co.uk/geforce/buy/';
# Check if argument is passed in
if (isset($argv[1])) {
$page_cache_override = true;
#Preseed Ubuntu
d-i debconf/priority select critical
d-i auto-install/enabled boolean true
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_GB.UTF-8
# Keyboard selection.
# Disable automatic (interactive) keymap detection.
@boxrick
boxrick / gist:f0bac46ab90f8ec8f5e3f0512e049252
Created August 20, 2018 14:46
Rename git tag from old to new. Local and upstream
# Simple script to remove the pre-pended 'v' from current git repo and push this upstream.
for old_tag in $(git tag)
do
# remove v from tag
new_tag=$(echo "${old_tag//v}")
# If the tags don't match then do our rename
if [ "$old_tag" != "$new_tag" ]
then
@boxrick
boxrick / main.yml
Created July 17, 2018 14:59
Layers
---
- include_tasks: stuff.yml
with_items:
- hello
- hello2
@boxrick
boxrick / gist:f8128d9819fd781793b3a84369f5fe11
Last active July 10, 2018 15:03
Openstack AIO quickstart
#!/bin/bash
# Quick and dirty AIO Openstack bash script
start=`date +%s`
git clone https://git.openstack.org/openstack/openstack-ansible /opt/openstack-ansible
cd /opt/openstack-ansible
git checkout stable/queens
scripts/bootstrap-ansible.sh
scripts/bootstrap-aio.sh
@boxrick
boxrick / 1| command
Last active June 21, 2018 14:28
Build monitor 'view'
echo view.xml | java -jar /opt/jenkins-cli.jar -s http://127.0.0.1:8080 create-view mist_jobs_view --username admin --password PASSWORD
@boxrick
boxrick / config
Created May 14, 2018 13:56
Config XML Chunk
> <listView>
> <owner class="hudson" reference="../../.."/>
> <name>rd-ansible-github-roles</name>
> <description>Roles found on Github by our seed job.</description>
> <filterExecutors>false</filterExecutors>
> <filterQueue>false</filterQueue>
> <properties class="hudson.model.View$PropertyList"/>
> <jobNames>
> <comparator class="hudson.util.CaseInsensitiveComparator"/>
> </jobNames>
@boxrick
boxrick / example
Created May 14, 2018 13:46
example
pipelineJob('test2') {
logRotator {
numToKeep(10)
}
definition {
cps {
script("""
pipeline
{
@boxrick
boxrick / thread
Created May 11, 2018 10:39
Threaded example
import multiprocessing
from multiprocessing import Pool
from time import sleep
list_of_numbers = list(xrange(101))
def pull_role(stuff):
print('Sleeping ' + str(stuff))
sleep(0.1)
@boxrick
boxrick / vagrantfile
Created May 4, 2018 15:17
Remote Vagrantfile example
require 'open-uri'
require 'openssl'
url = 'https://remote.vagranturi/vagrantfile'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
download = open(url)
IO.copy_stream(download, '.downloaded.vagrantfile')