Skip to content

Instantly share code, notes, and snippets.

@cabrel
cabrel / btsync-check.sh
Created September 18, 2013 12:51
Checks the status of network connections and stops / starts bittorrent sync based on that connectivity. In my case the network I don't want bit torrent sync running, it's first octet is 10.
#!/bin/bash
IS_INTERNAL=0
IS_WIRELESS_CONNECTED=0
IS_WIRED_CONNECTED=0
IS_BTSYNC_RUNNING=0
PID_FILE=$HOME/.btsync.pid
LOG_FILE=$HOME/.btsync-check.log
TEST_WIRELESS=`ifconfig wlan0 | grep -i running`
@cabrel
cabrel / haraka
Last active January 3, 2016 11:49
haraka config
config/databytes
================
26214400
testing
=======
swaks --to [email protected] --server 127.0.0.1 --from [email protected]
@cabrel
cabrel / Redis-Vagrantfile
Created February 22, 2014 21:16
Redis-in-a-box (VMWare)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "redis"
config.vm.network :forwarded_port, guest: 6379, host: 6379
@cabrel
cabrel / build-vfense.sh
Last active March 7, 2017 18:23
Install vfense script
#!/bin/bash
echo "** Updating apt cache list"
sudo apt-get -qq update
echo "** Installing apt-add-repository"
sudo apt-get -y install python-software-properties curl pwgen
echo "** Adding chris-lea/redis-server ppa"
sudo apt-add-repository -y ppa:chris-lea/redis-server
net.core.somaxconn = 32768
net.ipv4.conf.all.send_redirects = 1
net.ipv4.ip_nonlocal_bind = 1
net.ipv4.tcp_abort_on_overflow = 0
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_max_tw_buckets = 262144
net.ipv4.tcp_mem = 200000    280000    300000
@cabrel
cabrel / coreos
Last active August 29, 2015 14:03
coreos
wget https://gist.githubusercontent.com/cabrel/81525fce104864b3ed5e/raw/221d45906278ee999d88c6727ae2e3d6b10424db/cloud-config.yaml
wget https://raw.githubusercontent.com/coreos/init/master/bin/coreos-install

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@cabrel
cabrel / gist:cffc790ae9c27346b510
Created January 1, 2015 06:18
cloud-config.yaml
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9nWTtBwYlGX6Kce3MXg2tDGuqUwL1WxkBjEfpRKeI+jDVXVOiNJQjqTQ0VgaJxF89BoYbCZG2hMj8Pgz2dBsNC1CqHuiilkpJQaaOsHnfyI2BxpVijtFCUO5fHmKCJNq3MD4zg9RcewQVN48mgzbif3eaQRWFtnqCke03hVyfXACAz9OaZicmkODPWPJGo2gLlmB0NYH1JsCKAkzFADPVyYB/6+WM8t2m39Urz6OX2kr1ksNRCpZZ+DbR+lttzboOKPwfSr877UHGChtvk7pZuIWssaRKisfQWJB3+m01qHbK49dQ0oRwryOmnO7PXmFveagNRflw0OYugv59NiO7 [email protected]
coreos:
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
#!/bin/bash
wget https://raw.githubusercontent.com/coreos/init/master/bin/coreos-install
chmod +x coreos-install
wget https://gist.githubusercontent.com/cabrel/cffc790ae9c27346b510/raw/cdc60c3de1d051d986cfc8da50c8c0b0e58e7c40/gistfile1.yml
mv gistfile1.yml cloud-config.yml
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.