This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "reflect" | |
| ) | |
| // Name of the struct tag used in examples | |
| const tagName = "validate" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # install docker | |
| apt-get update | |
| apt-get install -y --force-yes apt-transport-https ca-certificates | |
| apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
| # edit /etc/apt/sources.list.d/docker.list | |
| vi /etc/apt/sources.list.d/docker.list | |
| deb https://apt.dockerproject.org/repo ubuntu-trusty main | |
| apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'JSON' | |
| device_types = JSON.parse `xcrun simctl list -j devicetypes` | |
| runtimes = JSON.parse `xcrun simctl list -j runtimes` | |
| devices = JSON.parse `xcrun simctl list -j devices` | |
| devices['devices'].each do |runtime, runtime_devices| | |
| runtime_devices.each do |device| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| apt-get install mc htop git unzip wget curl -y | |
| echo | |
| echo "=====================================================" | |
| echo " WELCOME" | |
| echo "=====================================================" | |
| echo | |
| echo "Hub" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ## Copyright (C) 2015 Cerebral Gardens http://www.cerebralgardens.com/ | |
| ## | |
| ## Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
| ## software and associated documentation files (the "Software"), to deal in the Software | |
| ## without restriction, including without limitation the rights to use, copy, modify, | |
| ## merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | |
| ## permit persons to whom the Software is furnished to do so, subject to the following | |
| ## conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -x | |
| # Domain you wish to update | |
| DOMAIN="example.com" | |
| # Get the v4/v6 addresses from icanhazip.com [pretty reliable!] | |
| IPV4_ADDR=`wget -4 -q -O - icanhazip.com` | |
| IPV6_ADDR=`wget -6 -q -O - icanhazip.com` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # ReadingListCatcher | |
| # - A script for exporting Safari Reading List items to Markdown and Pinboard | |
| # Brett Terpstra 2015 | |
| # Uses code from <https://gist.github.com/robmathers/5995026> | |
| # Requires Python pinboard lib for Pinboard.in import: | |
| # `easy_install pinboard` or `pip install pinboard` | |
| import plistlib | |
| from shutil import copy | |
| import subprocess |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // on error the server sends JSON | |
| /* | |
| { "error": { "data": { "message":"A thing went wrong" } } } | |
| */ | |
| // create model classes.. | |
| public class ErrorResponse { | |
| Error error; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
| # Inspired from https://gist.github.com/faleev/3435377 | |
| # Remove any existing packages: | |
| sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
| # Get the dependencies (Ubuntu Server or headless users): | |
| sudo apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # CONFIG | |
| SNMP_COMMUNITY=public | |
| SYSCONTACT=dan | |
| SYSLOCATION=Berlin | |
| # get packages | |
| apt-get install snmpd xinetd vim | |
| mkdir -p /opt/observium && cd /opt |