Kyle Lemons | 1 May 2012 01:10
Picon
Favicon

Re: Re: cURL / HTTPS PUT Request

The response includes a resp.Body which can be directly used via json.NewDecoder(resp.Body).Decode(&obj)

On Mon, Apr 30, 2012 at 3:55 PM, Christian Schmitt <c.schmitt <at> briefdomain.de> wrote:
Another question.. I got a json as a response, but its not byte-encoded could i make it byte-encoded and decode it via unmarshal?

Am Dienstag, 1. Mai 2012 00:50:51 UTC+2 schrieb Christian Schmitt:
Oh my god.. No... Sorry dude..
it works know -.- missed the string.Reader() my solution was so close, but i overreaded you and the string reader...
solutions can be so easy..

Am Montag, 30. April 2012 23:56:35 UTC+2 schrieb Kyle Lemons:
Did you read my post?

On Mon, Apr 30, 2012 at 2:35 PM, Christian Schmitt <c.schmitt-7OAYUylD4M3gyKjI7qutAw@public.gmane.org> wrote:
req.FormValue("status=SHUTDOWN") didn't work cause it will be ignored. but i don't know how to form a io.Reader with a string like "status=SHUTDOWN" or a json string. 

Am Montag, 30. April 2012 23:28:45 UTC+2 schrieb Christian Schmitt:
Yeah I got this already:



package main

import "fmt"
import "net/http"

import "io/ioutil"


func main() {



client := &http.Client{}



req, _ := http.NewRequest("PUT", "https://api.jiffybox.de/HASH/v1.0/jiffyBoxes/ID", nil)


req.FormValue := "status=SHUTDOWN"
resp, _ := client.Do(req)

out, _ := ioutil.ReadAll(resp.Body)
resp.Body.Close()

fmt.Printf("%s", out)




}

Still I didn't need to know how to send the Data like "status=SHUTDOWN" or in json {"key1":value1} I only know how to make a request not how to send data.. that is my problem i know i need something with io.Reader but don't know how to make it correctly

Am Montag, 30. April 2012 22:53:03 UTC+2 schrieb Volker Dobler:


On Apr 30, 10:27 pm, Christian Schmitt <c.schm... <at> briefdomain.de>
wrote:
> I searched the HTTP Library but I didn't find anything to make a HTTPS
> Request, so how could I do it?

Did you try something like (untested pseudocode):
  request, err := http.NewRequest("PUT", url, body)
  response, err := http.DefaultClient.Do(request)
?

V


Alex | 1 May 2012 01:13
Picon
Gravatar

Secure Go binaries

I've spent some time over the past month or so trying to make a secure Go binary and exploiting a Go binary. I posted a writeup about it and feel like others could be interested.



tl;dr: The deterministic, executable heap leads to an interesting exploit.

~Alex Reece
Brad Fitzpatrick | 1 May 2012 01:26
Favicon

Re: Re: cURL / HTTPS PUT Request

What do you mean by "byte-encoded"?

On Tue, May 1, 2012 at 8:55 AM, Christian Schmitt <c.schmitt <at> briefdomain.de> wrote:
Another question.. I got a json as a response, but its not byte-encoded could i make it byte-encoded and decode it via unmarshal?

Am Dienstag, 1. Mai 2012 00:50:51 UTC+2 schrieb Christian Schmitt:
Oh my god.. No... Sorry dude..
it works know -.- missed the string.Reader() my solution was so close, but i overreaded you and the string reader...
solutions can be so easy..

Am Montag, 30. April 2012 23:56:35 UTC+2 schrieb Kyle Lemons:
Did you read my post?

On Mon, Apr 30, 2012 at 2:35 PM, Christian Schmitt <c.schmitt-7OAYUylD4M3gyKjI7qutAw@public.gmane.org> wrote:
req.FormValue("status=SHUTDOWN") didn't work cause it will be ignored. but i don't know how to form a io.Reader with a string like "status=SHUTDOWN" or a json string. 

Am Montag, 30. April 2012 23:28:45 UTC+2 schrieb Christian Schmitt:
Yeah I got this already:



package main

import "fmt"
import "net/http"

import "io/ioutil"


func main() {



client := &http.Client{}



req, _ := http.NewRequest("PUT", "https://api.jiffybox.de/HASH/v1.0/jiffyBoxes/ID", nil)


req.FormValue := "status=SHUTDOWN"
resp, _ := client.Do(req)

out, _ := ioutil.ReadAll(resp.Body)
resp.Body.Close()

fmt.Printf("%s", out)




}

Still I didn't need to know how to send the Data like "status=SHUTDOWN" or in json {"key1":value1} I only know how to make a request not how to send data.. that is my problem i know i need something with io.Reader but don't know how to make it correctly

Am Montag, 30. April 2012 22:53:03 UTC+2 schrieb Volker Dobler:


On Apr 30, 10:27 pm, Christian Schmitt <c.schm... <at> briefdomain.de>
wrote:
> I searched the HTTP Library but I didn't find anything to make a HTTPS
> Request, so how could I do it?

Did you try something like (untested pseudocode):
  request, err := http.NewRequest("PUT", url, body)
  response, err := http.DefaultClient.Do(request)
?

V


Christian Schmitt | 1 May 2012 01:27
Picon

Re: Re: cURL / HTTPS PUT Request

Ah yeah thanks got it. Golang is very easy.. some things should be described in my native language, then it would be easier but its okai.. i like the language. maps are amazing.

Am Dienstag, 1. Mai 2012 01:10:54 UTC+2 schrieb Kyle Lemons:

The response includes a resp.Body which can be directly used via json.NewDecoder(resp.Body).Decode(&obj)

On Mon, Apr 30, 2012 at 3:55 PM, Christian Schmitt <c.schmitt-7OAYUylD4M3gyKjI7qutAw@public.gmane.org> wrote:
Another question.. I got a json as a response, but its not byte-encoded could i make it byte-encoded and decode it via unmarshal?

Am Dienstag, 1. Mai 2012 00:50:51 UTC+2 schrieb Christian Schmitt:
Oh my god.. No... Sorry dude..
it works know -.- missed the string.Reader() my solution was so close, but i overreaded you and the string reader...
solutions can be so easy..

Am Montag, 30. April 2012 23:56:35 UTC+2 schrieb Kyle Lemons:
Did you read my post?

On Mon, Apr 30, 2012 at 2:35 PM, Christian Schmitt <c.schmitt-7OAYUylD4M3gyKjI7qutAw@public.gmane.org> wrote:
req.FormValue("status=SHUTDOWN") didn't work cause it will be ignored. but i don't know how to form a io.Reader with a string like "status=SHUTDOWN" or a json string. 

Am Montag, 30. April 2012 23:28:45 UTC+2 schrieb Christian Schmitt:
Yeah I got this already:



package main

import "fmt"
import "net/http"

import "io/ioutil"


func main() {



client := &http.Client{}



req, _ := http.NewRequest("PUT", "https://api.jiffybox.de/HASH/v1.0/jiffyBoxes/ID", nil)


req.FormValue := "status=SHUTDOWN"
resp, _ := client.Do(req)

out, _ := ioutil.ReadAll(resp.Body)
resp.Body.Close()

fmt.Printf("%s", out)




}

Still I didn't need to know how to send the Data like "status=SHUTDOWN" or in json {"key1":value1} I only know how to make a request not how to send data.. that is my problem i know i need something with io.Reader but don't know how to make it correctly

Am Montag, 30. April 2012 22:53:03 UTC+2 schrieb Volker Dobler:


On Apr 30, 10:27 pm, Christian Schmitt <c.schm...-7OAYUylD4M3gyKjI7qutAw@public.gmane.org>
wrote:
> I searched the HTTP Library but I didn't find anything to make a HTTPS
> Request, so how could I do it?

Did you try something like (untested pseudocode):
  request, err := http.NewRequest("PUT", url, body)
  response, err := http.DefaultClient.Do(request)
?

V


Joubin Houshyar | 1 May 2012 01:42
Picon

Re: Re: Sieve of Eratosthenes



On Mon, Apr 30, 2012 at 1:59 PM, Thomas Bushnell, BSG <tbushnell-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote:
On Mon, Apr 30, 2012 at 7:45 AM, Joubin Houshyar <jhoushyar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
The ancient Greeks and their insights truly amaze me. I too am an admirer. (Democritus, ...)

Please don't admire Democritus for the atomic theory. The only thing his notion of atomic theory has in common with ours is the name.

I am inclined to give the poor man a break, considering his time, available tools, and the views of his relative contemporaries.  He was not a scientist, but an intelligent and insightful speculator (which is a worthwhile occupation in my book).  At least he did not mistake the brain for a radiator. :)  
 

Thomas
 
 

Thomas Bushnell, BSG | 1 May 2012 01:53
Picon
Favicon

Re: Re: Sieve of Eratosthenes

On Mon, Apr 30, 2012 at 4:42 PM, Joubin Houshyar <jhoushyar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:



On Mon, Apr 30, 2012 at 1:59 PM, Thomas Bushnell, BSG <tbushnell-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote:
On Mon, Apr 30, 2012 at 7:45 AM, Joubin Houshyar <jhoushyar <at> gmail.com> wrote:
The ancient Greeks and their insights truly amaze me. I too am an admirer. (Democritus, ...)

Please don't admire Democritus for the atomic theory. The only thing his notion of atomic theory has in common with ours is the name.

I am inclined to give the poor man a break, considering his time, available tools, and the views of his relative contemporaries.  He was not a scientist, but an intelligent and insightful speculator (which is a worthwhile occupation in my book).  At least he did not mistake the brain for a radiator. :)  

I'm not criticizing him, but just saying, don't admire him as if he was right about the atomic theory. The things where he should be admired--and there are certainly many--lie elsewhere.

Thomas
 
Joubin Houshyar | 1 May 2012 02:01
Picon

Re: Re: Sieve of Eratosthenes



On Mon, Apr 30, 2012 at 7:53 PM, Thomas Bushnell, BSG <tbushnell-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote:
On Mon, Apr 30, 2012 at 4:42 PM, Joubin Houshyar <jhoushyar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:


On Mon, Apr 30, 2012 at 1:59 PM, Thomas Bushnell, BSG <tbushnell-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote:
On Mon, Apr 30, 2012 at 7:45 AM, Joubin Houshyar <jhoushyar <at> gmail.com> wrote:
The ancient Greeks and their insights truly amaze me. I too am an admirer. (Democritus, ...)

Please don't admire Democritus for the atomic theory. The only thing his notion of atomic theory has in common with ours is the name.

I am inclined to give the poor man a break, considering his time, available tools, and the views of his relative contemporaries.  He was not a scientist, but an intelligent and insightful speculator (which is a worthwhile occupation in my book).  At least he did not mistake the brain for a radiator. :)  

I'm not criticizing him, but just saying, don't admire him as if he was right about the atomic theory. The things where he should be admired--and there are certainly many--lie elsewhere.

I did sense that.  What do you admire about him?


Thomas
 

Thomas Bushnell, BSG | 1 May 2012 02:05
Picon
Favicon

Re: Re: Sieve of Eratosthenes

On Mon, Apr 30, 2012 at 5:01 PM, Joubin Houshyar <jhoushyar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

I'm not criticizing him, but just saying, don't admire him as if he was right about the atomic theory. The things where he should be admired--and there are certainly many--lie elsewhere.

I did sense that.  What do you admire about him?

He's a materialist, in the tradition of the Milesians, in a good way. I think he had a good style of responding to Parmenides, though I prefer Anaxagoras.


Michael Jones | 1 May 2012 02:12
Picon
Favicon

Re: Re: Sieve of Eratosthenes

I love this conversation!

On Mon, Apr 30, 2012 at 8:05 PM, Thomas Bushnell, BSG
<tbushnell@...> wrote:
> On Mon, Apr 30, 2012 at 5:01 PM, Joubin Houshyar <jhoushyar@...>
> wrote:
>>>
>>> I'm not criticizing him, but just saying, don't admire him as if he was
>>> right about the atomic theory. The things where he should be admired--and
>>> there are certainly many--lie elsewhere.
>>
>>
>> I did sense that.  What do you admire about him?
>
>
> He's a materialist, in the tradition of the Milesians, in a good way. I
> think he had a good style of responding to Parmenides, though I prefer
> Anaxagoras.
>
>

--

-- 
Michael T. Jones | Chief Technology Advocate
 | mtj@... |  +1
650-335-5765

Joubin Houshyar | 1 May 2012 02:32
Picon

Re: Re: Sieve of Eratosthenes



On Mon, Apr 30, 2012 at 8:05 PM, Thomas Bushnell, BSG <tbushnell-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote:
On Mon, Apr 30, 2012 at 5:01 PM, Joubin Houshyar <jhoushyar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
I'm not criticizing him, but just saying, don't admire him as if he was right about the atomic theory. The things where he should be admired--and there are certainly many--lie elsewhere.

I did sense that.  What do you admire about him?

He's a materialist, in the tradition of the Milesians, in a good way.

Surprised you admire a materialist view point. I consider it the most stubborn of all superstitions.
 
I think he had a good style of responding to Parmenides, though I prefer Anaxagoras.

Thank you for the ref.  I will read up on it.  


Gmane