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
# # # # # # # ##### ###### # # #### # # | |
# # ## # # # # # # # ## # # # # # | |
# # # # # # ## ##### ##### # # # # ###### | |
# # # # # # ## # # # # # # # # # | |
# # # ## # # # # # # # ## # # # # | |
#### # # # # # ##### ###### # # #### # # | |
Version 5.1.3 Based on the Byte Magazine Unix Benchmark | |
Multi-CPU version Version 5 revisions by Ian Smith, |
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/sh | |
## e.g.) sudo ./swap_stats.sh | column -t | sort -nrk3 | head -n25" | |
if [ $UID -ne 0 ] ; then | |
echo "You must be root to run this script." 1>&2 | |
exit 1 | |
fi | |
TOTAL_SWAP=0 |
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 perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Email::Sender::Simple qw/sendmail/; | |
use Email::MIME; | |
use Encode; | |
my $email = Email::MIME->create( |
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
class Model < ActiveRecord::Base | |
scope :retrieve_all, ->(*tables) { | |
select_stmt = [%{`#{self.table_name}`.*}] | |
select_stmt << tables.map {|t| | |
ar = ActiveRecord::Base.const_get(t.to_s.classify.singularize) | |
table_name = ar.table_name | |
table_name_single = table_name.singularize | |
ar.attribute_names.map {|col| |
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/sh | |
set -e | |
export PATH=/usr/local/bin:/usr/bin:/bin | |
read name address role tags | |
file=/etc/hosts | |
tmp_file=/tmp/hosts.tmp |
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
module MyApp | |
class Application < Rails::Application | |
config.autoload_paths += %W(#{config.root}/lib) | |
config.middleware.insert_before ActionDispatch::Cookies, "CookieFilter" | |
end | |
end |
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
module Serverspec | |
module Type | |
class Supervise < Base | |
def initialize(name) | |
@name = name | |
end | |
def status | |
ret = backend.run_command("svstat /service/#{@name} | awk '{print $2}'") | |
ret[:stdout].chomp |
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
module Serverspec | |
module Type | |
class Partition < Base | |
def initialize(partition, type) | |
@name = partition | |
@partition_table = {} | |
case type | |
when 'cylinder' | |
options = "-l" |
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/sh | |
export HOME="/home/me" | |
export PATH="$HOME/.plenv/bin:$PATH" | |
eval "$(plenv init -)" | |
cd $HOME/app | |
exec carton exec -- "$1" |
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
/path/to/app/log/*.log { | |
weekly | |
missingok | |
rotate 12 | |
dateext | |
compress | |
delaycompress | |
notifempty | |
copytruncate | |
} |