Skip to content

Instantly share code, notes, and snippets.

@velocity303
velocity303 / winpf.pp
Last active August 29, 2015 14:21
Windows code snippets for base OS Settings
#profile class for https://forge.puppetlabs.com/ptierno/windowspagefile
class profile::winpf {
case $os[release][major] {
"2008 R2": { if $::issql == 'true' {
$initialpf = 24576
$maximumpf = 24576
}
elsif $memorysize_mb < 16384 {
$initialpf = 1024
$maximumpf = 1024
@mpvvliet
mpvvliet / gist:2470806
Created April 23, 2012 13:04
Deployit puppet module sample
# Puppet manifest
$DEPLOYIT_VERSION = '3.7.0'
#
# Install the latest Apache webserver
#
exec { "apt-update":
command => "/usr/bin/apt-get update",
}
@nicolargo
nicolargo / gist:4647457
Created January 27, 2013 08:54
Glances 1.6 default configuration file
[cpu]
# Limits values for CPU user in %
# Defaults values if not defined: 50/70/90
user_careful=50
user_warning=70
user_critical=90
# Limits values for CPU system in %
# Defaults values if not defined: 50/70/90
system_careful=50
system_warning=70
from distributed import Worker, Scheduler, Client, Nanny
from distributed.client import _wait
from tornado import gen
from tornado.ioloop import IOLoop
loop = IOLoop.current()
s = Scheduler(loop=loop)
s.start(0)
@pappu687
pappu687 / angular-feed-reader
Last active December 25, 2017 16:49
Quick Feed Reader with AngularJS
<!DOCTYPE html>
<html ng-app="RSSFeedApp">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>AngularJS Feed Reader - jsFiddle demo</title>
<script type='text/javascript' src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<script type='text/javascript' src='//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.1/angular.min.js'></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css">
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-responsive.min.css">
require 'facter'
require 'aws-sdk'
if Facter.value("ec2_instance_id") != nil
instance_id = Facter.value("ec2_instance_id")
region = Facter.value("ec2_placement_availability_zone")[0..-2]
ec2 = Aws::EC2::Client.new(region:region)
instance = ec2.describe_instances(instance_ids:[instance_id])
tags = instance.reservations[0].instances[0].tags
tags.each do |tag|
@heapwolf
heapwolf / policy.md
Last active April 12, 2019 15:41
Possible start of a strawman for node security policies

A node security policy is similar in concept to a CSP.

~/policy.json

{
  "sha384-...": { // <- this is the hash of a source (which self describes its hashing algorithm)
    fs: [ // <- this is an "entitlement", it's a whitelist (an array of objects)
      {
 path: "/home/alice/**/*", // &lt;- this is a "resource" (a filesystem path)
@iamralch
iamralch / custom_flag.go
Created July 6, 2015 20:40
Custom flag arguments with flag package in Go
package main
import (
"flag"
"fmt"
"net/url"
"strings"
)
type UrlFlag struct {
@edhemphill
edhemphill / fifo.go
Last active April 30, 2020 13:06
Thread / goroutine safe, batching and blocking FIFO queue in golang
import (
"net/http"
"sync"
"fmt"
)
type logBuffer struct {
stuff string
}
# Windows AMIs don't have WinRM enabled by default -- this script will enable WinRM
# AND install 7-zip, curl and .NET 4 if its missing.
# Then use the EC2 tools to create a new AMI from the result, and you have a system
# that will execute user-data as a PowerShell script after the instance fires up!
# This has been tested on Windows 2008 SP2 64bits AMIs provided by Amazon
#
# Inject this as user-data of a Windows 2008 AMI, like this (edit the adminPassword to your needs):
#
# <powershell>
# Set-ExecutionPolicy Unrestricted