Skip to content

Instantly share code, notes, and snippets.

@weirdbricks
weirdbricks / mfs-chunkserver.yaml
Last active August 29, 2015 14:02
MooseFS Chunk Server Ansible recipe for FreeBSD
---
- hosts: all
remote_user: root
tasks:
- name: test
raw: uptime
- name: ping them
ping:
- name: install moosefs chunkserver from packages
pkgng: name=moosefs-chunkserver state=present
#!/usr/bin/env sh
#checks if the speaker module is loaded - if not it loads it and makes a be
#based on http://forums.freebsd.org/viewtopic.php?t=12001
module=`kldstat | grep speaker -c`
if [ $module -eq 0 ]
then
echo "speaker module not found - adding"
@weirdbricks
weirdbricks / ansible-01
Created February 15, 2014 03:36
ansible notes on converting the packaging system and installing apache in ad-hoc mode
ansible jail1 -m raw -a "pkg_add -r pkg python27"
ansible jail1 -m file -a "dest=/usr/local/etc/pkg/repos/ owner=root group=wheel state=directory"
ansible jail1 -m copy -a "src=/root/FreeBSD.conf dest=/usr/local/etc/pkg/repos/FreeBSD.conf"
ansible jail1 -m raw -a "pkg2ng"
ansible jail1 -m raw -a "pkg update -f"
ansible jail1 -m raw -a "pkg upgrade -y"
ansible jail1 -m raw -a "pkg update -f"
ansible jail1 -m pkgng -a "name=apache22 state=present cached=no"
@weirdbricks
weirdbricks / git101
Last active August 29, 2015 13:56
starting-with-a-new-repository
1. Create new repository, go here:
https://github.com/new
2. Give it a name and tick 'Initialize this repository with a README', then click on 'Create Repository', for this example the name will be 'reload-jail'
3. On your shell initialize the new repository:
git init reload-jail
4. Go into the repository directory:
cd reload-jail/
#!/bin/csh
#06/24/2013
#Lampros for WeirdBricks
#check if curl exists
if ( -e `which curl` ) then
echo "OK: Curl exists"
else
echo "ERROR:curl doesn't exist"
@weirdbricks
weirdbricks / uploadftptls.rb
Created January 16, 2012 05:39
upload to ftp/tls
this will upload a file on ftp using TLS:
#!/usr/bin/env ruby
require 'rubygems'
require 'ftpfxp' #required for FTP/TLS
require 'ptools' #required to tell if a file is text or binary
puts 'Connecting...'
HOST='192.168.2.12'
USER='ftptest2'
@weirdbricks
weirdbricks / threadbeast.rb
Created December 27, 2011 02:08
Thread Beast
#!/usr/bin/env ruby
require "rubygems"
require "sequel"
entries=0;entries=ARGV[0].to_i
threads=0;threads=ARGV[1].to_i
if ( entries.zero? || threads.zero? )
puts "Usage: ./tester number_of_entries number of threads\nValues cannot be 0"
exit
end