A lot of tutorials are showing you how to create embedded forms with associations/relations — what about unrelated entities?
I figured out you can pass the second entity as a parameter to the parent form, pass it normally to the embedded form via the ‘data’ parameter, which will let the embedded form update the object. Then just persist() the object back in the controller like normal. No crazy data/request wrangling necessary! Continue reading
Sometimes you really need to know what computers on your network were doing yesterday at noon, because you get a nastygram from the MPAA about bittorrent demanding that you do something — but bittorrent is notoriously hard to block.
You can try installing BandwidthD on your Pfsense router, to see who’s using a bunch of bandwidth at that time, and you can look back through DHCP or WiFi logs to see who was connected at the time, but the complaint letter tells you the exact time and port number used. Wouldn’t it be cool if you could log that?
Here’s what I came up with. Download the Cron package for Pfsense, and add a new Cron job:
Command: pfctl -ss | egrep '(>.*>|<.*<)' | logger
The firewall states (who is connected to what) will now dump to your system log every hour — kinda noisy, but also kinda effective for tracking long downloads on random ports.
Coming from Rails, I know that DRY (don’t repeat yourself) is a virtue. In my Symfony PHP project, I was faced with copy-pasting a hundred lines in order to test a bunch of methods in PHPUnit. So, I wrote a quick wrapper to take in the arguments as minimally as possible instead of cluttering up the code with tons of duplicate syntax: https://gist.github.com/zyphlar/c959b2d66bce1c10c637
How The Internet Really Works: A Hands-On Crash Course from Ethernet to HTTP using Wireshark
Whether you’re a hacker, IT pro, coder, or just curious, it helps to know exactly how the Internet works: you may understand the idea of connections, but do you understand all the protocols and steps that it takes to create and troubleshoot a connection?
Ever wondered what exactly happens between typing “google.com” into the address bar and seeing the webpage appear on your screen? Do you know what would happen if two computers had slightly different subnet masks, or how ARP spoofing works, or what exactly the Kaminsky DNS attack was, or what happens when you plug a switch back into itself?
This was presented at CactusCon 2014, and the slides / wireshark captures are available here: how-internet-works.zip (the slides are sparse; turn on notes to see what I said for each slide.) If you don’t have PowerPoint, you can download LibreOffice (free) or see the SlideShare.
Also note that this is a semester worth of Networking 101 presented in about an hour; this is enough to get you started Googling for topics of interest and hopefully a gut feeling for all the different things happening during a typical connection, but some bits are omitted– please do more research in order to get a complete understanding. Open Wireshark yourself and send out your own traffic; read books or tutorials, consider certification classes like Network+, Security+, or Cisco.
Finally, I’m happy to answer questions in the comments or on twitter @willbradley .
Just in case you can’t see the notes attached to the slides, here’s my full notes below: Continue reading
Many people have been asking me about starting hackerspaces/makerspaces lately. I’m going to use this post to aggregate their questions and my answers.
What do you think about doing a Kickstarter for seed money?
It’s possible, but “the HeatSync Way” is to find your people first. To do this kind of endeavor it seems like you need 5-15 “good people” who are prepared to stick around for at least a year of creating this business — as a hobby, with perhaps 2-5 hours per week commitment. Continue reading