Skip to content

Instantly share code, notes, and snippets.

View aep's full-sized avatar
🥬

Arvid E. Picciani aep

🥬
View GitHub Profile
import event as libevent;
alias LibeventContinuation= Lambda[[Int, Short, Pointer[libevent.Struct_event_base]], []];
record LibeventContinuationBase
(
puts params
params.require(:region).permit(:beacons)
---> output
{"region"=>{"beacons"=>[{"minor"=>123, "uuid"=>"123-123-123-123", "major"=>123}]}, "action"=>"create", "controller"=>"regions"}
Unpermitted parameters: beacons
after_action :verify_authorized
# DELETE /applications/1
# DELETE /applications/1.json
def destroy
@app.destroy
respond_to do |format|
format.html { redirect_to apps_url }
aep@nightbringer: ~/proj/airbacon/airbeacon rails console
Loading development environment (Rails 4.0.2)
irb(main):001:0> User.create(app_id:123).token
(39.9ms) BEGIN
+++++++++++MAKING TOKEN!
SQL (125.5ms) INSERT INTO "users" ("app_id", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["app_id", 123], ["created_at", Tue, 25 Mar 2014 16:16:57 UTC +00:00], ["updated_at", Tue, 25 Mar 2014 16:16:57 UTC +00:00]]
(42.2ms) COMMIT
=> nil
irb(main):002:0>
class User < ActiveRecord::Base
belongs_to :app
before_create :make_token
protected
def make_token
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.npPdTT
+ umask 022
+ cd ./
+ cd /
+ rm -rf ruby-2.0.0-p451
+ /usr/bin/gzip -dc /tmp/rpmb/rpmbuild/SOURCES/ruby-2.0.0-p451.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd ruby-2.0.0-p451
#2.2.2.2 PUBLIC SERVER IP
#1.1.1.1 PRIVATE SERVER IP
#192.168.1.130 CLIENT IP BEHIND NAT
# ipsec.conf - strongSwan IPsec configuration file
# basic configuration
config setup
# plutodebug=all
# basic configuration
config setup
# nat_traversal=yes
# Connections into AWS VPC
conn %default
ikelifetime=60m
keylife=20m
ActiveAdmin.register Foo
show do |b|
panel "Bar" do
table_for [0] do
column :api do
e+= (controller.render_to_string :partial => "status", :locals => {:status =>
VpnConnection.is_ap_connected(b.endpoint, b) ? :up : :down })
e+= b.name
e
module Portal::V2
class OnboardingController < PortalController
skip_filter :enforce_user_session!, only: [:index, :debug]
def index
# we never get here
end
end
end