Category Archives : Coding


Bootstrap repo with bazel

Useful commands: Generate deps.bzl (which contains all the go_repository) bazel run //:gazelle — update-repos –from_file=go.mod –to_macro=deps.bzl%go_dependencies –build_file_proto_mode=disable Automatically create build files bazel run //:gazelle update — -repo_root . Need following comment in WORKSPACE file so external go_repositories (in deps.bzl) are visible: gazelle:go_visibility public


No donation for xmrig (monero mining)

Prebuilt xmrig requires 1% donation. To get rid of this: git clone xmrig’s repo. Change src/donation.h to: constexpr const int kDefaultDonateLevel = 0;constexpr const int kMinimumDonateLevel = 0; Now need to build it. Follow instructions here: https://xmrig.com/docs/miner/build/windows But customs stuff I did: Create folder c:\xmrig-deps Download the most recent version of prebuilt dependencies  by using the green Code button and Download […]


Web security

I participated in a work event regarding web security, where I had to hack 5 seemingly innocuous websites to learn about web vulnerabilities.  By hack, I mean just execute alert().  In case I get amnesia, here’re some notes.   1. simple javascript injection. There was an input textbox, where I had to simply put in: […]


MP3 streaming for apple iphone with php readfile file_get_contents fail

For the actual content, see:  http://mobiforge.com/developing/story/content-delivery-mobile-devices   But I must jot the solution down, as I spent a great deal of time struggling with setting headers and calling readfile($filename) with php to make ipod/iphone/ipad play/stream mp3, to no avail. On a related note, I had to do header(“location: <url to mp3>”) as a workaround for […]