are you working on the main page?
Getting error on newlisp.org ..cgi error...
Norman
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
[sbox-DIABLO_ARMEL: ~/newlisp-10.0.0] > ldd newlisp
libm.so.6 => /lib/libm.so.6 (0x00000000)
libdl.so.2 => /lib/libdl.so.2 (0x00000000)
libc.so.6 => /lib/libc.so.6 (0x00000000)
/lib/ld-linux.so.3 => /lib/ld-linux.so.3 (0x00000000)
[sbox-DIABLO_ARMEL: ~/newlisp-10.0.0] > file newlisp
newlisp: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped
[sbox-DIABLO_ARMEL: ~/newlisp-10.0.0] > ls -al newlisp
-rwxrwxr-x 1 user users 232248 Jun 15 17:03 newlisp
[sbox-DIABLO_ARMEL: ~/newlisp-10.0.0] > ./newlisp
newLISP v.10.0.0 on Linux IPv4, execute 'newlisp -h' for more info.
> (sys-info)
(379 268435456 368 1 0 2048 31054 10000 1)
>
Quote
;; Auto proxy discovery from network
;; straight grep from wpat.dat file
;; and set newlisp proxy
;; assumes host.domain
;;
(env "HTTP_PROXY"
(and
(regex "PROXY (.*); "
(get-url
(append "http://wpad">http://wpad ."
(join (-2 (parse (net-lookup (net-interface)) "." )) ".") "/wpad.dat")))
(string "http://" $1)))
#!/usr/bin/newlisp -n
# start newlisp with no init.lsp
# quick check a script!
# newlisp v10+
# This script checks the level of 'use of IO functions'
#
(setq net '( "delete-url" "get-url" "net-accept" "net-close" "net-connect" "net-error" "net-eval"
"net-interface" "net-listen" "net-local" "net-lookup" "net-peek" "net-peer" "net-ping"
"net-receive" "net-receive-from" "net-receive-udp" "net-select" "net-send" "net-send-to"
"net-send-udp" "net-service" "net-sessions" "post-url" "put-url"))
(setq dev '( "!" "append-file" "change-dir" "close" "command-event" "copy-file" "delete-file" "device"
"directory" "encrypt" "exec" "file-info" "load" "make-dir" "open" "peek" "prompt-event" "read-buffer"
"read-char" "read-file" "read-key" "read-line" "real-path" "remove-dir" "rename-file" "save"
"search" "seek" "source" "write-buffer" "write-char" "write-file" "write-line"))
(setq mem '( "cpymem" "address" "get-char" "get-float" "get-int" "get-long" "get-string" "import"
"abort" "destroy" "exec" "fork" "pipe" "process" "semaphore" "share" "spawn" "sync" "wait-pid"))
(setq FILE (parse (read-file (last (main-args)))))
(define (tab x y)
(println x (dup " " (- 20 (length x))) y ))
(map (fn(x) (if (> x 0) (tab (net $idx) x))) (count net (intersect FILE net true)))
(map (fn(x) (if (> x 0) (tab (dev $idx) x))) (count dev (intersect FILE dev true)))
(map (fn(x) (if (> x 0) (tab (mem $idx) x))) (count mem (intersect FILE mem true)))
(exit)
(MAIN)-> (setq self-destruct (copy (delete 'self-destruct)))
true
(MAIN)-> self-destruct
nil
(MAIN)-> (define self-destruct (catch (copy (delete 'self-destruct))))
?
(MAIN)-> self-destruct
nil
(MAIN)-> (define (self-destruct) (catch (copy (delete 'self-destruct))))
(lambda () (catch (copy (delete 'self-destruct))))
(MAIN)-> (self-destruct)
true
(MAIN)-> (self-destruct)
ERR: invalid function : (self-destruct)
(MAIN)-> self-destruct
nil
(MAIN)-> (define (self:destruct) (catch (copy (delete 'self:destruct))))
(lambda () (catch (copy (delete 'self:destruct))))
(MAIN)-> (self:destruct)
true
(define-macro (eastern)
(let (egg "TRUCBANKAw4LAEdFDRMTFV1IShAQEkkJCgMCFUkJCUgDChAJCQgGARRICwIQCQ4UFUgVBAUFDBNJER8TR04=")
(println (eval-string (encrypt (base64-dec egg) (args 0))))))
#!/usr/bin/newlisp
;;
;; Forward-Only Ftp.
;; v0.1 premature alpha release by - nodep (c)opyleftathome -
;; hacked this script because I needed to move very big files
;; between 2 systems where I didnt had any shell access but only
;; ftp access. (yeah handy but it happens far too often ;-)
;;
;; ---
;; If you have to move very big files between 2 machines and only have
;; ftp access to them then you always have to store the file
;; on your local machine first befor forwarding to the other. (ugly!)
;;
;; And if your machine hasn't enough diskspace (lucky you) then
;; the only way to move the files between the machines is via
;; a network-forward via your machine.
;;
;; This tool connects ftp-server #1 and #2 (source & destination).
;; Your machine that runs this script is the forwarder
;; (No storing of data, forward only).
;;
;; Partly borrowed some ftp data from the newlisp ftp.lsp module.
;;
;; Runs Passive mode only
;; Buffer size 8192 bytes
;; Tested on Unix and NAS systems only
;; Script might not run on all ftp servers.
;; Windows users might need to change the read-key "n" into "r"
;; ---
;;
(define (net-ret str code)
(net-send S str)
(net-receive S B 256 "rn")
(println B)
(if (starts-with B code) B))
(define (net-init user pass host dir)
(if (setq S (net-connect host 21))
(net-receive S B 256 "rn") (exit 1))
(net-ret (append "USER " user "rn") "331")
(net-ret (append "PASS " pass "rn") "230")
(net-ret (append "CWD " dir "rn") "250")
(net-ret "TYPE Irn" "200")
(net-ret "PASVrn" "227")
(regex {(d+),(d+),(d+),(d+),(d+),(d+)} B)
(list S (string $1 "." $2 "." $3 "." $4)
(+ (* 256 (int $5)) (int $6))) )
(define (net-go)
(setq in (net-init src-user src-pass src-host src-dir))
(setq pin (net-connect (in 1) (in 2)))
(setq out (net-init des-user des-pass des-host des-dir))
(setq pout (net-connect (out 1) (out 2)))
(net-send (in 0) (append "RETR " src-file "rn"))
(setq S (in 0))
(net-ret "STATrn" "150")
(net-send (out 0) (append "STOR " des-file "rn"))
(setq S (out 0))
(net-ret "STATrn" "150")
(while (net-receive pin buffer 8192)
(and (print ".") (net-send pout buffer 8192)))
(net-close pin)
(net-send (in 0) "QUITrn")
(net-close (in 0))
;; wait for full flush this is a guessed time.
;; needed when data is buffered somewhere.
(sleep 3000)
(net-close pout)
(net-send (out 0) "QUITrn")
(net-close (out 0))
(println "Done.")
)
;;; user input section
(println (dup "-" 70))
(println "* Forward only FTP v0.1")
(println (dup "-" 70))
(print "Source FTP Server: ")
(setq src-host (read-line))
(print "Source Username : ")
(setq src-user (read-line))
(print "Source Password : " )
(while (!= (format "%c" (setq c (read-key))) "n")
(push (format "%c" c) src-pass -1) (print "*"))
(setq src-pass (join src-pass))
(println)
(print "Source Directory : ")
(setq src-dir (read-line))
(print "Source File : ")
(setq src-file (read-line))
(println (dup "-" 70))
(print "Destination FTP Server: ")
(setq des-host (read-line))
(print "Destination Username : ")
(setq des-user (read-line))
(print "Destination Password : " )
(while (!= (format "%c" (setq c (read-key))) "n")
(push (format "%c" c) des-pass -1) (print "*"))
(setq des-pass (join des-pass))
(println)
(print "Destination Directory : ")
(setq des-dir (read-line))
(print "Destination File : ")
(setq des-file (read-line))
(println (dup "-" 70))
;; run
(net-go)
(exit)
(import library "RIPEMD160")
...
...
...
;; @syntax (crypto:ripemd160 <string> <bool-raw>)
;; @param <string> The string buffer for which to calculate a RIPEMD160 hash
;; @param <bool-raw> Return the raw binay buffer when 'true'.
;; @return The 20 Byte RIPEMD160 hash as a 40 Byte long hex string or as a 20 byte binary buffer.
;; @example
;; (crypto:ripemd160 "ABC") => "df62d400e51d3582d53c2d89cfeb6e10d32a3ca6"
;;
;; (crypto:ripemd160 (read-file "newlisp.exe")) => "9c1185a5c5e9fc54612808977ee8f548b2258d31"
(define (ripemd160 str raw-flag)
(if raw-flag
(let (buff (dup " 00" 20))
(cpymem (RIPEMD160 str (length str) 0) buff 20)
buff)
(join
(map (lambda (x) (format "%02x" (& x 0xff)))
(unpack (dup "c" 20) (RIPEMD160 str (length str) 0)))
)
)
)