Nothing but the Truth [Elementary]
true| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Stocks</title> | |
| <meta charset="utf-8" /> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
| <style type="text/css" media="screen"> | |
| .stock { | |
| min-height: 273px; | |
| padding: 0; |
| require 'parallel' | |
| require 'curb' | |
| TEST_URL = 'http://www.baidu.com' | |
| def normal | |
| responses = [] | |
| 100.times do | |
| easy = Curl::Easy.new(TEST_URL) | |
| easy.perform |
| #!/usr/bin/env ruby | |
| require 'rmodbus' | |
| # PORT = '/dev/ttyACM0' | |
| PORT = '/dev/tty.usbmodemfd1221' | |
| def bytes2holdings(bytes) | |
| bytes.each_slice(2).map { |arr| arr[0] * 256 + arr[1].to_i } | |
| end |
| SOURCE="${BASH_SOURCE[0]}" | |
| # resolve $SOURCE until the file is no longer a symlink | |
| while [ -h "$SOURCE" ]; do | |
| TARGET="$(readlink "$SOURCE")" | |
| if [[ $SOURCE == /* ]]; then | |
| SOURCE="$TARGET" | |
| else | |
| DIR="$( dirname "$SOURCE" )" | |
| # if $SOURCE was a relative symlink, we need to resolve it relative | |
| # to the path where the symlink file was located |
| curl -s "http://just-ping.com/index.php?vh=$1&c=&s=ping%21" | sed 's/.*\/\/<!\[CDATA\[ //' | sed 's/\/\/\]\]>.*//' | tr ";" "\n" | sed 's/ *xmlreqGET(./http:\/\/just-ping.com\//' | sed "s/',.*//" | grep "^http:\/\/just-ping.com" | while read line; do | |
| curl -s $line | |
| echo | |
| done |
| Aug 03 21:51:11.202754 afpd[23137] {auth.c:136} (I:AFPDaemon): uam: "DHX2" available | |
| Aug 03 21:51:11.202996 afpd[23137] {auth.c:136} (I:AFPDaemon): uam: "DHCAST128" available | |
| Aug 03 21:51:11.203179 afpd[23137] {auth.c:136} (I:AFPDaemon): uam: "2-Way Randnum exchange" available | |
| Aug 03 21:51:11.203358 afpd[23137] {auth.c:136} (I:AFPDaemon): uam: "Randnum exchange" available | |
| Aug 03 21:51:11.203535 afpd[23137] {auth.c:136} (I:AFPDaemon): uam: "No User Authent" available | |
| Aug 03 21:51:11.203709 afpd[23137] {auth.c:136} (I:AFPDaemon): uam: "Cleartxt Passwrd" available | |
| Aug 03 21:51:11.233162 afpd[23137] {cnid.c:53} (I:AFPDaemon): Registering CNID module [last] | |
| Aug 03 21:51:11.233416 afpd[23137] {cnid.c:53} (I:AFPDaemon): Registering CNID module [cdb] | |
| Aug 03 21:51:11.233608 afpd[23137] {cnid.c:53} (I:AFPDaemon): Registering CNID module [dbd] | |
| Aug 03 21:51:11.233783 afpd[23137] {cnid.c:53} (I:AFPDaemon): Registering CNID module [tdb] |
| require 'yaml' | |
| data = [] | |
| File.read("text.txt").lines.each do |line| | |
| data << line | |
| end | |
| puts data.to_yaml |