Skip to content

Commit

Permalink
Web shell stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgyarvin committed Apr 16, 2014
1 parent a0e83f8 commit 5ee64e0
Show file tree
Hide file tree
Showing 8 changed files with 2,284 additions and 2,695 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RM=rm -f
CC=gcc
CXX=g++
CXXFLAGS=$(CFLAGS)
CLD=g++ -g -g -L/usr/local/lib -L/opt/local/lib
CLD=g++ -O2 -g -L/usr/local/lib -L/opt/local/lib
YACC=bison -v -b$(GENERATED)/y
LEX=lex

Expand All @@ -58,7 +58,7 @@ INCLUDE=include
GENERATED=generated
MDEFINES=-DU2_OS_$(OS) -DU2_OS_ENDIAN_$(ENDIAN) -D U2_LIB=\"$(LIB)\"

CFLAGS= -g -g \
CFLAGS= -O2 -g \
-I/usr/local/include \
-I/opt/local/include \
-I$(INCLUDE) \
Expand Down
4,748 changes: 2,091 additions & 2,657 deletions urb/urbit.pill

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion urb/zod/arvo/ames.hoon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!:
::
:: ames (4a), networking
::
|= pit=vase
Expand Down
2 changes: 1 addition & 1 deletion urb/zod/arvo/batz.hoon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!:
::
:: batz (4b), shell
::
|= pit=vase
Expand Down
2 changes: 1 addition & 1 deletion urb/zod/arvo/clay.hoon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!:
::
:: clay (4c), revision control
::
|= pit=vase
Expand Down
211 changes: 181 additions & 30 deletions urb/zod/arvo/eyre.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
$| $? %new :: virgin
%way :: waiting
== ::
$% [%con p=@ud q=@ud r=json] :: console action
[%err p=@ud q=(list tank)] :: error report
$% [%err p=@ud q=(list tank)] :: error report
[%fin p=love] :: ready to send
[%haz p=riot] :: clay responded
[%raw p=hiss] :: wild url
Expand Down Expand Up @@ -570,6 +569,37 @@
?> ?=(%way pez.u.pup)
$(yov t.yov, q.rey (~(put by q.rey) i.yov u.pup(pez noz)))
::
++ flea :: permissive decimal
|= txt=@t
^- (unit ,@ud)
=+ zac=(slay txt)
?: ?=([~ %$ %ud @] zac)
[~ q.p.u.zac]
=+ soc=(rush txt dim:ag)
?~(soc ~ [~ u.soc])
::
++ flub :: console request
|= [paw=(list ,@t) muh=(unit moth)]
^- (unit seam)
?: ?=([@ ~] paw)
?^ muh ~
=+ fee=(flea i.paw)
?~ fee ~
[~ %con u.fee]
?. ?=([@ @ ~] paw) ~
=+ [fee=(flea i.paw) fum=(flea i.t.paw)]
?. &(?=(^ fee) ?=(^ fum)) ~
?: |(?=(~ muh) ?=(~ r.u.muh))
[~ %cog u.fee u.fum]
?. =([~ 'text/json'] (~(get by q.u.muh) 'content-type'))
~& %flub-type
~
=+ jun=`(unit json)`(rush q.u.r.u.muh apex:poja)
?~ jun
~& %flub-json
~
[~ %cop u.fee u.fum u.jun]
::
++ flux :: credential caboose
|= [nep=@tas quy=quay]
^- coin
Expand Down Expand Up @@ -707,6 +737,7 @@
?- tri
?(%f %n) (funk nep p.q.pul paw r.pul)
%v (foin p.q.pul paw r.pul)
%c (flub paw ?.(=(%t one) ~ [~ moh]))
?(%p %c %l) !!
==
::
Expand All @@ -717,6 +748,7 @@
?~ pup +>.$
=. q.rey (~(del by q.rey) num)
?. ?=(%way pez.u.pup) +>.$
?. ?=(%det -.som.u.pup) +>.$
+>.$(..ya (hoot our num ses `riff`[p.som.u.pup ~]))
::
++ into :: introduce
Expand Down Expand Up @@ -1040,6 +1072,153 @@
%way [[~ pip] +>.$]
%new
?- -.som.pip
%con
:_ +>.$
=+ cal==+(cal=(~(get by cow) p.som.pip) ?^(cal u.cal *coal))
=+ obj=(jobe ~[sent/(jone ino.cal) recv/(jone ono.cal)])
=+ sez=:/("seq={(pojo obj)}")
=+ jqu="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"
=+ ^= sac
;script
;
; $(
; function() {
; $input = $('#input .line')
; $prompt = $('#input .prompt')
; $output = $('#output')
; $input.focus()
;
; send = function(com) {
; if(com.line !== undefined &&
; com.line.indexOf('error') != -1) {
; com = {error:true}
; }
; console.log('sending')
; console.log(com)
; $.ajax('/toc/0/'+seq.sent, {
; type: 'PUT',
; data: com,
; success: function(data,status,xhr) {
; seq.sent++
; },
; error: function(data,status,xhr) {
; if(data.responseJSON.lines !== undefined)
; addLines(data.responseJSON.lines)
; seq.sent++
; }
; })
; }
;
; recv = function() {
; $.ajax('/goc/0/'+(seq.recv+1), {
; type:'GET',
; success: function(data,status,xhr) {
; if(data.lines !== undefined)
; addLines(data.lines)
; if(data.helo !== undefined)
; changePrompt(data.helo)
; seq.recv++
; recv()
; },
; error: function(data,status,xhr) {
; console.log('error')
; seq.recv++
; }
; })
; }
;
; recv()
;
; send({hail:true})
;
; addLines = function(lines) {
; $output.append(lines.join("<br />")+"<br />")
; }
;
; changePrompt = function(helo) {
; $prompt.text(helo[1].q)
; }
;
; ctrl = false
;
; $input.on('keydown', function(e) {
; console.log('keydown')
; console.log(e.keyCode)
; if(e.keyCode == 17) {
; ctrl = true
; return;
; }
; if(e.keyCode == 88 && ctrl == true) {
; console.log('ling')
; send({ling:true})
; return;
; }
; if(e.keyCode == 13) {
; send({line:$input.val()})
; $input.val('')
; return;
; }
; });
;
; $input.on('keyup', function(e) {
; if(e.keyCode == 17) {
; ctrl = false
; }
; });
; }
; )
==
=+ ^= ham
;html
;head
;title: Dogs fucked the Pope!
;script(type "text/javascript", src jqu);
==
;body
;+ [-.sac `marl`[sez +.sac]]
==
==
[~ pip(pez [%fin %ham ham])]
::
%cog
:_ +>.$
=+ cal==+(cal=(~(get by cow) p.som.pip) ?^(cal u.cal *coal))
?. (lth q.som.pip ono.cal)
[~ pip(pez %way)]
=+ ^= jon ^- json
:~ %a
(jone ono.cal)
(jone ino.cal)
(snag (sub ono.cal q.som.pip) out.cal)
==
[~ pip(pez [%fin %mid /text/json (tact (pojo jon))])]
::
%cop
=+ cal==+(cal=(~(get by cow) p.som.pip) ?^(cal u.cal *coal))
?. =(q.som.pip ino.cal)
=. cow (~(put by cow) p.som.pip cal)
:_ +>.$
[~ pip(pez [%err 500 [%leaf "cop: {<q.som.pip>}, {<ino.cal>}."]~])]
=+ ^= fuv ^- (unit card)
?. ?=(%o -.r.som.pip) ~
=+ lin=(~(get by p.r.som.pip) %line)
?^ lin ?.(?=(%s -.u.lin) ~ [~ %line p.u.lin])
=+ syc=(~(get by p.r.som.pip) %sync)
?^ syc [~ %hail ~]
=+ lig=(~(get by p.r.som.pip) %ling)
?^ lig [~ %ling ~]
~
:_ %_ +>.$
cow (~(put by cow) p.som.pip cal)
mow
?~ fuv mow
:_ mow
:+ [~ %gold our]
[/b [%e %cons ses (scot %ud p.som.pip) ~] hen]
u.fuv
==
[~ `pimp`pip(pez `pest`[%fin %raw 200 ~ ~])]
::
%det
:- [~ pip(pez %way)]
=+ rif=`riff`[p.som.pip ~ [%| q.som.pip]]
Expand All @@ -1061,34 +1240,6 @@
==
==
==
::
[%con *]
=+ ^= cal ^- coal
=+ cal=(~(get by cow) p.pez.pip)
?^ cal u.cal
*coal
?. =(q.pez.pip ino.cal)
=. cow (~(put by cow) p.pez.pip cal)
:_ +>.$
[~ pip(pez [%err 500 [%leaf "cons: {<q.pez.pip>}, {<ino.cal>}."]~])]
=+ ^= fuv ^- (unit card)
?. ?=(%o -.r.pez.pip) ~
=+ lin=(~(get by p.r.pez.pip) %line)
?^ lin ?.(?=(%s -.u.lin) ~ [~ %line p.u.lin])
=+ syc=(~(get by p.r.pez.pip) %sync)
?^ syc [~ %hail ~]
=+ lig=(~(get by p.r.pez.pip) %ling)
?^ lig [~ %ling ~]
~
:_ %_ +>.$
mow
?~ fuv mow
:_ mow
:+ [~ %gold our]
[/b [%e %cons ses (scot %ud p.pez.pip) ~] hen]
u.fuv
==
[~ `pimp`pip(pez `pest`[%fin %raw 200 ~ ~])]
::
[%err *]
[~ +>.$(..ya (muff [%thou (loft `love`[%zap +.pez.pip])]))]
Expand Down
9 changes: 6 additions & 3 deletions urb/zod/arvo/zuse.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,9 @@
::
++ poja :: parse JSON
|%
++ valu :: JSON value
++ apex :: JSON object
;~(pose abox obox)
++ valu :: JSON value
%+ knee *jval |. ~+
;~ pfix spac
;~ pose
Expand Down Expand Up @@ -2467,8 +2469,9 @@
== ::
++ salt ,@uv :: entropy
++ seam :: logical request
$% :: [%app p=seep] :: application
:: [%con p=seer] :: console
$% [%cog p=@ud q=@ud] :: console get
[%con p=@ud] :: console face
[%cop p=@ud q=@ud r=json] :: console put
[%det p=disc q=moat] :: load changes
[%fun p=term q=tube r=(list manx)] :: functional
:: [%log p=seal] :: login
Expand Down
1 change: 1 addition & 0 deletions urb/zod/main/bin/solid.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
=+ nex=+:.*([-.gat [sam +>.gat]] -.gat)
$(vay t.vay, all nex)
:_ ~ :_ ~
~& %solid-jamming
=+ pac=(jam [ken all])
~& %solid-finished
[%xx %save [%urbit %pill ~] pac]

0 comments on commit 5ee64e0

Please sign in to comment.