Categories
Mastering Development

Facing issue querying google datastore

Here’s the part of the code var Ctx = context.Background() DSClient, err := datastore.NewClient(Ctx, PROJECT_ID) if err != nil { log.Fatal(“Couldn’t connect to DataStore: “, err) } log.Print(“DataStore Client: “, DSClient) q := datastore.NewQuery(“users”).Filter(“email=”, greq.Email).Limit(1) keys, err := config.DSClient.GetAll(config.Ctx, q, &urs) I’m getting following error. http: panic serving 127.0.0.1:60844: runtime error: invalid memory address or […]

Categories
Development

How do i reinterpter_cast vector to int? [closed]

I’ve got a vector of four bytes: std::vector<int8_t> src = { 0x0, 0x0, 0x27, 0x10 };, which in hexadecimal is 10000. (0x2710) How do i type-pun it into an int32_t so that i get 10.000 using reinterpret_cast? This can be done easily using bitshifts like this: (int32_t)((src[offset] << 24) | (src[offset+ 1] << 16) | […]

Categories
Development

How can I initialise struct’s map field using reflection

How can I initialise struct’s map field using reflection ? Sample code that panics and I want to make it work. https://play.golang.org/p/vPp6QcMmwiK panic: reflect: reflect.flag.mustBeAssignable using unaddressable value goroutine 1 [running]: reflect.flag.mustBeAssignableSlow(0x15, 0x0) /usr/local/go/src/reflect/value.go:247 +0x180 reflect.flag.mustBeAssignable(…) /usr/local/go/src/reflect/value.go:234 reflect.Value.Set(0x101ec0, 0x0, 0x15, 0x101ec0, 0x43e280, 0x15) /usr/local/go/src/reflect/value.go:1531 +0x40 main.main() /tmp/sandbox776916734/prog.go:21 +0x200

Categories
Development

Cannot run fabcar example in Hyperledger Fabric on Windows

I am on Windows 10 home and have all the pre-requisites installed. I am having trouble running the Fabcar example of Hyperledger Fabric. I am in fabric-samples\fabcar folder and using Docker Quickstart Terminal of Docker Toolbox to run the terminal command ./startFabric.sh javascript I am getting the error: ./startFabric.sh javascript Stopping for channel ‘mychannel’ with […]

Categories
Development

Heroku Go WebApp Error – Connection Closed Without Response

I’m trying to deploy a Golang app in Heroku. I’m getting a H13 error and I don’t know how to fix it. The app queries a database and returns a table of results. The database is small, the query is small. It runs locally on port 8080, no problem at all. The H13 Error documentation […]

Categories
Development

Calling x86 local function using shellcode

I would like to use redirect the flow to a local function and then returning to the original one using a shellcode. I defined two simple functions and use objdump to get their assembly code: // unsigned char *g_code = “\x55\x48\x89\xe5\xb8\x2a\x00\x00\x00\x5d\xc3”; int g() { return 42; } // unsigned char *f_code_original = “\x55\x48\x89\xe5\x48\x83\xec\x10\xb8\x00\x00\x00\x00\xe8\x00\x00\x00\x00\x89\x45\xfc\xb8\x2a\x00\x00\x00\xc9\xc3”; int f() […]

Categories
Development Linux Ubuntu

How to make i3 contain “Always on top windows” in i3+KDE setup?

The issue The Plasma “Add Widget” window is always on top, and due to this i3wm is unable to tile it. Also, since it is outside i3’s management, hence I can’t focus on it as well, which prohibits me from providing any keyboard input to it. Using xdootool to focus the window works as indicated […]

Categories
Development

EnumProcessModules returns 0 with error 299

I’m currently trying to enumerate all the modules of a supsended 32-bits process I’ve previously created from my 32-bits program, my Windows is 64-bits. (I’ve already read all the other topics on that problem). Here is the code: let a = CreateProcessA( “C:\\Program Files (x86)\\GlassWire\\GlassWire.exe\0”.as_ptr(), null_mut(), null_mut(), null_mut(), false, 0x00000004, null_mut(), null_mut(), SI, PI); println!(“{}”, […]

Categories
Development

panic: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)

I am trying to auto-scale with HPA with kafka metrics as per the steps given in this URL https://medium.com/google-cloud/kubernetes-hpa-autoscaling-with-kafka-metrics-88a671497f07 However, when I am deploying the yaml file given in step 3, the pod doesn’t come up. The log displays the below error. panic: kafka: client has run out of available brokers to talk to (Is […]

Categories
Development System & Network

secureboot with parrotOS – not able to sign custom kernel

I’ve installed Parrot OS on my surface and built the custom kernel for the surface from jakeday repo. I’m currently trying to sign my custom kernel that I can turn on secureboot again. I’ve followed the guide(https://github.com/jakeday/linux-surface/blob/master/SIGNING.md) and all works fine until step 5. After rebooting (with enabled & disabled secureboot) the “blue screen of […]