Code Select
http://server//root-file
In this case, it grabs the /root-file contents and displays them as plain text in the browser.
Am I missing some obvious setting? This is clearly a problem.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
http://server//root-file
newlisp server.lsp -c -d 8080 -w .
sh: line 1: 22042 Bus error: 10Quote
./"index.cgi" > /tmp/nl490825a2887b33a41d
#!/usr/bin/env newlisp
(command-event (fn (s)
(local (request)
(if (find "?" s) ; is this a query
(set 'request (first (parse s "?")))
(set 'request s)
)
request)
))
(defvar *small* 1)
(defvar *big* 100)
(defun guess-my-number ()
"Documentation for guess-my-number."
(ash (+ *small* *big*) -1))
(defun smaller () (setf *big* (1- (guess-my-number))) (guess-my-number))
(defun bigger () (setf *small* (1+ (guess-my-number))) (guess-my-number))
(defun start-over ()
(defparameter *small* 1) (defparameter *big* 100) (guess-my-number))
;
; http://streamtech.nl/problemset/100.html
; aka http://en.wikipedia.org/wiki/Collatz_conjecture
;
(define (collatz)
(println "Collatz Conjecture: low high (ENTER/RETURN to end)")
(until (= (set 'p (read-line)) "")
(set 'in (map int (parse p " ")) )
(set 'low (in 0) 'high (in 1))
(set 'max_count 0)
(dolist (num (sequence low high))
(set 'cnt 1)
(while (!= num 1)
(if (!= (mod num 2) 0)
(set 'num (+ (* 3 num ) 1))
(set 'num (/ num 2))
)
(inc cnt)
(if (< max_count cnt) (setf max_count cnt))
)
)
(println low " " high " " max_count)
)
)
(collatz)
;
; Two words are friends if they have a Levenshtein distance of 1.
; That is, you can add, remove, or substitute exactly one letter in
; word X to create word Y.
; A words social network consists of all of its friends, plus all of
; their friends, and all of their friends friends, and so on.
;
; Write a program to tell us how big the
; social network for the word causes is, using this word list:
; https://github.com/causes/puzzles/raw/master/word_friends/word.list
;
; http://en.wikipedia.org/wiki/Levenshtein_distance
;
; tons of implementations in several languages
; http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance
;
; a working HTML version
; http://www.miislita.com/searchito/levenshtein-edit-distance.html
;
(until (= (random 10) 0)
(write-line "Hello"))
(until (= (set 'x (rand 10)) 0)
(println $idx ":" x " not 0"))
(set 'x "Telefónica to Sell Spanish Assets")
(find {&#(.*);} x 0) ; reference only
(regex {&#(.*);} x)
; > ("ó" 5 6 "243" 7 3)
> $1
; > "243"
(char (int $1))
; > "รณ"
(dolist (s (sequence 1 100))
(set 'n (rand 255 (rand 100)))
(push n e -1)
)
(set 'f (rand 255 100)) ; create a new list
(push (e (rand (length e))) f) ; grab from 'e above and push into our list
(set 'eh (map (fn (l) (pack (dup "b" (length l)) l)) e)) ; convert to hex (much faster!)
;
(set 'hex (pack (dup "b" (length f)) f))
(clean nil? (map (fn (s) (find s hex)) eh))
;> (n) ; where n is the location found
;
(time (clean nil? (map (fn (s) (find s hex)) eh)))
;> ~ 1ms ; this is too slow
;
; a define
(define (foo)
(println "Oh Yeah.")
)
;
; and another
(define (foobar)
(dolist (s (sequence 1 10))
(sleep 1000)
)
)
;
; and a timer:
(define (ImaTimer)
(foo)
(timer 'ImaTimer 1)
)
;
; and, some code:
(println "Setting timer...")
(ImaTimer)
(println "Forking...")
(fork (foobar))
;(foobar)
(exit)
(map (fn (c) (if (= c (intersect c big true)) true nil)) subs)
; (nil nil nil nil nil nil true nil nil nil nil nil nil nil nil nil nil true nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil true nil nil)
(find true
(map (fn (c) (if (= c (intersect c big true)) true nil)) subs))
; 6, 17
;
; But, the time is 100 milliseconds or more...
> (dolist (s (sequence 1 10000)) (push (rand 300 4) y -1))
> (set 'z (y -2))
; this is the second to last {number} :)
> (time (find z y))
; 8.x ms
> (set 'x 1301073325)
1301073325
> (date x)
"Fri Mar 25 10:15:25 2011"
> (parse (date x))
("Fri" "Mar" "25" "10" ":" "15" ":" "25" "2011")
> (set 'x 1301071976)
1301071976
> (date x)
"Fri Mar 25 09:52:56 2011"
> (parse (date x))
("Fri" "Mar" "25" "0" "9" ":" "52" ":" "56" "2011")
(destroy-pid (int (read-file "/tmp/app.pid")))
<?php
$site = "www.mysite.com";
$port = 8080;
$fp = fsockopen($site,$port,$errno,$errstr,10);
if(!$fp)
{
$fd = fopen("maint.html", r);
$content = fread($fd, filesize("maint.html"));
fclose($fd);
echo $content;
}
else{
header("Location: http://www.mysite.com:8080");
//echo "Connect was successful - no errors on Port ".$port." at ".$site;
fclose($fp);
exit;
}
//
?>
;; @syntax Util:Interfaces
;; @return <list of interfaces>
;; @param NA
;;
(define (Interfaces)
(set 'iface (exec "ifconfig -a"))
(set 'final-iface nil)
(dolist (x iface)
(set 'curline (trim x "tt"))
; (println "Current line" $idx " : '" curline "'")
;; Get the interface, if it exists
(when (find "0: flags" curline )
(set 'myface ((parse curline) 0)) )
(when (starts-with curline "status: ")
(when (= "active"((parse curline) 1))
;(Log:Print "Result" "Adding interface: " myface)
(push myface final-iface -1)
)
)
;(println $idx "|" (trim x "tt"))
;; hold it
;; check for status: active
;; save the interface (which is active) to the list
;; return active interface list
(set 'return-interfaces final-iface)
)
)