How to reset ether balances of accounts in Ganache UI? - ganache

I tried the restart option but it doesn't change anything
low balance
restart option in settings

Hey there same issue here.
Restart option is for restarting the Ganache not to reset the balances to 100 ETH.
So to get all accounts back to 100 simply create a new workspace and use it.
I think it is easier.

Same issue here with the non-functional reset button in the Ganache GUI. Don't know how to reset yet but I found a temporary work around (at least until the Ether runs out of all 10 accounts!)
Connected both the seed account (seed) and the receiving account (rcvg) to MetaMask and then sent rcvg the funds in seed. Worked even with 0 WEI to pay for gas!

Related

MVC5 controller (POST) being called twice (once a week)

I have a C# WebApp MVC5. Everything usually works perfectly, users create invoices every minute, there are 10 users making invoices concurrently in different locations and different machines.
The issue happens once a week.
In the logs, I can see the post is called twice at the same time by the same user, I see some network lag on the client-side when this happens, but I'm not able to reproduce it, even using the network utility of chrome DevTools to simulate network lag.
Of course, I can add some business validation before persisting the data into the database in order to avoid duplicate data, but that's not the real issue.
I've read on the internet it would be because IIS Http2 is enabled and should be disabled, so I've done that a couple of weeks ago, but the error is still occurring.
This is not an issue of an "unintentional double click on a button", I'm pretty sure is not because I make sure to disable the button once it is clicked and enabled back once the server returns a response.
See the logs: the first one takes 9002ms to completes while the second one takes 444ms. That's the network lag I've identified so far because this post usually takes less than a second to completes.
2021-09-22 16:21:41 167.86.95.177 POST /Sales/Invoices/Save - 443 jnamicela 45.225.105.89 Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/93.0.4577.82+Safari/537.36 https://xpertdynamics.com/Home/Index 200 0 1236 9002
2021-09-22 16:21:41 167.86.95.177 POST /Sales/Invoices/Save - 443 jnamicela 45.225.105.89 Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/93.0.4577.82+Safari/537.36 https://xpertdynamics.com/Home/Index 200 0 0 444
It's solved. It was an issue on client-side. Basically they have unstable internet connection. When they click on the 'save' button and in the middle of the process they unspecteclly lose internet connection, the jquery.post will go directly to the post.fail, but the request was successfully sent to the server, it is just the browser that doesn't know it because internet connection was lost. So the user clicks on the 'save' button once again.
I just included a validation step before calling jquery.post. It is: check for internet connection using navigator.onLine, if yes, then check for the user session is still alive. if(true && true) then call jquery.post.
I've been monitoring since 3 weeks ago, and the error never happened again.

FreeRadius in combination with a vulnerability scan / software status check

What i have:
I am running a freeradius server fully configured of how i need it to be. Everything works just fine right now.
What i need:
I need the radius to put the devices in a seperate vlan before authentication and to run a vulnerability scan (nessus / openvas etc) on the devices in this vlan to check for software status ( antivirus etc. )
if the device passes the test the authentication should be done normaly.
if it fails it should be put into a third ( fourth if you count the unauth-vid ) vlan.
can someone tell me if this is doable in freeradius ?
thanks in advance for your answers
Yes. But this is a very broad question and is dependent on the networking equipment being used. I'll give you an overview of how I'd design such a system.
In general, you'll have an easier time if you can use the same DHCP server/IP range for your NAC and full access VLAN. That means you don't have to signal the higher networking layers in the client that there's been a state change, you can swap out VLANs behind the scenes to change what they can access.
You'd set up a database with an entry for each client. This doesn't have to be pre-populated, it could be populated during the first auth attempt. Part of each client entry would be a status field detailing when they last completed NAC.
You'd also need an accounting database, to store information about where each client is connected to the network.
If the client had never completed NAC checks before, you'd assign the client to the NAC VLAN, and signal your NAC processes to start interrogating it.
FreeRADIUS can act as both a RADIUS and DHCPv4 server, so you'd probably do signal the NAC process from the DHCPv4 side because then you'd know what IP the client received.
Binding the RADIUS and DHCPv4 sides can be done in a couple of ways. The most obvious is MAC, another common way is NAS/Port ID using the accounting table.
Once the NAC checks had completed, you'd have the NAC process write out a receipt in detail file format, and have that read back in by a detail file listener (there are examples of this in sites-available/ in the 'decoupled-accounting' virtual server files). When reading those entries back in, you'd change the state in the database, and send a CoA packet to the switch using information from the accounting database to identify the client. This would flip the VLAN and allow them to the standard set of networking resources.
I know this is very high level, documenting it properly would probably exceed StackOverflow's character limit. If you need more help with this, I suggest you research what I've described above and then start asking the RADIUS related questions on the FreeRADIUS user's mailing list https://freeradius.org/support/.

Azure Bot Service using over 1GB of data transfer out per day. Why? How can I stop that?

I created a QnA bot using the Azure Bot service, and now I'm seeing data transfers out of my subscription of over 1 GB a day! I cannot figure out why, but since it's billable, I'd like to know why and how I can stop it.
The bot isn't being used yet, so no one is sending queries to it. I'm confused how this is happening.
Here's a screen shot of the graph for use in the last hour as well as a screen shot of the billing for the last few days showing the sudden jump in use.
Is this normal?
If you add AzureWebJobsDisableHomepage with a value of true, to the App settings, the data out will stop.
The setting itself is documented here: https://github.com/Azure/azure-webjobs-sdk-script/wiki/Configuration-Settings (although it doesn't provide an explanation for how this setting affects a bot specifically)
The reasoning behind what is happening is a little complex. Azure Functions are not normally "in memory" and available all the time. There is a small spinup time that is not ideal within a bot. So, apparently there is a job setup with consumption plan bots to ping it every 10 seconds (and by 'ping', i mean retrieve the root of the site). If you open the Log Stream, you'll see an http get request every 10 seconds. Adding AzureWebJobsDisableHomepage doesn't disable the request, but changes the status of what is returned from "OK" to "NoContent".
This will be added to the Bot Service arm template soon (so future consumption plan bots do not automatically accrue these data usages).

Application Insights for AzureWebsite showing GET / requests every five minutes even after deleting availability test

I have a production Azure website that I deployed a few days ago. I saw the "Availability" section in application insights (configured server side AI and client side AI is enabled right now) and through the new portal (portal.azure.com) I decided to set up availability "ping" test.
I left the majority of the settings at the default, Test Type was URL ping test, the URL is set to the root of my app, and frequency is 5 minutes. I left the test locations to the default of 5 in the different US regions.
What I noticed was that all the tests failed and I saw a lot of requests in my app for GET / with a status of 404. Since it was filling up my application insights request log with junk, and the availability test registered all failures, I deleted the availability test. Annoyingly after deleting, I noticed it was still there after refreshing the page, so I deleted it again and now it shows as "Not configured" and seems to be truly gone.
Before I deleted the availability test, I saw all these GET / requests in my AI logs and I looked at their IP addresses, they indeed seemed to come from the different US regions.
After I deleted the test, I assumed they would all stop. Unfortunately that did not happen, all but 1 of the 5 ping tests stopped but the one from with IP address as ::1 still seems to be happening. For almost a week that ping test still occurs every 5 minutes even though I deleted it.
How to remove the availability test completely from application insights?
The request that you see every 5 minutes is likely caused by the Always On feature, which uses it to keep the site alive. It is not related to the availability test.
You can verify that by temporarily turning off Always On and verifying that those requests stop.

Prevent users from copying ClickOnce application

I have a ClickOnce app in .NET 4.0;
How can i prevent users from copying the whole installation directory from one machine to another?
I don't need a solution that can't be hacked(if there's one), but i need one to stop everyday users from doing this;
I already tried the following:
Store the MAC address when the app is installed, and try to match it every time the app starts - this didn't work because users might use wired or wireless connections;
Match the HDD serial key - it doesn't work for WinXP;
Some extra info that might help:
I'm keeping track of my customers in a DB: when a customer requests the product, i add a new record ; When they run the app for the first time, the app asks for the ProdId, and changes the status so they can't install it again using the same ProdId;

Resources