Posted by & filed under Server Admin.

I came across this today and had to share. The latest version of Process Explorer has native integration with VirusTotal This means you can have Process Explorer analyze the processes running and compare them with the VirusTotal database.

Process Explorer 16 w/ VirusTotal integration

Enable:

Usage:

  • Select options -> Check VirusTotal.com to initiate a scan of the processes. The VirusTotal column will populate with scores for the process.
  • Click a score to be taken to the detailed results on VirusTotal.
    procexp-vtuse-2

How It Works:

  • Creates a SHA256 hash of the file.
  • Submits to VirusTotal.
  • The hash of the process is then looked up in VirusTotal’s database, and the results are displayed in Process Explorer.

Posted by & filed under PHP, Programming.

Error reporting is disabled server wide. But for a development project, we need it turned on. Adding a php.ini file with the following directives will get the job done:

This will cause PHP to write out the error to a file in the same directory as the script called error.log. Adjust to your liking.

Another option, is to set the display_errors flag to true. This is not a recommended practice as it can expose sensitive information that should never be sent to clients. In a closed dev environment though it can be handy especially if you do not have a way to easily tail the log file.

Posted by & filed under PHP, Programming.

Two simple ways to convert a ActiveRecord object into a array:

  1. Using cHTML::ListDatause CHtml::listData (see www.yiiframework.com/wiki/48/by-example-… )

    It will give you array id => city
  2. Using array_map (used this method last time, array_map rocks):

 

Posted by & filed under .Net, Programming.

Looks like async development got a whole lot easier in .Net 4.5:

 

Visual Studio 2012 introduces a simplified approach, async programming, that leverages asynchronous support in the .NET Framework 4.5 and the Windows Runtime. The compiler does the difficult work that the developer used to do, and your application retains a logical structure that resembles synchronous code. As a result, you get all the advantages of asynchronous programming with a fraction of the effort.

This topic contains the following sections.

MSDN

 

msdn.microsoft.com/en-us/library/hh19144…

Posted by & filed under Software, Windows.

Chocolatey is similar to yum or apt-get for linux users, but for windows users. It allows the user to quickly install a variety of packages (apps) from the command line… as of this writing there are 1375 unique packages available.


chocolatey

Running Chocolatey is cake… heh heh heh. For example, to install Firefox:

 

Posted by & filed under Linux, Server Admin.

As a followup to my previous note , I am adding an additional one-liner that is extremely helpful.

Obviously, you can adjust the -n param in the head command to return the top 20 for example.

Posted by & filed under Server Admin.

Backing up the account
– Log-in via SSH as Root user

– Run the pkgacct command to package the account into a tar file:

The account backup will be created in the current working directory.

Restoring the account
– Log-in via SSH as Root user

– Run the restorepkg command to restore the cpbackup archive. Make sure you are in the same directory as the backup file

If the account already exists, you may need for force the restore:

There are also options to specify the account’s IP address, etc.

Posted by & filed under Server Admin.

Today I needed to begin migrating databases from my live server to the new dedicated database server. The first step is to identify the tables to be moved.

Login to the server as per normal

Then list out the tables to find the one(s) we need to move:

For this example, we will move the “test” database. The next step is to create the new empty test database on the remote server:

The next step is to use the mysqldump command to extract the contents of the current test database and pipe it to the new server database:

Once this command completes, the database will be on both servers.

Posted by & filed under Automotive, EFI Tuning.

DTN0003_Introduction_to_PID_Control%5B1%5D

What is PID?
PID stands for Proportional, Integral, and Derivative and is a type of feedback control system. It
compares a measured value (from a sensor, say) against a desired value (the setpoint or aim) and
adjusts outputs to reduce the difference (error) between the two.
The controller (or ECU in our case) uses a constantly updating calculation to control a physical
system. It looks at the current value of the error, the integral of the error over a recent time interval,
and the current derivative of the error signal to determine not only how much of a correction to
apply, but for how long.

A Real World Analogy
Think of a driver with no brakes wishes to stop a car at a set of lights. The driver is using the
accelerator pedal to give the car forward movement to get to the lights. The closer the car gets
the less the driver pushes on the accelerator pedal. The amount of throttle is the Proportional Gain.
The Driver is relying on the car to slow down because of rolling friction between the tires and the
road. If the driver is trying to get to the lights quickly, more throttle will be used.
The problem is that if the driver relies solely on the rolling friction to stop the car, they may roll
straight past the lights and then need to put the car into reverse and head back. This could
happen several times before the car comes to rest at the lights and the faster the driver tries to get
there, (better system response) the worse the over/undershooting problem becomes.
Now consider if the driver also has a braking system. When approaching the lights they can reduce
the amount of throttle to slow the car and also apply the brakes to reduce the speed. The brakes
act as the Derivative component of the system. It is logical to suggest that with the throttle and
brakes the driver can now get to and stop at the lights with greater ease and generally more
quickly, with less over/undershoot.
Now consider the driver has to do this when the lights are on a slight upward sloping hill. The driver
can perform the stopping exercise using the throttle and brakes but the car will start rolling
backwards when it is stopped. The driver now needs to apply a little bit of throttle (assume the
brakes are ONLY for reducing speed and not to stop movement) to hold the car at the stopping
point so it does not roll backwards, this is the Integral component of the system.
It can be seen that if the same driver has a very powerful car, the amount of throttle and brake
needed to get to the set of lights is different to the amount of throttle and brake needed for a less
powerful car. Obviously the high powered car will get the job done quicker but with more energy
needed and therefore more stress on the equipment.

Posted by & filed under Server Admin.

I typically use the dd utility in linux to create large files for testing various things. Today I needed to create a large file in a windows machine. One option is to use dd on a linux box to create the file, and then scp the file over to the windows box. This would work, but is a bit inefficient. After a bit of research I found that fsutil.exe will create files. Below is the same command in dd and fsutil:

dd:

fsutil:

Syntax is: fsutil file createnew <filename> <length in bytes>

Posted by & filed under Uncategorized.

I needed to quickly rename a bunch of file extensions in a directory. This one liner made quick work of it:

basename, when given a file name and a extension spits out something like this:

Which we then use to append the proper extension (.jpg) in the example and done.

Posted by & filed under Javascript, Programming, Web Development.

How does it work?

This code checks/unchecks all checkboxes within the same fieldset. Simple and semantic.

HTML Setup

Add checkboxes however you like, just make sure they are within the same fieldset.

And the jQuery to go along with it:

Source: briancray.com/posts/check-all-jquery-jav…