One liner: To get available virtual memory
10 December 2011
vmstat -s -SM | grep "free memory" | awk -F" " '{print$1}'
vmstat -s -SM | grep "free memory" | awk -F" " '{print$1}'
When it comes to software development, a robust and efficient build script can be a game-changer. Whether you’re working on a Java project or any other type of application, the right build script can streamline the whole process and make life a whole lot easier for developers. Here’s a rundown of some best practices to keep in mind when you’re writing your build script: Platform Independence # Choose a programming language that is compatible across multiple platforms, especially if you’re working on a Java project. ...
How to Solve the Puppet Error: Could not find class in namespace # Sometimes, when working with Puppet, you may encounter an error message that does not accurately reflect the actual problem. For example, if you see this error: err: Could not retrieve catalog: Could not find class php in namespaces standardbuild at /etc/puppet/manifests/templates.pp:15 on domain.internal.com One of the possible causes could be a missing curly bracket in your code. ...
How to install PHP development files If you want to run phpize on your system, you need to install the development files of PHP first. Otherwise, you might get an error message like this: sh: phpize: not found ERROR: `phpize' failed To install the PHP development files on Ubuntu/Debian, you can use the following command in the terminal: apt-get install php5-dev That should solve the problem. 🙂
To find the system load use the following perl snippet : System load of last one minute : my $system_load = exec('<a class="zem_slink" title="Uptime" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uptime">uptime</a> | awk -F "load average: " \'{ print $2 }\' | cut -d, -f1'); my $system_load = qx('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f1'); System load of last 5 minutes : my $system_load = exec('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f2'); my $system_load = qx('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f2'); System load of last 15 minutes : my $system_load = exec('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f3'); my $system_load = qx('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f3');
If you get the following error while running the client code : Can’t call method “syswrite” on an undefined value at /usr/local/share/perl/5.10.1/Gearman/Taskset.pm line 202. … then change this $client->job_servers('127.0.0.1'); to $client->job_servers('127.0.0.1:4730'); thats it ! 🙂
Just as there is no one right programming language for every application, there is no one right way to develop the more detailed specifications. Different environments call for different techniques, and the requirements managers and requirements writers will probably need to develop a mix of skills suited to various circumstances.
Why Programmers Want to Start Over Have you ever felt the urge to scrap your code and rewrite it from scratch? If so, you’re not alone. Many programmers have this temptation, and there’s a hidden reason behind it. The reason is not that the old code is bad, but that it’s hard to understand. There’s a fundamental principle of programming that explains this: Reading code is harder than writing it. This is why reusing code is so challenging. ...
Google came up with a new programming language called Go, which is supposed to be super fast and awesome and stuff. But do we really need another language? I mean, come on. It’s hard enough to keep up with the ones we already have. Go has some cool things going on, like goroutines, channels and interfaces. But it also has some weird things, like no generics, no exceptions and no inheritance. ...
The economy is changing rapidly, and developers need to keep up with the latest trends and skills to stay relevant and competitive. Here is a list of 9 skills that every developer should master or at least be familiar with in the next five years. This list is not comprehensive, and it does not cover every niche or specialty in the industry. However, for most mainstream development scenarios, these skills will give you an edge over others and help you create better solutions. ...