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
charge = Stripe::Charge.create({ | |
amount: @order.total_in_cents, | |
card: @order.stripe_card_token, | |
currency: "usd", | |
description: "Org: #{@org.name}, Plan: #{@plan.name}", | |
application_fee: @order.total_in_cents.percent_of(@org.percent_amount) | |
}, @org.stripe_oauth_token) | |
@order.stripe_charge_identifier = charge.id |
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
Ubuntu MySQL & RADIUS Howto: | |
Install MySQL | |
# apt-get install mysql-server mysql-client | |
Secure MySQL | |
Mysql_secure_installation |
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
########################################################################### | |
# $Id$ # | |
# # | |
# schema.sql rlm_sql - FreeRADIUS SQL Module # | |
# # | |
# Database schema for MySQL rlm_sql module # | |
# # | |
# To load: # | |
# mysql -uroot -prootpass radius < schema.sql # | |
# # |
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 | |
# Daemon script for running ifs_notify | |
# The script can start, stop and check status of ifs_notify | |
pwd = Dir.getwd | |
file = pwd + "/ifs_notify" | |
pidfile = "../var/ifs_notify.pid" | |
# Starting ifs_notify |
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 | |
$:.unshift File.join(File.dirname(__FILE__), *%w[ ../lib]) | |
require 'ifs_notify' | |
require 'sequel' | |
# method for converting isilon string to int | |
def quota_compare(size) | |
prefix = size.slice(/[GMTK]/) # remove the letter value for later use |
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 | |
# Daemon script for running ifs_notify | |
# The script can start, stop and check status of ifs_notify | |
pwd = Dir.getwd | |
file = pwd + "/ifs_notify" | |
pidfile = "../var/ifs_notify.pid" | |
# Starting ifs_notify |
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
ldap = IfsNotify::LoniLDAP.new(h["username"]), | |
h = { | |
:gname => ldap.ldap_firstname, | |
:name => ldap.ldap_username, | |
:mail => ldap.ldap_mail | |
} |
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" | |
# connect to an in-memory database | |
DB = Sequel.sqlite('../var/ifs_notify.db') | |
# create users table | |
DB.run("create table users(username varchar(8) primary key, directory varchar(100), emailaddr varchar(30), lstemail varchar(33));") |
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
f = File.open('/ifshome/.quota', "r") # Generated from ifs-10 cronjob | |
lines = f.readlines.select | |
lines.delete_at(0) | |
sleep 1 | |
lines.each do |u| | |
u = u.split(' ') | |
puts u | |
sleep 1 | |
home = u[1] | |
qs = u[4] |
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
@quotasize = 4G | |
storage = @quotasize.slice!(/GMT/) | |
quota_thres = sprintf('%0.2f',(@quotasize.to_f/((1+0.10)))) | |
puts storage | |
puts quota_thres |
NewerOlder