hackeron

Activity Graph

Page 1 of 4 | Next »

2019-07-04

[15:39:59] hackeron: Quit: Lost terminal

2019-06-23

[19:25:10] hackeron: I'm using simple_form currently with mongoid ~6 and it's working OK, it seems mmongoid ~7 completely breaks compatibility. Is there some mongoid friendly alternative to simple_form?

2019-06-20

[15:29:47] hackeron: has joined #RubyOnRails

2019-05-28

[01:15:37] hackeron: has joined #ruby
[01:20:20] hackeron: Ping timeout: 258 seconds
[03:16:35] hackeron: has joined #ruby
[03:21:04] hackeron: Ping timeout: 248 seconds
[06:30:28] hackeron: has joined #ruby
[06:35:11] hackeron: Ping timeout: 248 seconds
[07:42:15] hackeron: has joined #ruby
[09:02:40] hackeron: Quit: leaving

2019-05-27

[18:18:57] hackeron: has joined #ruby
[22:02:32] hackeron: Ping timeout: 258 seconds
[23:15:22] hackeron: has joined #ruby
[23:19:35] hackeron: Ping timeout: 258 seconds

2018-05-14

[01:20:01] hackeron: Ping timeout: 248 seconds

2018-05-06

[00:17:23] hackeron: has joined #RubyOnRails

2018-04-25

[08:54:23] hackeron: Quit: Lost terminal

2018-04-18

[21:20:19] hackeron: has joined #ruby
[21:23:05] hackeron: hi there, quick question, I'm working on an IoT device with MQTT, but it's important that all messages are delivered to the MQTT broker. When the IoT device goes offline for any reason, it needs to queue the messages on local storage to be sent when it reconnects. Can you recommend some low overhead local store? - I was thinking maybe PStore but does that handle sudden power failures well and
[21:23:11] hackeron: popping/adding items without needing to rewrite the entire thing? (it's an SD card so need to minimize data writes)
[21:24:51] hackeron: havenwood: can that add and remove lines in place and handle a sudden power failure without corrupting the file?
[21:25:44] hackeron: but if you happen to yank the power cable during the write, file gone? :(
[21:27:58] hackeron: it seems to also be key value pair - so I don't think I can just push and pop items from it?
[21:29:08] hackeron: yes, so something like Queue.new - but persisted to disk in a reliable/efficient way
[21:37:50] hackeron: hmm, maybe redis, I can trigger save to persist to disk
[21:40:25] hackeron: havenwood: I'm using rabbitmq now, but I'm having some major issues: https://groups.google.com/forum/?nomobile=true#!topic/rabbitmq-users/ernykxb1mZY -- also, it's very heavy to run erlang/etc on an IoT device. I think Redis could be the way to go
[21:42:10] hackeron: what's that?
[21:43:03] hackeron: oh is it? - very interesting, thank you :)
[21:43:25] hackeron: does it run on x86_64 as well?
[21:44:38] hackeron: ah, it does, very interesting, thank you, I'll definitely be checking it out!
[21:44:53] hackeron: comes with ruby 2.5.1? :)
[21:48:54] hackeron: havenwood: what do you mean by on the BEAM?
[21:50:08] hackeron: oh, so I can't just run normal MRI?
[21:50:30] hackeron: oh :( - sad times

2018-03-03

[13:05:27] hackeron: Ping timeout: 240 seconds

2018-03-02

[19:31:32] hackeron: has joined #ruby

2017-11-08

[03:12:02] hackeron: Read error: Connection reset by peer
[03:15:31] hackeron: has joined #ruby
[10:04:15] hackeron: Ping timeout: 248 seconds

2017-11-06

[18:25:16] hackeron: has joined #ruby
[18:31:09] hackeron: Read error: Connection reset by peer
[18:31:24] hackeron: has joined #ruby

2017-11-03

[11:39:44] hackeron: Read error: Connection reset by peer

2017-11-01

[18:36:58] hackeron: has joined #ruby

2017-08-16

[09:00:12] hackeron: has joined #ruby
[09:00:25] hackeron: has joined #ruby
[09:00:25] hackeron: Changing host
[09:18:05] hackeron: Quit: leaving
[09:18:20] hackeron: has joined #ruby
[09:19:24] hackeron: Client Quit
[09:19:40] hackeron: has joined #ruby
[09:19:40] hackeron: Changing host
[09:19:40] hackeron: has joined #ruby
[09:20:35] hackeron: Client Quit
[09:20:54] hackeron: has joined #ruby
[09:21:43] hackeron: Client Quit
[09:22:40] hackeron: has joined #ruby

2017-08-15

[18:28:54] hackeron: Quit: Lost terminal

2017-08-14

[07:29:16] hackeron: has joined #RubyOnRails
[07:30:26] hackeron: Hey, I'm trying to run bundle exec rails assets:precompile in a Dockerfile, but it's dying with Errno::ECONNREFUSED: Can't connect to: redis://127.0.0.1:6379/0 -- that's correct, I do not have Redis installed yet.. How do I make it stop trying to connect to Redis?
[07:54:49] hackeron: emers2n: matthewd: it's an inializer wihch has Ohm.redis = Redic.new ENV.fetch('OHM_REDIS_URL', 'redis://127.0.0.1:6379/0') -- how do I not run this line of code when running rails assets:precompile?
[07:56:33] hackeron: emers2n: I need it to run always except when running assets:precompile
[08:00:32] hackeron: because redis is used heavily by my app, but when I'm building my docker container, there is no redis service started yet - so I need to run assets:precompile without a running redis service
[08:01:57] hackeron: matthewd: I'm not trying to boot the app, I want to run assets:precompile to build a docker image, it does not require redis yet, so how do I tell my rails code oh, we're building assets? - skip this initializer. This used to be an option in rails3, but can't seem to find a solution in rails5
[08:02:30] hackeron: emers2n: yep, this is for rails3 and does not work in rails5 :(
[08:09:02] hackeron: matthewd: hmm, let me try that
[08:10:05] hackeron: emers2n: I want it to throw an exception if redis is not available in all other cases, I just want a way to detect if I'm running assets:precompile and skip this (and probably a whole bunch of other irelevant initializers)
[08:12:18] hackeron: trying with "ASSETS_PRECOMPILE=true bundle exec rails assets:precompile" and adding a condition in my initializers - hopefully that should work, but wonder if there is some cleaner way to detect assets:precompile
[08:14:45] hackeron: yes, that works, but messy
[23:51:34] hackeron: *.net *.split
[23:56:42] hackeron: has joined #ruby
[23:56:44] hackeron: has joined #RubyOnRails

2017-08-10

[15:46:19] hackeron: has joined #ruby
[15:47:46] hackeron: Changing host
[15:47:47] hackeron: has joined #ruby

2016-06-13

[09:14:25] hackeron: Ping timeout: 258 seconds

2016-06-10

[14:12:45] hackeron: Remote host closed the connection
[18:01:08] hackeron: has joined #RubyOnRails
[18:01:08] hackeron: has joined #ruby

2016-06-09

[17:05:47] hackeron: has joined #RubyOnRails
[17:05:47] hackeron: has joined #ruby

2016-05-23

[12:49:29] hackeron: Ping timeout: 276 seconds

2016-05-22

[14:02:15] hackeron: Remote host closed the connection
[17:37:06] hackeron: has joined #ruby
[17:37:07] hackeron: has joined #RubyOnRails

2016-05-17

[00:24:36] hackeron: Ping timeout: 276 seconds
[00:35:52] hackeron: has joined #RubyOnRails
[00:35:52] hackeron: has joined #ruby

2016-04-25

[04:23:20] hackeron: apeiros: no, not solved yet :( - asked manufacturer for more details and examples

2016-04-24

[13:57:25] hackeron: hi there, I'm trying to talk to a serial controller, the instructions say that byte 6 is the high byte checksum - s=(byte)SUM(2;5) CRC_H=0b1000_s7_s6_s5_s4 -- any ideas how to calculate this?
[14:05:45] hackeron: apeiros: I'm not sure, it is what the instructions say: https://www.dropbox.com/s/3212f6s3dw0vvvl/Screen%20Shot%202016-04-24%20at%2019.33.05.png?dl=0
[14:06:09] hackeron: apeiros: but I am guessing maybe adding the values of bytes 2 to 5?
[14:06:15] hackeron: (binary values)
[14:08:31] hackeron: apeiros: yeh, that's what I'm thinking, hmmm - but you have CRC_H=0b1000_s7_s6_s5_s4 and CRC_L=0b1000_s3_s2_s1_s0 - not quite sure what that means
[14:14:19] hackeron: apeiros: thank you, something like this? < '10E0'.unpack("C*").inject(:+) -- let me try that for both checksum values and see what happens, heh
[14:16:15] hackeron: apeiros: I think the chechsum might be duplicated because they need 8 bytes
[14:17:33] hackeron: apeiros: heh, I will send them some feedback if I get this working :)
[14:37:29] hackeron: apeiros: doesn't seem to respond to that :( - but it says the checksum needs to be 1 byte, the sum is 3 bytes, hmmm - any ideas?
[14:51:24] hackeron: apeiros: oh wait, I get it, I need to get the "high byte" of the integer - any ideas how to do that?
[14:54:46] hackeron: eam: 32bit, so I have 214 - 3 bytes - I need to get the high and low byte of this integer
[14:59:12] hackeron: eam: no wait, I think it's 8bit, hmm
[15:00:03] hackeron: eam: hmm, when I do serial.write(214) - it returns 3
[15:00:42] hackeron: eam: yeh, the documentation say to write 2 bytes - the high and low hbyte, hmm
[15:01:05] hackeron: eam: it's not super clear: https://www.dropbox.com/s/3212f6s3dw0vvvl/Screen%20Shot%202016-04-24%20at%2019.33.05.png?dl=0
[15:06:20] hackeron: eam: ah, I see - that's where I am confused - how would I get that and do I write like serial.write(0x214)?
[15:07:06] hackeron: eam: how did you get 0 and 214?
[15:12:00] hackeron: eam: ah, ok, I need to read up a bit more eabout it like 0xff - but that makes sense thank you :) - but for some reason still not getting any response :(
[15:13:22] hackeron: eam: it's a solar controller - I'm trying to do this: https://gist.github.com/xanview/432b9a1bce58de78d18ffc86185707f3 - the instructions are this: https://www.dropbox.com/s/3212f6s3dw0vvvl/Screen%20Shot%202016-04-24%20at%2019.33.05.png?dl=0
[15:15:46] hackeron: eam: added .chr - still no response from the controller, hmm and thank you didn't know that :)
[15:15:57] hackeron: added .chr for start and end byte
[15:16:16] hackeron: probably doing the checksum wrong, hmm
[15:16:33] hackeron: not quite sure what s=(byte)SUM(2;5) CRC_H=0b1000_s7_s6_s5_s4 means
[15:17:28] hackeron: eam: I see, so does it need to be 2.chr or 0x02.chr?
[15:18:22] hackeron: ah :) - I thought 0x02 ould do the convertion, so good to know I need .chr :)
[15:19:10] hackeron: makes sense - any ideas what I'm doing wrong in the checksum though?
[15:21:02] hackeron: eam: hmm? - it says checksum high byte and checksum low byte - for byte 6 and 7
[15:21:33] hackeron: eam: and it's saying to sum, so I just did '10E0'.unpack("C*").inject(:+).ord which I guess is wrong, heh
[15:22:45] hackeron: eam: to some extent, heh - but I'm guessing that's wrong :P
[15:23:45] hackeron: eam: nope, just those instructions and nothing else :( - I will ask them for one
[15:26:11] hackeron: eam: I'm guessing the instructions are not really enough to go by?
[15:27:14] hackeron: eam: yeh -- s=(byte)SUM(2;5) CRC_H=0b1000_s7_s6_s5_s4 -- what the hell, lol?
[15:31:12] hackeron: eam: since they asked to sum ascii, I figured I will sum the binary representation of the ascii characters?
[15:34:30] hackeron: lol, fun times :) - and what would the low byte be?
[15:37:50] hackeron: eam: so I should try p serial.write('1'.chr + '0'.chr)?
[15:40:14] hackeron: e argh, no resopnse to that either, hmm

2016-04-07

[10:27:09] hackeron: Ping timeout: 260 seconds
[10:49:54] hackeron: has joined #RubyOnRails
[10:49:54] hackeron: has joined #ruby

2016-03-23

[18:56:48] hackeron: has joined #RubyOnRails
[18:56:48] hackeron: has joined #ruby

2016-03-17

[09:38:03] hackeron: Ping timeout: 276 seconds

2016-03-09

[05:43:20] hackeron: has joined #RubyOnRails
[05:43:20] hackeron: has joined #ruby

2016-03-05

[11:30:52] hackeron: Ping timeout: 252 seconds

2016-03-01

[01:13:18] hackeron: Ping timeout: 246 seconds
[01:20:26] hackeron: has joined #RubyOnRails
[01:20:26] hackeron: has joined #ruby
[18:51:51] hackeron: Ping timeout: 250 seconds
[18:52:51] hackeron: has joined #RubyOnRails
[18:52:51] hackeron: has joined #ruby

2016-02-29

[02:45:07] hackeron: Ping timeout: 250 seconds
[02:47:05] hackeron: has joined #RubyOnRails
[02:47:05] hackeron: has joined #ruby

2016-02-28

[21:19:58] hackeron: Ping timeout: 244 seconds
[21:21:48] hackeron: has joined #RubyOnRails
[21:21:48] hackeron: has joined #ruby

2016-02-27

[22:41:01] hackeron: Ping timeout: 240 seconds
[22:49:28] hackeron: has joined #RubyOnRails
[22:49:28] hackeron: has joined #ruby

2016-02-04

[04:19:15] hackeron: Ping timeout: 263 seconds
[04:19:32] hackeron: has joined #RubyOnRails
[04:19:32] hackeron: has joined #ruby

2016-01-01

[02:32:47] hackeron: has joined #ruby
[02:32:48] hackeron: has joined #RubyOnRails

2015-12-13

[01:21:36] hackeron: has joined #RubyOnRails
[01:21:36] hackeron: has joined #ruby
[18:13:57] hackeron: Ping timeout: 240 seconds

2015-12-12

[10:11:01] hackeron: Ping timeout: 240 seconds

2015-12-08

[01:20:29] hackeron: has joined #RubyOnRails
[01:20:29] hackeron: has joined #ruby
[01:50:44] hackeron: Ping timeout: 272 seconds
[01:57:12] hackeron: has joined #RubyOnRails
[01:57:12] hackeron: has joined #ruby

2015-12-06

[15:26:49] hackeron: Ping timeout: 245 seconds
[15:27:42] hackeron: has joined #RubyOnRails
[15:27:42] hackeron: has joined #ruby
[16:58:35] hackeron: Ping timeout: 260 seconds

2015-12-04

[17:14:19] hackeron: Ping timeout: 245 seconds
[17:15:25] hackeron: has joined #RubyOnRails
[17:15:25] hackeron: has joined #ruby

2015-12-02

[15:35:50] hackeron: *.net *.split
[16:28:43] hackeron: has joined #RubyOnRails
[16:28:45] hackeron: has joined #ruby

2015-12-01

[20:05:30] hackeron: Ping timeout: 260 seconds
[20:07:11] hackeron: has joined #RubyOnRails
[20:07:11] hackeron: has joined #ruby

2015-11-30

[02:27:38] hackeron: Ping timeout: 257 seconds
[08:31:19] hackeron: has joined #RubyOnRails
[08:31:19] hackeron: has joined #ruby

2015-11-24

[15:28:11] hackeron: Ping timeout: 276 seconds

2015-11-22

[03:45:53] hackeron: *.net *.split
[03:56:02] hackeron: has joined #ruby
[03:56:04] hackeron: has joined #RubyOnRails

2015-11-21

[07:27:16] hackeron: Ping timeout: 244 seconds
[07:27:39] hackeron: has joined #RubyOnRails
[07:27:39] hackeron: has joined #ruby

2015-11-18

[19:13:49] hackeron: Remote host closed the connection
[19:23:08] hackeron: has joined #ruby
[19:23:09] hackeron: has joined #RubyOnRails

2015-11-13

[13:07:41] hackeron: Ping timeout: 246 seconds
[13:08:32] hackeron: has joined #RubyOnRails
[13:08:32] hackeron: has joined #ruby

2015-11-05

[18:45:43] hackeron: Ping timeout: 272 seconds
[18:46:15] hackeron: has joined #ruby
[18:46:16] hackeron: has joined #RubyOnRails

2015-11-04

[02:07:04] hackeron: has joined #RubyOnRails
[02:07:04] hackeron: has joined #ruby

2015-11-03

[13:22:17] hackeron: Ping timeout: 240 seconds
[13:22:58] hackeron: has joined #RubyOnRails
[13:22:58] hackeron: has joined #ruby
[14:14:07] hackeron: Ping timeout: 260 seconds

2015-10-18

[19:35:37] hackeron: jhass: but the question is, what is the public/private key generated by?
[19:37:40] hackeron: jhass: yeh, but any RSA key with various sizes I generate wither with openssl genrsa or with ssh-keygen -t rsa seems to look different and not accepted by the caemra - just returns an Invalid XML Content
[19:40:08] hackeron: jhass: NjUzNzU2MGUwZWNiN2UxNjYzZmE4ZWU5MjQ1ODljMWIwNzg3NDAxMDM2NmFhZGEwNTczOTZmMzIzNjkyNTNkYTNhZjE0YzI3MzI3NmZjOTc1ZDZiYzY0YmEwZGE0OGY2M2U1MzQ1ZmY3N2ZiYjg0NzJjNjE5ZmZiYTJhNWRkMWUxNzk3YTdlODZlYjEyZWQ0NDBlN2Q2YTJhZjM3NTMyZGRhNzI2MDAzMzVhYTJkYWVkMzEzODFlODc3NTMyYTMwMTc2OTczZmZiYWMwZGM0NjQ4NWZhNzVkMTU2MjBkN2JjMTk3ODZiMGEzYjk1OWZmYzdkZTlkYzM2ZTgwZGE1Zg==
[19:40:19] hackeron: jhass: with base64 -D it shows: 6537560e0ecb7e1663fa8ee924589c1b07874010366aada057396f32369253da3af14c273276fc975d6bc64ba0da48f63e5345ff77fbb8472c619ffba2a5dd1e1797a7e86eb12ed440e7d6a2af37532dda72600335aa2daed31381e877532a30176973ffbac0dc46485fa75d15620d7bc19786b0a3b959ffc7de9dc36e80da5f
[19:42:09] hackeron: jhass: thank you for looking at this :)
[19:45:05] hackeron: jhass: it's not, when I POST the example - the camera responds with a challenge
[19:45:15] hackeron: jhass: when I post anything I generated with openssl or ssh-genkey, it says invalid XML
[19:46:03] hackeron: jhass: so the question is, what is this and how do you generate your own, heh
[19:51:17] hackeron: jhass: nope, just that document - they have not provided anything else at all :/
[20:02:23] hackeron: jhass: any wild guesses, heh?
[20:05:55] hackeron: jhass: yeh :/ - I know they are a windows shop, they are a fan of SOAP and what not, maybe this is how C# generated public keys look like or something? - whatever they use doesn't appear to be something standard
[20:06:08] hackeron: which is why I guess they have (or at least used to have) a terrible reputation for security
[20:09:05] hackeron: jhass: hmm, very peculiar - but they mention RSA and they mention AES128 there - so how are they taking that and generating a 256byte public key, hmmmm
[20:13:45] hackeron: jhass: haha, I like your thinking - but it sounds pretty retarded on their part :/ - why would anyone do this
[20:16:45] hackeron: jhass: just a thought, maybe they are using some javascript library since this key is POSTed to the camera web interface?
[20:17:40] hackeron: when I look at the html source I see .script("../script/encryption.js").wait()
[20:17:41] hackeron: .script("../script/cryptico.min.js").wait()
[20:17:41] hackeron: .script("../script/AES.js").wait()
[20:20:14] hackeron: jhass: cryptico.publicKeyString(rsakey) - Returns the public key portion of an RSAKey object in ascii-armored string form
[20:20:26] hackeron: jhass: bingo?
[20:34:17] hackeron: jhass: found this in the javascript source: http://pastie.org/10491503
[20:35:33] hackeron: jhass: any way to replicate that in Ruby?
[20:38:32] hackeron: jhass: we do - essentially it does cryptico.generateRSAKey(new Date + '', 1024) - then sends the ascii-armored version as a POST request
[20:40:14] hackeron: adaedra: haha, I don't know, but that's what hikvision do
[20:49:01] hackeron: jhass: small change: Base64.encode64(RSA::KeyPair.generate(1024, 3).public.modulus.to_s(16)).gsub("\n", '')
[20:49:15] hackeron: jhass: getting a challenge response from the camera :D
[20:54:06] hackeron: jhass: so now the camera responds with a challenge 17c68103d1310baca6b65c1702d9510f39314d5e4740c3768d24290ee9f641dd6d07c22f2c219e90ac6d8a2050b2cf893a6b304aef53ee0c7673f1f28d6f02dbfb7142f79f27a130aa78524ec9729380bdbfb8845370cec01038f132f155898f0704ad2be165340e0bc980be57116cdfa951e4f7db4578be3bf711b2916b9600 - how do I now go backwards to decode it, heh?
[20:54:11] hackeron: jhass: ah, yes, good point!
[20:55:27] hackeron: jhass: rsa_key.decrypt(val)
[20:55:28] hackeron: ArgumentError: ciphertext representative out of range
[20:55:44] hackeron: jhass: I think I need to convert this ascii stuff to a valid ciphertext?
[20:56:35] hackeron: rsa_key.decrypt('MTdjNjgxMDNkMTMxMGJhY2E2YjY1YzE3MDJkOTUxMGYzOTMxNGQ1ZTQ3NDBjMzc2OGQyNDI5MGVlOWY2NDFkZDZkMDdjMjJmMmMyMTllOTBhYzZkOGEyMDUwYjJjZjg5M2E2YjMwNGFlZjUzZWUwYzc2NzNmMWYyOGQ2ZjAyZGJmYjcxNDJmNzlmMjdhMTMwYWE3ODUyNGVjOTcyOTM4MGJkYmZiODg0NTM3MGNlYzAxMDM4ZjEzMmYxNTU4OThmMDcwNGFkMmJlMTY1MzQwZTBiYzk4MGJlNTcxMTZjZGZhOTUxZTRmN2RiNDU3OGJlM2JmNzExYjI5MTZiOTYwMA==')
[20:56:40] hackeron: ArgumentError: ciphertext representative out of range
[20:59:56] hackeron: hmm: rsa_key.decrypt([Base64.decode64(response)].pack("H*"))
[20:59:57] hackeron: => "n\xFD\xC8\xD0\x89\xF6\x8Eiq\xE3_B\xC6\xC0\xFA\xF5-\f[\xFDl`cN\"\xDC\xA6\n\x97\x1D\xF7\xDD\xB8gD\xD4\x9F\x98\xDC\x98\x91\f\xA4\xFF\x0F\xDF\xBE\xA7\x8B\x05\xD69\\\x10\x13Z\x12\xAA\xEF\xE5h\x1D\xE1\\\x1Eqz\xA3m\xD8^\x97\x94\x1F\\\xBE0\xFAY*\x04\xE0\x97#=@h9)\xC4\xC5syXI\x1Dd*\xD5+\xDF\xE1\x1C>;\x9F\x13j)\xDF\xA9\xED@7\x8E\xE1\x01\x91\xE9r\xDD\xAF\x1F\xA9\x0E\xDDda"
[21:12:50] hackeron: jhass: struggling with the last step, I'm doing this: http://pastie.org/10491570 -- does that look right?
[21:13:21] hackeron: jhass: getting an invalid XML content from the camera :(
[21:15:29] hackeron: jhass: no, but I tried both with an without, hmmm
[21:47:40] hackeron: jhass: just diggin in the javascript, it's doing this: Base64.encode(aes_encrypt(response_copy.substring(0, 16), response, !0) + aes_encrypt(password, response, !0)) -- wtf?
[21:57:47] hackeron: it seems the !0 is to indicate that the key is in ascii and not in hex, hmmm
[23:18:35] hackeron: jhass: still can't get this to work :( - quick question though, when you said to do challenge.pack("H*") how do you know it's not "h*" or something else?
[23:23:43] hackeron: jhass: hmm, going to try emailing the manufacturer - their activation API manual is just pointless :/
[23:27:28] hackeron: jhass: thank you very much for all your help and getting this far, heh :)
[23:32:43] hackeron: jhass: this is what I have so far btw: http://pastie.org/10491795