#why is github using up 3 GIGAbytes of memory
Explore tagged Tumblr posts
Text
reblog to kill one web developer with hammers
#why is github using up 3 GIGAbytes of memory#itd also be useful if the firefox task manager showed more info about extensions#but if its anything like chrome extensions it probably couldnt even if it wanted to
16 notes
·
View notes
Text
PRTG Sensor Condensing With PowerShell
If you are an administrator in an enterprise environment there is a good change you know about PRTG Network Monitoring. This is a great application for monitoring all kinds of application data, resource usage, whatever you heart desires data for devices in a network. It has an auto-discovery feature that recommends sensors and discovers new devices. When PRTG recommends sensors they typically monitor one thing. The licensing is mostly based on how many sensors you have paid for. When you start reaching your limit and the budget is tight because the IT department is short on funds this may be a solution for you. The sensor I made for this purpose can be found on my GitHub page HERE.
The PRTG sensors that monitor CPU, Memory, and Disk Space use Windows Management Instrumentation (WMI). WMI is being replaced with the Common Information Model (CIM) in Windows devices. WMI was Microsofts original interpretation of CIMv2. CIM is a vendor-independent standard for describing the hardware and OS components of computer systems and providing tools that a program can use to both read and modify components. Remote Management using WMI is considered a security risk and should be avoided when possible. Info on that wil lbe for another blog. These are some of the many reasons I use CIM whenever possible. Why would Windows change the way they identify objects inside their Object Based Operating System you ask? Great question.
The only real thing the CIM cmdlets can’t do that WMI can is access amended qualifiers such as the class description. Many classes do not set this attribute which has not been a hardship for me at least. The way WMI is set up, combined with the length of time it has been around has caused the names of objects to be duplicated. This means different namespaces contain classes and instances with the same name which can get confusing and cause scripts to respond in unintended ways. CIM eliminates this issue as well as a few other bullet points I placed below.
Use of WSMAN for remote access (This means no more DCOM errors. You can drop back to DCOM for accessing systems with WSMAN2 installed)
Use of CIM sessions allows for accessing multiple machines
Get-CIMClass can be utilized for investigating WMI classes
Improves dealing with WMI associations
The phenomenally detailed documentation at PRTG for creating Custom Sensors can be found HERE. The way these sensors work with PRTG is a bat script or a ps1 script are run. The results are than placed into an XML format the PRTG Server interprets and displays for the admin monitoring the network devices. The sensor at my GitHub page is considered and EXE/Advanced Custom Sensor because it returns the XML output where as a Standard EXE sensor only returns a single true or false result. The PRTG sensors are usually only monitoring one thing because we do not want to overload a sensor with information. The max amount of sensor result fields allowed was somewhere between 50 and 60. That is an easy number to stay under however if CPU usage gets to high, inaccurate results may be produced.
In the code below what we are doing is creating a CIM Session to a remote device and running three commands inside that CIM Session as opposed to opening a session, issue the command, close the session three separate times. This will save us time and resources. We are using a CIM Session and not a PsSession because CIM sessions add the security of not allowing execution of arbitrary commands and return arbitrary objects. They also provide a unique benefit of taking up fewer system resources. CIM sessions stay dormant in the background of a Windows PowerShell session until an instruction is received.
$CimSessionOptions = New-CimSessionOption -UseSsl
$CIMSession = New-CimSession -ComputerName $Device -SessionOption $CimSessionOptions
$OS = Get-CimInstance -CimSession $CIMSession -ClassName "Win32_OperatingSystem"
$CPUs = Get-CimInstance -CimSession $CIMSession -ClassName "Win32_Processor"
$Disks = Get-CimInstance -CimSession $CIMSession -ClassName "Win32_LogicalDisk" | Where-Object -Property 'DriveType' -eq 3
SIDE NOTE: If your environment is not configured to use WinRM over HTTPS you should look at doing that. It allows you to use the -UseSsl parameter with ease and in many other cases where you want to ensure there is an extra layer of encryption protecting any information going over the wire.
You may have noticed above that the variable $Device is used in the -ComputerName parameter. If we were creating a PowerShell module it is best practice to use $ComputerName as the variable name. I did this because PRTG expects certain placeholder values to be set. If I renamed that variable to $ComputerName the PRTG sensor would fail to connect to the remote host. More info on that can be found HERE. When adding the custom sensor in PRTG we need to enter the place holder value in the following format.
'%device'
In the ps1 file, the $Device parameter is set and will be matched to the value of the device name. If you use Auto-Discover in PRTG you may need to rename some of the devices as Auto-Discover will name things with an extra extension such as [Windows SQL Server] or something along those lines. That entire name gets placed into the $Device variable which means the sensor is trying to contact a device that doesn't exist. An Example of how this is entered can be seen below.
'Write EXE result to disk' is selected as this is great for troubleshooting any issues that may be happening with the sensor. The latest result is always logged on the PRTG server in the following directory. C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors). This is extremely handy when trying to format your XML labels with the correct names and values. If you set a value of Bytes to become Gigabytes you will still see the Bytes value in this log file. This is because PRTG converts these values in their web application and not the XML parser.
Mutex Name is a great section they added. When you have a script running on multiple remote devices, you want there to be a limit on how many can run at once otherwise they might all run at once. Any devices that have a Mutex Name of R5 will run together. Any devices with a sensor that has a Mutex Value of DirkaDirka will run together. This way you are able to define how many instances of the script can be run at once.
After creating the EXE/Advanced sensor you will need to place it in the C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML directory. This way it will be available when you go to create the sensor and select it from a drop down menu inside the PRTG application. Once all is said and done my sensor will return results that look like the image below.
We are able to set the Warning and Alert values using the XML format defined by PRTG. The XML does need to be beautified in order for the sensor to work correctly. The below is a PowerShell function that I used to beautify the output.
There are a few fields that are commented out that can easily be added to the PRTG final sensor by just copying them from the comments inside the $XML variable between tags. I left out the below fields but feel free to add them and add your own Error and Warning limits if desired. It is very fun.
Read official blog post here: https://roberthosborne.com/f/prtg-sensor-condensing-with-powershell
0 notes
Text
RisingStack Best of - The Most Popular Node.js Tutorials of 2017
2017 was a remarkable year for Node.js, according to Mark Hinkle - Executive Director of the Node Foundation - and we couldn’t agree more. Node.js has an enviable position in the world of tech: There are more than 8.8 million Node instances online every day which number has grown significantly in the past year. The number of Node.js contributors has increased from 1,100 to 1,500 in the past year, and there are 3 billion npm downloads every week.
The Node industry is clearly booming.
2017 has been an eventful one for RisingStack as well. This year has been rich in learning opportunities for us, and we made sure to create a plethora of new tutorials aimed at not only beginner, but advanced Node developers as well. We covered Microservices & new Node features too. We are thrilled to see that more than 1,5 million users learned something from us in 2017.
This also means that the number of developers who rely on the RisingStack blog for learning Node.js doubled over the past year.
We have numerous new ideas to write about in 2018; exciting tutorials, in-depth case studies, new features of Node, and much more. However, to prepare for the upcoming challenges & to say goodbye properly to 2017, we collected our best articles from this year.
We used hard data like pageviews, shares & search results to determine the most-liked articles we created in 2017. Here they come:
1. 10 Best Practices for Writing Node.js REST APIs
Our number one article of 2017 walks you through the 10 best practices for writing REST APIs. You’ll learn how to use HTTP methods, API Routes, and HTTP status correctly. We’ll also help to test your Node.js REST APIs, and select the right framework for doing it.
Authentication, the usage of conditional requests, rate limiting and creating API documentation are also essential factors of writing Node.js REST APIs, all of which are covered in this collection.
2. Node.js Interview Questions and Answers (2017 Edition)
Are you planning to interview a Node.js developer? Or are you the Node developer who is about to get interviewed? We have good news for both of you!
We renewed our previous Node Q&A with up-to-date information for 2017. This updated version includes promises, Yarn, how to secure HTTP cookies against XSS attacks, and how to make sure your dependencies are safe.
With the help of this comprehensive Q&A collection, you can quickly revise the most important topics of Node.
3. Designing a Microservices Architecture for Failure
Based on the Node.js Consulting & Development experience we gained at RisingStack in the past 4 years, we collected the most common techniques and architecture patterns which we recommend to use if you’d like to build and operate highly available microservices.
Communicating over a network instead of in-memory calls brings extra latency and complexity to a microservices system which requires cooperation between multiple physical and logical components. It’s crucial to get this cooperation right, so in this article, we discuss the risk of implementing microservices and patterns which help you detect, isolate and resolve issues.
4. Mastering Async/Await in Node.js
Asynchronous constructs have been around in other languages for a while. With the release of Node.js 8, the long awaited async functions have landed in Node.js as well.
In this article, you will learn how you can simplify your callback or Promise based Node.js application with async functions (async/await).
If you liked the good old concepts of if-else conditionals and for/while loops, or if you believe that a try-catch block is the way errors are meant to be handled, you will have a great time rewriting your services using async/await.
5. Node.js + MySQL Example: Handling 100's of GigaBytes of Data
In this Node.js & MySQL example project, you can learn how to effectively handle billions of rows of data that take up hundreds of gigabytes of storage space. We’ll take a look at table partitioning with an example and show you how to add and remove data from your database.
This article proves that ACID compliant DBMS solutions such as MySQL can be used when you are handling large amounts of data, so you don't necessarily need to give up the features of transactional databases.
6. Yarn vs npm - The State of Node.js Package Managers
Npm 4 became the default package manager with Node 7.4, but at the same time, Facebook also launched its own package manager called Yarn.
Let's take a look at the state of Node.js package managers, what they can do for you, and when you should pick which one!
7. Node.js Async Best Practices & Avoiding the Callback Hell
Make sure to avoid the despised callback hell! We collected the best tools and techniques to handle async operations: async.js, promises, generator-based flow control, and async functions.
Stick to these rules to keep things smooth:
Prefer async over sync API, because using a non-blocking approach gives superior performance over the synchronous scenario.
Always use the best fitting flow control or a mix of them in order reduce the time spent waiting for I/O to complete.
8. The Important Features and Fixes of Node.js Version 8
The long-awaited Node 8 was released on the 30th of May. It arrived with a bunch of new features and improvements, and in this post, we go through the most important ones. Let’s revise the async hooks API, the N-API, and other notable changes in Node 8.
Also, during the year, there were other releases that we covered on our blog.
When Node.js 8.4.0 arrived, we introduced the most important aspects of HTTP/2 Server Push and showed you how to create a small Node.js app that uses it.
Then, we got excited about the new features of Node.js 8.5, so we created another post, dealing with ECMAScript Modules, Performance Hooks & the filesystem module .
9. Building an API Gateway using Node.js
What is an API gateway and why do we need it? In this article we go through the process of routing and versioning, authentication, data aggregation, serialisation, protocol transformation, and we’ll also see how to build an example API gateway.
We’ll discuss why is it so important to define clear responsibilities for our API Gateways and to include only generic shared logic. API gateways help to keep your services small and domain-focused, so it’s essential to get them right.
10. Building a Node.js App with TypeScript Tutorial
In this article we created an example project, where we show you how to build, structure, test, and debug a Node.js application written in TypeScript. We discuss what Typescript is and why is it beneficial to use it, as well as how to start a project with it. We cover adding linters, writing tests, and debugging.
11. Getting Node.js Testing and TDD Right
Think about your future self! Would you like to work on code that's not tested properly? If not, read this guide on getting testing and TDD (test-driven development) right. Test driven development is a methodology for writing the tests first for a given module and for the actual implementation afterward.
This guide includes most of what we do here at RisingStack with TDD:
writing failing tests
writing code that satisfies our tests
and refactoring.
12. Node.js Performance Monitoring with Prometheus
In this article, we discuss what to monitor exactly when you have a Node.js application in production. We tell how to instrument your system, what to consider when selecting your monitoring tool, and why we recommend Prometheus to use as a self hosted monitoring suite.
We also included our example repo, which can help you with more in-depth advice in case you'll choose this way of monitoring your Node.js application.
13. Writing fast and safe native Node.js modules with Rust
What can you do when you reach the maximum speed that Node.js has to offer? To increase the performance of your application, a possible solution is to write native modules with Rust instead of C++. It is a great choice thanks to the safety and ease of use it provides.
In this article, we’re going to walk you through the steps of writing a modern, fast and safe native module.
14. Consumer Driven Contract Testing with Pact
At RisingStack we love working with Microservices, as this kind of architecture gives us flexibility and speed. In this article we show how you can perform consumer driven contract testing in your Node.js microservices architecture with the Pact framework.
We’ll go through creating a mock server with Pact for our client-side unit tests, gathering them with Pact Broker and verifying them against our running server - making sure that the consumer and provider are on the same page.
15. Writing a JavaScript Framework - Client-Side Routing
In this post, you can read about client-side routing in Javascript. We’ll discuss how is it different from server-side routing and why should it be treated differently. This blogpost is the last part of the author’s “Writing a JavaScript Framework” series.
The series is about an open-source client-side framework, called NX. During the series, Bertalan explains the main difficulties he had to overcome while writing the framework.
15 + 1. How I Survived RisingStack’s Node.js Bootcamp
Robert Czinege joined RisingStack this summer as a promising & talented junior developer, but he still needed to learn how we build amazing Node.js apps for our clients.
In his article, he talks about going through RisingStack’s Node.js Bootcamp, which helped him to get up to speed with the rest of the team. By the way, this bootcamp is available for everyone interested in learning Node.js - since we open sourced it on GitHub. So sucker punch imposter syndrome and kickstart learning Node.js!
Other meaningful achievements of 2017
And that’s not it. We were proud to organise and sponsor Nodeconf Budapest in 2017 January, which brought together the sharpest minds from the enterprise and the finest Node.js talent that Central-Europe has to offer. This conference served as a refreshing event for the Node community.
We were stoked to see experts like Danny Grander who talked about the importance of writing secure code or Daniel Khan, who shared what he learned over his 17-year career as a web developer; just to mention a few.
Another huge event in the life of RisingStack was that by the end of summer, we partnered up with Keymetrics & merged Trace - our Node.js Monitoring platform with their solution.
We were busy during this autumn as well, since we kicked off our European Node.js Tour which contained trainings on Node fundamentals, Microservices & Security as well. We’ll continue to provide trainings from the spring of 2018, widening our portfolio with React & Kubernetes events too.
As you see, the past year was eventful for us at Risingstack. We are excited about the new year, and we have a lot of plans & expectations for it. Also, thanks for following our path & reading our blog - it’s a pleasure to have such a great audience. <3
Stay tuned for more great news and tutorials from us in 2018 as well!
RisingStack Best of - The Most Popular Node.js Tutorials of 2017 published first on http://ift.tt/2w7iA1y
0 notes
Text
RisingStack Best of - The Most Popular Node.js Tutorials of 2017
2017 was a remarkable year for Node.js, according to Mark Hinkle - Executive Director of the Node Foundation - and we couldn’t agree more. Node.js has an enviable position in the world of tech: There are more than 8.8 million Node instances online every day which number has grown significantly in the past year. The number of Node.js contributors has increased from 1,100 to 1,500 in the past year, and there are 3 billion npm downloads every week.
The Node industry is clearly booming.
2017 has been an eventful one for RisingStack as well. This year has been rich in learning opportunities for us, and we made sure to create a plethora of new tutorials aimed at not only beginner, but advanced Node developers as well. We covered Microservices & new Node features too. We are thrilled to see that more than 1,5 million users learned something from us in 2017.
This also means that the number of developers who rely on the RisingStack blog for learning Node.js doubled over the past year.
We have numerous new ideas to write about in 2018; exciting tutorials, in-depth case studies, new features of Node, and much more. However, to prepare for the upcoming challenges & to say goodbye properly to 2017, we collected our best articles from this year.
We used hard data like pageviews, shares & search results to determine the most-liked articles we created in 2017. Here they come:
1. 10 Best Practices for Writing Node.js REST APIs
Our number one article of 2017 walks you through the 10 best practices for writing REST APIs. You’ll learn how to use HTTP methods, API Routes, and HTTP status correctly. We’ll also help to test your Node.js REST APIs, and select the right framework for doing it.
Authentication, the usage of conditional requests, rate limiting and creating API documentation are also essential factors of writing Node.js REST APIs, all of which are covered in this collection.
2. Node.js Interview Questions and Answers (2017 Edition)
Are you planning to interview a Node.js developer? Or are you the Node developer who is about to get interviewed? We have good news for both of you!
We renewed our previous Node Q&A with up-to-date information for 2017. This updated version includes promises, Yarn, how to secure HTTP cookies against XSS attacks, and how to make sure your dependencies are safe.
With the help of this comprehensive Q&A collection, you can quickly revise the most important topics of Node.
3. Designing a Microservices Architecture for Failure
Based on the Node.js Consulting & Development experience we gained at RisingStack in the past 4 years, we collected the most common techniques and architecture patterns which we recommend to use if you’d like to build and operate highly available microservices.
Communicating over a network instead of in-memory calls brings extra latency and complexity to a microservices system which requires cooperation between multiple physical and logical components. It’s crucial to get this cooperation right, so in this article, we discuss the risk of implementing microservices and patterns which help you detect, isolate and resolve issues.
4. Mastering Async/Await in Node.js
Asynchronous constructs have been around in other languages for a while. With the release of Node.js 8, the long awaited async functions have landed in Node.js as well.
In this article, you will learn how you can simplify your callback or Promise based Node.js application with async functions (async/await).
If you liked the good old concepts of if-else conditionals and for/while loops, or if you believe that a try-catch block is the way errors are meant to be handled, you will have a great time rewriting your services using async/await.
5. Node.js + MySQL Example: Handling 100's of GigaBytes of Data
In this Node.js & MySQL example project, you can learn how to effectively handle billions of rows of data that take up hundreds of gigabytes of storage space. We’ll take a look at table partitioning with an example and show you how to add and remove data from your database.
This article proves that ACID compliant DBMS solutions such as MySQL can be used when you are handling large amounts of data, so you don't necessarily need to give up the features of transactional databases.
6. Yarn vs npm - The State of Node.js Package Managers
Npm 4 became the default package manager with Node 7.4, but at the same time, Facebook also launched its own package manager called Yarn.
Let's take a look at the state of Node.js package managers, what they can do for you, and when you should pick which one!
7. Node.js Async Best Practices & Avoiding the Callback Hell
Make sure to avoid the despised callback hell! We collected the best tools and techniques to handle async operations: async.js, promises, generator-based flow control, and async functions.
Stick to these rules to keep things smooth:
Prefer async over sync API, because using a non-blocking approach gives superior performance over the synchronous scenario.
Always use the best fitting flow control or a mix of them in order reduce the time spent waiting for I/O to complete.
8. The Important Features and Fixes of Node.js Version 8
The long-awaited Node 8 was released on the 30th of May. It arrived with a bunch of new features and improvements, and in this post, we go through the most important ones. Let’s revise the async hooks API, the N-API, and other notable changes in Node 8.
Also, during the year, there were other releases that we covered on our blog.
When Node.js 8.4.0 arrived, we introduced the most important aspects of HTTP/2 Server Push and showed you how to create a small Node.js app that uses it.
Then, we got excited about the new features of Node.js 8.5, so we created another post, dealing with ECMAScript Modules, Performance Hooks & the filesystem module .
9. Building an API Gateway using Node.js
What is an API gateway and why do we need it? In this article we go through the process of routing and versioning, authentication, data aggregation, serialisation, protocol transformation, and we’ll also see how to build an example API gateway.
We’ll discuss why is it so important to define clear responsibilities for our API Gateways and to include only generic shared logic. API gateways help to keep your services small and domain-focused, so it’s essential to get them right.
10. Building a Node.js App with TypeScript Tutorial
In this article we created an example project, where we show you how to build, structure, test, and debug a Node.js application written in TypeScript. We discuss what Typescript is and why is it beneficial to use it, as well as how to start a project with it. We cover adding linters, writing tests, and debugging.
11. Getting Node.js Testing and TDD Right
Think about your future self! Would you like to work on code that's not tested properly? If not, read this guide on getting testing and TDD (test-driven development) right. Test driven development is a methodology for writing the tests first for a given module and for the actual implementation afterward.
This guide includes most of what we do here at RisingStack with TDD:
writing failing tests
writing code that satisfies our tests
and refactoring.
12. Node.js Performance Monitoring with Prometheus
In this article, we discuss what to monitor exactly when you have a Node.js application in production. We tell how to instrument your system, what to consider when selecting your monitoring tool, and why we recommend Prometheus to use as a self hosted monitoring suite.
We also included our example repo, which can help you with more in-depth advice in case you'll choose this way of monitoring your Node.js application.
13. Writing fast and safe native Node.js modules with Rust
What can you do when you reach the maximum speed that Node.js has to offer? To increase the performance of your application, a possible solution is to write native modules with Rust instead of C++. It is a great choice thanks to the safety and ease of use it provides.
In this article, we’re going to walk you through the steps of writing a modern, fast and safe native module.
14. Consumer Driven Contract Testing with Pact
At RisingStack we love working with Microservices, as this kind of architecture gives us flexibility and speed. In this article we show how you can perform consumer driven contract testing in your Node.js microservices architecture with the Pact framework.
We’ll go through creating a mock server with Pact for our client-side unit tests, gathering them with Pact Broker and verifying them against our running server - making sure that the consumer and provider are on the same page.
15. Writing a JavaScript Framework - Client-Side Routing
In this post, you can read about client-side routing in Javascript. We’ll discuss how is it different from server-side routing and why should it be treated differently. This blogpost is the last part of the author’s “Writing a JavaScript Framework” series.
The series is about an open-source client-side framework, called NX. During the series, Bertalan explains the main difficulties he had to overcome while writing the framework.
15 + 1. How I Survived RisingStack’s Node.js Bootcamp
Robert Czinege joined RisingStack this summer as a promising & talented junior developer, but he still needed to learn how we build amazing Node.js apps for our clients.
In his article, he talks about going through RisingStack’s Node.js Bootcamp, which helped him to get up to speed with the rest of the team. By the way, this bootcamp is available for everyone interested in learning Node.js - since we open sourced it on GitHub. So sucker punch imposter syndrome and kickstart learning Node.js!
Other meaningful achievements of 2017
And that’s not it. We were proud to organise and sponsor Nodeconf Budapest in 2017 January, which brought together the sharpest minds from the enterprise and the finest Node.js talent that Central-Europe has to offer. This conference served as a refreshing event for the Node community.
We were stoked to see experts like Danny Grander who talked about the importance of writing secure code or Daniel Khan, who shared what he learned over his 17-year career as a web developer; just to mention a few.
Another huge event in the life of RisingStack was that by the end of summer, we partnered up with Keymetrics & merged Trace - our Node.js Monitoring platform with their solution.
We were busy during this autumn as well, since we kicked off our European Node.js Tour which contained trainings on Node fundamentals, Microservices & Security as well. We’ll continue to provide trainings from the spring of 2018, widening our portfolio with React & Kubernetes events too.
As you see, the past year was eventful for us at Risingstack. We are excited about the new year, and we have a lot of plans & expectations for it. Also, thanks for following our path & reading our blog - it’s a pleasure to have such a great audience. <3
Stay tuned for more great news and tutorials from us in 2018 as well!
RisingStack Best of - The Most Popular Node.js Tutorials of 2017 published first on http://ift.tt/2fA8nUr
0 notes