This file contains 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 "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 |
This file contains 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
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' |
This file contains 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/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" |
This file contains 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
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/ |
This file contains 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
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" |
This file contains 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 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" |
This file contains 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
--- | |
- 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 |
This file contains 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
- hosts: all | |
vars: | |
ec2_access_key: "AKIA-----------A" | |
ec2_secret_key: "i-------------/--------A" | |
remote_user: ec2-user | |
sudo: yes | |
tasks: | |
- name: "make sure package perl-switch is installed for the monitoring scripts" | |
yum: name=perl-Switch state=present | |
when: ansible_os_family == "RedHat" |
This file contains 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/ruby | |
#By Lampros Chaidas | |
#wc replacement in ruby | |
input = $stdin.read | |
words = input.split(" ").count | |
newlines = input.lines.count | |
characters = input.length |
This file contains 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/ruby | |
#by Lampros Chaidas | |
#cat replacement in ruby - if the -n switch is provided the lines start with a number | |
#check if the -n option is given to prepend each line with a line number | |
if ARGV.include? "-n" | |
@lines=true | |
ARGV.delete("-n") | |
end |
OlderNewer