Skip to content

Instantly share code, notes, and snippets.

View benphelps's full-sized avatar
🇺🇦
Slava Ukrayini!

Ben Phelps benphelps

🇺🇦
Slava Ukrayini!
View GitHub Profile
#!/usr/bin/env ruby
## Config
SCP_HOST = "96.44.143.82"
SCP_USER = "phelps"
SCP_PATH = "public_html/s.64bits.co/"
WWW_BASE = "http://s.64bits.co/"
IMG_PATH = '/Desktop/'
IMG_GLOB = 'Screen Shot*.png'
LEN_RAND = 4
Server Software: lighttpd/1.4.28
Server Hostname: 10.0.1.16
Server Port: 80
Document Path: /run.php
Document Length: 50335 bytes
Concurrency Level: 5
Time taken for tests: 3.931 seconds
Complete requests: 1000
#!/bin/bash
echo "#####"
echo "Core System Setup"
echo "#####"
echo ""
read -p "Set MySQL Root Password: " mysqlrootpass
#
#!/usr/bin/perl -w
use strict;
open MIMETYPES, "/etc/mime.types" or exit;
print "mimetype.assign = (\n";
my %extensions;
while(<MIMETYPES>) {
chomp;
s/\#.*//;
next if /^\w*$/;
if(/^([a-z0-9\/+-.]+)\s+((?:[a-z0-9.+-]+[ ]?)+)$/) {
@benphelps
benphelps / lighttpd.conf
Created December 1, 2012 16:41
Lighttpd config file
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
"mod_rewrite"
)
server.document-root = "/var/www"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
@benphelps
benphelps / lighttpd.sh
Created December 1, 2012 16:38
Lighttpd Init Script
#!/bin/sh
### BEGIN INIT INFO
# Provides: lighted
# Required-Start: $syslog $remote_fs $network
# Required-Stop: $syslog $remote_fs $network
# Should-Start: fam
# Should-Stop: fam
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the lighted web server.
1.9.3 (main):0 > a
=> [
[0] 1,
[1] "1",
[2] "1.1",
[3] "a",
[4] "-1",
[5] "-2.2"
]
1.9.3 (main):0 > b
1.9.3 (main):0 > numberize ['1','2.2','a', '-2']
=> [
[0] 1,
[1] 2.2,
[2] "a",
[3] -2
]
1.9.3 (main):0 > numberize ['1','2.2','a', '-2', '-2.2']
=> [
[0] 1,
class Wallet < ActiveRecord::Base
attr_accessible :cents, :margin_cents
belongs_to :user
def equity
margin + cash + user.stocks.mark_value
end #^
# \ This is what I need access to
end
require 'spec_helper'
describe "account" do
context 'with no displayname' do
it 'can set display name' , :js => true, :slow => true do
end