How can I get system uptime programmatically on the chrome-os platform? - google-chrome-os

System uptime is available in chrome without enabling the developer mode via the crosh window and the command top. I'd like to be able to access this programmatically within my chrome app. I'm not seeing it jump out at me in the chrome apis here.
Uptime usually includes both the load average and the time since the last boot-up. I'm mostly interested in the time since the last boot-up.
How can I get system uptime programmatically on the chrome-os platform - without enabling developer mode?

I do not have a chrome development environment set up at the moment, or I'd try. But chrome.system.cpu.getInfo() looks like it will give you what you want. Note that the processors array gives cumulative time (total) that may be equivalent to time since last boot.
See https://developer.chrome.com/apps/system_cpu.

Related

Internet Explorer High CPU usage

Situation and Problem: We are working with Citrix + Windows Terminal Server 2012 R2 and we are experiencing that a single Internet Explorer (Version 11.0.96) process can use up to 60-80% of CPU-Power. Since there are 15 user working on one Server any given time, one or two users can disturb all the others by using all the available CPU-Power.
First (insufficient) Solution: To overcome this Problem, We changed the Internet Explorer shortcut from the users startmenue (tile-design menue): We are starting the Internet Explorer just with three cores (out of 6 core) with this command:
start /Affinity 7 iexplorer.exe
Problem: If the users start the Internet Explorer from a link (out of word, Outlook or wherever), the Internet Explorer is starting again with all six cores.
Question: Is there a way to start the iexplorer.exe process (Independent from the starting point) always with less cores, or is it possible to limit the CPU-usage for a specific process..?
That's just two possibilities I'm thinking about, if you have other solutions in mind, feel free :)
Thanks and greetings Kevin
Many reasons can cause this issue, Like due to issue in a update, due to homepage, due to add on.
So you need to check one by one that what thing cause this issue.
You can try steps below and check whether CPU consumption reduced or not.
(1) On the General Tab click Tabs button and unchecked the option "Show Previews for individual tabs in the task bar".
(2) Go to the "Advanced" tab in "Internet Options" and checked "Use software rendering instead of GPU rendering".
(3) Temporarily disable all the add on and turn on them one by one and check the consumed memory every time. If if you find any add on consume high CPU then remove it from IE.
(4) Try to check whether issue caused by a faulty update.
You can also try to refer MSDN article below and if you are using that specific update then try to apply the hot fix may solve your issue.
Internet Explorer 11 consumes high memory and CPU cycles after you install update MS15-106

Running Malware In VirtualBox

For a project I am working on I want to collect data of malware in a virtualbox for 30 seconds and then revert the VirtualBox back to its original state and repeat this process 500 times for 500 different malware links that I have in a txt file. Before I revert to the normal VirtualBox state, I want to collect data from a program that is monitoring that malware. What is the best way to do this?
Edit: I'd also like to point out that I have code to read the opcodes that are being used by the application. All I would like to do is automate this process for the virtualbox.
I am not aware of such a feature in virtualbox or vmware but you can always use third party tools to compare the state of the different parts (like registry) before and after the execution of malwares.
I heard Ashampoo unistaller is a great tool to do the job but personally never tested it before.
Another option is to use sanboxes like sandboxie or cuckoo sandbox to capture the changes.
Another option is to use online sandboxes like hybrid-analysis which is perfect for what you want to do.
Just keep in mind that most malwares use anti-VM techniques to prevent execution in VMs so you probably will not be able to capture all the features of the malwares.
Hope it helps.

How to test chrome.alarms api?

I have a chrome extension that uses several alarms scheduled to trigger every hour, every day, etc.
Testing alarm-related features is a pain for our testers, because they need to change system time. What they actually do:
close chrome
open system date/time dialog
move system date ahead
open chrome
Could anybody suggest more convenient ways to make functional tests of chrome alarms?
We check on both windows and OSX.

How to implement a trial period for a objective c/cocoa mac osx app?

I'm getting started with Objective C and Cocoa on Mac and i would like to develop a app that will have a trial period of 30 days for example like most of the apps have.
How can this be implemented on Mac OSX? Do i store somewhere the installation date and then on each run i check for that? Or what is the general way of achieving this?
That is certainly one way to check the expiry of a trial, but I've found that implementing time based trials can be troublesome when dealing with slightly cleverer users.
If you use a time trial (i.e. 30 days) how do you check the time? You can store the time that the app was installed, and you can read the current time to work out the difference, but how can you guarantee the time(s) you are reading is correct. The user may have edited one or both of these values. (By changing your stored value if it's not encrypted or by changing the system time).
You could use the Internet to verify the time, but what would you do if the user isn't connected to the Internet?
I'm sure there will be more sophisticated ways of checking how long the user has had the program installed, but I'm afraid I can't enlighten you to any.
I'd consider one of the alternatives methods of providing a trial:
Number of times the app has been started - (take into account that your app may crash, or the user may keep the app open). You may wish to count instead, the number of days on which the app has been opened and allow the user to open the app on 15 different days.
Restricted Content - Make a separate target for your app with less content. This is a safer way to ensure that the user can't work around your restrictions, but it's also more work for them to install a separate version. Consider that you may lose some sales.

App launch sequencer

Every morning when I get into work I launch about a dozen apps and whatnot (FF, TB, VSx2-3, Eclipse, SSH, SVN update x2-3). Needles to say this does a good job of warming up my HDD for the day. I rather suspect that it would run a lot faster if they were launched sequentially (not to mention that I wouldn't need to click in 17 different places).
Is there a preexisting product that can kick off a sequence of tasks/apps/etc. where each task is only started after the last app is done hammering the HDD?
It would nerd to be able to kick apps like VS and firefox and also be able to trigger explorer context menu items like SVN update in TortoiseSVN.
Try SlickRun, it's free, I've used it for years, I use it constantly and I'd be lost without it.
Think of it like a configurable Start->Run command, it'll do what you want (you can configure n second pauses between multiple commands), and if you install it you'll use it for a thousand different things before the first week is out.
P.S. I have no stake in SlickRun, I just like it :)
Unfortunately, I don't know of any software that can do this for you automatically.
However, can't you trigger the updates through a console SVN task? If so, can't this be done by creating a batch file? It's low tech, and you might want to add a few pauses between each task, but it should do what you want.
As you mention TortoiseSVN, I'll assume your O/S is windows.
You could launch an Autohotkey script at startup. I don't think it can easily detect HDD activity, but you can at least wait until each window appears with the WinWaitActive command.
If each application has an average time they take to complete, you could simply use Windows' Scheduled Tasks application. Obviously you'll need to be running Windows but Scheduled Tasks can be found in the Control Panel.
Execute "Add Schedules Task", select the program, the frequency and then the specific time.