Friday, July 20, 2012

Virtual manipulation

Today everything is virtual, phones, services and especially computers!
One of the first companies that realized the potential in virtualization is VMware.

Using their easy-to-use yet powerful software, VMware introduced a product called VMware Workstation to the market that changed the SOHO/SMB industry and ESX that changed the enterprise industry, as we know it.

The basic idea behind it was simple: if you need a software product to run on several environments, why not use the same hardware?

While Workstation allows users to virtualize a couple of virtual machines, ESX can manage hundreds if not thousands of virtual machines. Both products are considered the top-of-the-line today, and set the industry standard.

Each product achieves its performance/scalability by different assumptions on different environments/hardware. Because of that, several features exist on Workstation for smaller scale management, but are not included on the ESX product (which sucks by the way).

Since most of my work involves ESX and I LOVE Workstation, I thought why not try to mix the two to fill in the gaps and allow enterprise users to enjoy the full potential of the VMware product line. as expected, VMware was nice enough to provide admins with a nice, easy-to-use command-line interface. All I have to do is fill in the blanks.

Naturally, I chose Python for the task and created a short wrapper to allow fellow Pythoneers (developers in the Python language) to enjoy a simple API using the command line interface via SSH.

  1: class ESX_Wrapper(object):
  2:   def __init__(self):
  3:     import paramiko
  4:     from string import strip
  5:     self.ssh = paramiko.SSHClient()
  6:     self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  7: 
  8:   def Connect(self, ip, usr, passwd):
  9:     from socket import error
 10:     try:
 11:       print "Establishing SSH connection to the server... ",
 12:       self.ssh.connect(ip, username=usr, password=passwd)
 13: 
 14:     except error:
 15:       print "unreachable!"
 16:       raise SystemExit
 17: 
 18:     except KeyboardInterrupt:
 19:       print "aborted by user!"
 20: 
 21:     else:
 22:       print "done!"
 23: 
 24:   def ListAllVirtualMachines(self):
 25:     stdin, stdout, stderr = self.ssh.exec_command("vim-cmd vmsvc/getallvms")
 26:     vms = stdout.readlines()
 27:     print "\nVirtual Machines\n================\n"
 28:     for i in xrange(len(vms)):
 29:       print vms[i],
 30: 
 31:   def MapVMIDtoNameInDict(self):
 32:     print "\nMapping VMIDs to Names... ",
 33:     stdin, stdout, stderr = self.ssh.exec_command("vim-cmd vmsvc/getallvms")
 34:     vms = stdout.readlines()
 35:     self.dict = {}
 36:     for i in xrange(len(vms)):
 37:       for j in xrange(4):
 38:         if vms[i][j].isdigit() == False:
 39:           if j !=0 and vms[i][j-1].isdigit() == True:
 40:             self.dict.update({int(vms[i][j-1]):self.GetVMName(int(vms[i][j-1]))})
 41:     print "done!"
 42:     return self.dict
 43: 
 44:   def GetVMName(self, vmid):
 45:     command = "vim-cmd vmsvc/get.summary "
 46:     command += str(vmid) + " |grep name |awk -F '\"' \'{print $2}\'"
 47:     stdin, stdout, stderr = self.ssh.exec_command(command)
 48:     return str(stdout.readlines()).strip("[]'\\n")
 49: 
 50:   def GetVMStatus(self, vmid):
 51:     command = "vim-cmd vmsvc/power.getstate " + str(vmid)
 52:     stdin, stdout, stderr = self.ssh.exec_command(command)
 53:     vm_status = stdout.readlines()
 54:     print "\nMachine Status\n=============="
 55:     for i in xrange(len(vm_status)):
 56:       print vm_status[i],
 57: 
 58:   def TurnOffVM(self, vmid):
 59:     command = "vim-cmd vmsvc/power.off " + str(vmid)
 60:     stdin, stdout, stderr = self.ssh.exec_command(command)
 61:     return stdout.readlines()
 62: 
 63:   def ForceVMShutdown(self, vmid):
 64:     command = "vim-cmd vmsvc/shutdown.off " + str(vmid)
 65:     stdin, stdout, stderr = self.ssh.exec_command(command)
 66:     return stdout.readlines()
 67: 
 68:   def TurnOnVM(self, vmid):
 69:     command = "vim-cmd vmsvc/power.on " + str(vmid)
 70:     stdin, stdout, stderr = self.ssh.exec_command(command)
 71:     return stdout.readlines()
 72: 
 73:   def RebootVM(self, vmid):
 74:     command = "vim-cmd vmsvc/power.reboot " + str(vmid)
 75:     stdin, stdout, stderr = self.ssh.exec_command(command)
 76:     return stdout.readlines()
 77: 
 78:   def SuspendVM(self, vmid):
 79:     command = "vim-cmd vmsvc/power.suspend " + str(vmid)
 80:     stdin, stdout, stderr = self.ssh.exec_command(command)
 81:     return stdout.readlines()
 82: 
 83:   def WakeFromSuspend(self, vmid):
 84:     command = "vim-cmd vmsvc/power.on " + str(vmid)
 85:     stdin, stdout, stderr = self.ssh.exec_command(command)
 86:     return stdout.readlines()
 87: 
 88:   def CreateSnapshot(self, vmid, snapshotName, snapshotDesc="", includeMemory=""):
 89:     base_string = str(vmid) + " " + snapshotName
 90:     if snapshotDesc !="":
 91:       base_string = base_string + " " + "\"" + snapshotDesc + "\""
 92: 
 93:     if includeMemory !="":
 94:       base_string = base_string + " " + includeMemory
 95: 
 96:     command = "vim-cmd vmsvc/snapshot.create " + base_string
 97:     stdin, stdout, stderr = self.ssh.exec_command(command)
 98:     return stdout.readlines()
 99: 
100:   def RevertToSnapshot(self, vmid, testid=1, suppressPowerOff="yes"):
101:     base_string = str(vmid) + " " + str(testid) + " " + suppressPowerOff
102:     command = "vim-cmd vmsvc/snapshot.revert " + base_string
103:     stdin, stdout, stderr = self.ssh.exec_command(command)
104:     return stdout.readlines()

The constructor uses the paramiko library to connect to the ESX, and send the command-line requests via SSH. The class may look a bit clumsy, but I prefer it this way for readability.


A sample use of this class:

  1: def main():
  2:   dict = {}
  3:   esx_object = ESX_Wrapper()
  4:   esx_object.Connect("192.168.2.2","root", "password")
  5:   esx_object.ListAllVirtualMachines()
  6:   dict = esx_object.MapVMIDtoNameInDict()
  7:   machine_vmid = raw_input("Specify the machine vmid you wish to turn on: ")
  8:   machine_name = dict[int(machine_vmid)]
  9:   print "Sending TurnOn command to " + machine_name + "... ",
 10:   esx_object.TurnOnVM(machine_vmid)
 11:   print "sent!"
 12: 
 13: if __name__ == '__main__':
 14:   main()

Hope you’ll find it useful as I did…


Cheers,
at0m q[^_^]p

Tuesday, June 26, 2012

EMC² Data Science Competition

The EMC Center of Excellence in Israel Launches the First Local Big Data Science Competition of its Kind, are you up for the challenge?
The EMC Israel COE has launched a Big Data competition open to the Israeli data science community on Kaggle.com, the winner of which will receive a cash prize of $10,000. The competition, which will run until August 2012, is geared towards individuals, groups (of up to five people) and startup companies, and is aimed at increasing awareness of Big Data and the data science profession in particular, while contributing to the creation of new algorithms. EMC Israel invites all those with a background/experience in machine learning, mathematics, statistics, computing, economics and physics – and any other interested parties, to try their luck in solving the challenge that awaits them at the site. Those who enter the competition will receive a real database from an open source code containing thousands of files; the challenge is based on the automatic identification of content, and the prize will go to the party that comes up with the ideal algorithm.



About EMC²

EMC Corporation develops, delivers, and supports the information and virtual infrastructure technologies and solutions. The company offers enterprise storage systems and software, which are deployed in storage area networks (SAN), networked attached storage (NAS), unified storage combining NAS and SAN, object storage, and/or direct attached storage environments, as well as provides backup and recovery, and disaster recovery and archiving solutions. It also offers information security solutions in various areas, such as enterprise governance, risk and compliance, data loss prevention, security information management, continuous network monitoring, fraud protection, identity assurance and access control, and encryption and key management. In addition, the company provides information intelligence software, solutions, and services, including EMC Captiva for intelligent enterprise capture; EMC Document Sciences for customer communications management; EMC Kazeon for e-discovery; EMC Documentum xCP for building business solutions and an action engine for big data; and the EMC Documentum platform for managing and delivering enterprise information. Further, it offers virtual and cloud infrastructure products, such as virtualization and virtualization-based cloud infrastructure solutions that address a range of IT problems, as well as facilitate access to cloud computing capacity, business continuity, software lifecycle management, and corporate end-user computing device management. In addition, the company provides consulting, technology deployment, managed, customer support, and training and certification services. EMC Corporation markets its products through direct sales and through multiple distribution channels in North America, Latin America, Europe, the Middle East, South Africa, and the Asia Pacific region. The company was founded in 1979 and is headquartered in Hopkinton, Massachusetts.

Sunday, April 22, 2012

Windows Power Options, meet Python

According to Mac users, the world is divided into two main groups: those who use Macs and everyone else.

Not much of a fan of Apple’s products, but even I can’t deny they’re doing a great job with keeping a high uptime laptops using a precise power consumption control. Using power options built into drivers, with an operating system built from ground-up optimized for long use and with breakthrough battery technology, Macs today have the best energy efficient systems out there.

Although Windows lack a high level of power consumption, it offers a good infrastructure for developers.

My initial approach was to allow Windows to recognize some of the uses I make of my computer, and adapt itself accordingly.

There are two ways to accomplish this:

  1. Monitor processes via Windows Task Manager. If a known process was detected, act accordingly and change the power scheme.
  2. Monitor the currently active window by interacting with Windows GUI. If a known process was detected, act accordingly and change the power scheme.

Method 1

Advantages:

  1. See the big picture, If a user minimize the window for several seconds you’ll still be able to determine what’s running in the background.

Disadvantages:

  1. If a user minimize a known process, the code needs to be adjusted to detect the process is not in use.
  2. Additional coding is required to avoid conflicts between processes. If a user minimizes two known processes, the code should adjust itself.
  3. To efficiently scan the process list, the code should either enumerate every process which can take up the very same resources we’re trying to save, or query only for known processes, which can take up some memory maintaining such process list.

Method 2

Advantages:

  1. The code is always relevant to what the user is currently doing
  2. No need to enumerate the entire process list, only fetching the active window from the GUI using Windows API.

Disadvantages:

  1. In case a user minimizes a program, it can greatly affect its performance.
  2. Since the code doesn’t know the user intention, and since the user can minimize a program just for a couple of seconds, it is possible that switching several power schemes in a short time may affect your hardware in the long run.

Combining method 2 with a short grace period between fetching the active window, can eliminate disadvantage #2. Assuming enough power schemes will be created, it is possible to avoid disadvantage #1.

Let’s get busy
  1: #-------------------------------------------------------------------------
  2: # Name:        ActiveWindowSniffer
  3: # Author:      at0m
  4: # Created:     22/04/2012
  5: # Copyright:   (c) at0m 2012
  6: #-------------------------------------------------------------------------
  7: 
  8: #!/usr/bin/env python
  9: 
 10: import win32gui
 11: from time import sleep
 12: from subprocess import call
 13: from re import findall
 14: 
 15: w=win32gui
 16: powerschemes = {"Balanced":"381b4222-f694-41f0-9685-ff5bb260df2e",
 17:                 "Adobe Audition": "7a601a49-8d15-46d2-8160-55163f627070",
 18:                 "Internet":"8b12c7c4-a5e9-4e27-9283-338dc2138c2e",
 19:                 "Internet-Media":"b0e87387-1585-4351-894c-267adb53e563",
 20:                 "High Performance":"8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c",
 21:                 "Power Saver":"a1841308-3541-4fab-bc81-f71556f20b4a",
 22:                 "Balanced_TB_ON":"b18511ef-e34a-4f4b-85e7-2ea5cd1ac989",
 23:                 "Shuteye":"d7925c9e-bfc0-47d7-98c3-028edd2acb81",
 24:                 "Reading":"7c2951ff-7d0e-4609-9f68-d6428869cf5e",
 25:                 "Video Optimized":"e21061ef-9975-4822-9af5-6215c973a982"}
 26: 
 27: while True:
 28:     try:
 29:         sleep(15)
 30:         active_window = w.GetWindowText (w.GetForegroundWindow())
 31:         print_string = str(active_window) + " was detected, adjusting"
 32:         print print_string
 33: 
 34:         if "Mozilla Firefox" in active_window:
 35:             if "YouTube" in active_window or "Facebook" in active_window:
 36:                 call(["POWERCFG","-SETACTIVE",powerschemes["Internet-Media"]])
 37: 
 38:             elif "application/pdf Object" in active_window:
 39:                 call(["POWERCFG","-SETACTIVE",powerschemes["Reading"]])
 40: 
 41:             else:
 42:                 call(["POWERCFG","-SETACTIVE",powerschemes["Internet"]])
 43: 
 44:         elif "Adobe Audition" in active_window or "Saving" in active_window:
 45:             call(["POWERCFG","-SETACTIVE",powerschemes["Adobe Audition"]])
 46: 
 47:         elif "Torrent" in active_window:
 48:             call(["POWERCFG","-SETACTIVE",powerschemes["Shuteye"]])
 49: 
 50:         elif findall("\.(avi|wmv|mp4|mkv|mpg|mpeg)$", active_window) != None:
 51:             call(["POWERCFG", "-SETACTIVE", powerschemes["Video Optimized"]])
 52: 
 53:         else:
 54:             call(["POWERCFG","-SETACTIVE",powerschemes["Power Saver"]])
 55: 
 56:     except KeyboardInterrupt:
 57:         raise SystemExit

At lines 10-13 we’re importing the modules we need, amongst them is win32gui which is the heart of this all program.


At line 15, we’re allocating the Windows GUI to an object.


At line 16, I’ve created a dictionary to allow me to fetch my power schemes quickly. You can see your power schemes by using launching POWERCFG –L from the command line.


At line 29, we’re adding the 15 seconds grace period, you can change it to suit your needs.


Line 30 is the heart of this program, and using the GetForegroundWindow() function, Windows will retrieve the currently active window from Windows GUI API


Line 34-55, if a pattern was detected, activate the power scheme corresponding to the pattern using POWERCFG –SETACTIVE <power_scheme_GUID>


Cheers,


at0m q[^_^]p

Tuesday, April 10, 2012

Playing around with Bluetooth and Python

For those of you who don’t know Python, Python is a relatively new computer language that was quickly adopted by software giants such as Google, Microsoft, Red-Hat. Since Python has a very clear (almost algorithmic) syntax, anyone can learn it quickly, and if you have a little background in computer programing, it’s even easier. Because of those reasons, M.I.T had chosen Python in their introduction to computer programming.

If you’d like to get your hands a bit dirty, IronPython has a great tutorial with some hands on, highly recommended.

Since most of my work around computers involves Python for the past two years or so, I’ve decided to open a new section called the Python Challenge.

This week I was presented with a cool challenge: find a way to make your computer screen lock while you’re away from the computer.

My initial thought, Bluetooth! It has a short range, and Microsoft provides a nice interface to the Bluetooth stack. The only “disadvantage” is that you have to initially pair the device using Windows. This actually works for my advantage since it prevents possible malicious use.

The code below works only for locking the screen while away, and as a security precaution I’ve chosen not to include the section where the computer immediately logs on while you’re close to the computer.

Let’s get busy
  1: #!/usr/bin/env python
  2: 
  3: # Importing modules
  4: from bluetooth import *
  5: import time
  6: import subprocess
  7: 
  8: print "\nPlease wait while discovering devices...\n"
  9: 
 10: # Discovering devices
 11: devices = discover_devices(lookup_names=True)
 12: counter = 0
 13: for i,j in devices:
 14:     counter+=1
 15:     print "%d) %s - %s" % (counter,i,j)
 16: 
 17: device_num = raw_input("\n\nPlease select a device: ")
 18: selected_device =str(devices[int(device_num) - 1][0])
 19: print "Please wait, pairing with %s" % i
 20: 
 21: # Create the client socket
 22: client_socket=BluetoothSocket( RFCOMM )
 23: 
 24: # Attempt to pair
 25: try:
 26:     client_socket.connect((selected_device, 3))
 27: 
 28: except IOError:
 29:     print "Bluetooth error, check your settings"
 30:     raise SystemExit
 31: 
 32: except KeyboardInterrupt:
 33:     raise SystemExit
 34: 
 35: else:
 36:     print "Paired with %s... monitoring" % j
 37:     connected = True
 38:     locked = False
 39: 
 40: # Send Hi every second, and detect when connection is broken
 41: while 1:
 42:     try:
 43:         client_socket.send("Hi")
 44: 
 45:     except IOError:
 46:         if locked !=True:
 47:             locked = True
 48:             connected = False
 49:             subprocess.call("rundll32.exe user32.dll,LockWorkStation")
 50: 
 51:         if connected == False:
 52:             try:
 53:                 client_socket=BluetoothSocket( RFCOMM )
 54:                 client_socket.connect((selected_device, 3))
 55: 
 56:             except IOError:
 57:                 continue
 58: 
 59:             else:
 60:                 connected = True
 61: 
 62:     except KeyboardInterrupt:
 63:         client_socket.close()
 64: 
 65:     else:
 66:         locked = False
 67:         time.sleep(1)

Cheers,


at0m q[^_^]p

Sunday, March 25, 2012

Wowzer!

As you may recall, last month I’ve wrote an article about Pale Moon, a high performance browser compiled from Firefox.

Pale Moon is already heavily tweaked to provide such high performance, but during the last month I managed to find several tweaks that may (and probably will) improve your browsing experience.

Tip: Document everything you are doing, if you are not satisfied with the changes, it’s always a good idea to keep track on which features you’ve decided to tweak.

About:config

About:config is a web based interface, allows tweaking and refining your Firefox browser. Simply type about:config in your address bar and press Enter.

1

Each key is responsible for a different aspect of the browser, but don’t be afraid to experiment: you can always set the key back to default by Right-Click on the key, and choose Reset.

2

Let’s get to work

network.http.max-persistent-connections-per-server - Increases the maximum number of persistent connections per server which can help speed up loading of multimedia rich sites. Default is 6, change to 8

network.http.max-connections - This integer preference takes values between 1 and 65535 inclusive, directly corresponding to the maximum number of HTTP connections your browser can have open at once. Default is 48, change to 96

network.http.max-connections-per-server - The total number of HTTP connections the application can make to a single server is limited by this preference. If more connections are needed, they are queued until a connection "slot" is available. Default is 15, change to 32

network.dns.disableIPv6 – Most of the ISPs don’t support IPv6, no reason your browser will attempt resolving DNS to IPv6 based addresses. Default is True, change to False

config.trim_on_minimize – While minimizing your browser, Windows will attempt to reclaim some of the memory it has allocated to Firefox. By default, this value does not exist. To create it Right-Click->New->Boolean and set the value to to True

layout.spellcheckDefault – Will determine which text will be checked using the spell checker. The default is 1, which means only some areas will be examined. If you’d like Firefox to perform spell check on all text, change the value to 2

browser.urlbar.autofill - Inline autocomplete mimics behavior in Netscape Navigator 4.x as well as Internet Explorer (when IE's inline autocomplete is activated). As you type, entries you have previously typed that closely match appear highlighted after your typed text. By default the value is False, change it to True

accessibility.blockautorefresh - Web pages (and web servers) can ask a browser to automatically refresh a page after a given timeout by including the HTML element <meta http-equiv="refresh"> or by sending a Refresh: HTTP header. This can be helpful (as in the case of a webpage whose content is updated constantly) but it also can be irritating. Default is False, change to True

accessibility.typeaheadfind - Find As You Type (or Type Ahead Find as it was originally called) allows you to start finding text on the page immediately by simply typing the text you’re trying to find. Normally you need to trigger this feature by pressing ' (single quote) to search link text, or / (forward slash) to search all text. In Firefox, Find As You Type will also display the Find Bar at the bottom of the window and populate the Find field as you type. Default is False, change to True

nglayout.initialpaint.delay - Mozilla applications render web pages incrementally - they display what's been received of a page before the entire page has been downloaded. Since the start of a web page normally doesn't have much useful information to display, Mozilla applications will wait a short interval before first rendering a page. This preference controls that interval. Default is 150ms, which means that even the page had finished loading, it will still wait for 150ms before displaying the page. If you have a high-speed connection, change this to 0

browser.cache.memory.capacity – his preference controls the maximum amount of memory to use for caching decoded images, messages, and chrome items (application user interface elements). Default is 16384, change to 20480

Network.prefetch-next - Link prefetching is when a webpage hints to the browser that certain pages are likely to be visited, so the browser downloads them immediately so they can be displayed immediately when the user requests it. This preference controls whether link prefetching is enabled. If the value is False, change to True

browser.sessionhistory.max_total_viewer - Pages that were recently visited are stored in memory in such a way that they don't have to be re-parsed. This improves performance when pressing Back and Forward. This preference limits the maximum number of pages stored in memory. To disable, change to 0, for automatic set to -1.

network.http.proxy.pipelining - In HTTP 1.1, multiple requests can be sent before any responses are received. This is known as pipelining. Pipelining reduces network load and can reduce page loading times over high-latency connections, but not all servers support it. Some servers may even behave incorrectly if they receive pipelined requests. If a proxy server is configured, this preference controls whether to attempt to use pipelining with the proxy server. Default is False, change to True

browser.blink_allowed - Mozilla supports both the <blink> HTML element and the blink value for the text-decoration CSS property. The blinking content produced is usually irritating at best, disorienting and confusing at worst. Default is True, change to False

keyword.url - Any valid URL may be specified. The keyword will be appended to the URL and then the user will be redirected to the new URL. If you’re like me, and like Google, but hate going to their website every freaking minute, this will allow you to type keywords and google will redirect you to the first site in search. Change the value to http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=

One last tweak (advanced users)

You can slash Firefox's slow load time by compressing the DLLs and executable files. There are many choices for compression but I suggest you use UPX which is free, efficient and time proven. Although UPX is only 32 bit, it’s safe to use for 64 bit users as well since no change is made to the files.

  1. Download UPX from http://upx.sourceforge.net/#download
  2. Unzip upx.exe into your Firefox installation folder which is normally C:\Program Files\Pale Moon.
  3. Make sure Pale Moon is not running then shell to a command prompt (with Administrator rights) in the Pale Moon installation directory.
  4. Type in the following command in a single line and hit return:

for %v in (*.exe *.dll components\*.dll plugins\*.dll) do upx "C:\Program Files\Pale Moon\%v"

If on some later occasion you want to unpack the files, just type in the command above but add the decompression switch "-d" after "do upx."

Cheers,

at0m  q[^_^]p

Sunday, February 26, 2012

TurboBoost - Not for everyone

Being on the road a lot, one always seek new ways to improve my computer battery consumption. I own a Dell Vostro 3700 laptop with a Core i7 720QM processor, which attempts (relatively successful) to pack a high-end performance processor with a decent power consumption system.The decision to attempt and improve the battery life came shortly after purchasing the laptop, so extending the battery to 9-Cell seemed only natural. Back in November, I have upgraded the system drive to a dual drive system, an SSD system drive and a HDD storage drive, to increase the battery life even more.

So far, I have managed to push the system to its theoretical limits and currently enjoy a battery life of almost 6 hours (on a 17.3’’ LCD display), but that only happens at specific usage cases. Mostly, the computer rarely surpasses the 4:20 hour barrier while the fan constantly operates at full speed and the chassis heats up to unfriendly temperatures. I have managed to narrow the suspect list down, taking the hard drive and display adapter out from the equation, leaving the processor as the prime suspect.

By downloading Intel’s Processor ID Utility, I was able to tell my processor operated constantly 10% beyond its factory settings. Intel was able to accomplish this by introducing a new technology called TurboBoost.

TurboBoost for the masses

TurboBoost enables the processor to run above its base operating frequency via dynamic control of the CPU's clock rate. It is activate when the operating system requests the highest performance state of the processor. When workload on the processor calls for faster performance, and the processor is below its limits, the processor's clock will increase the operating frequency in regular increments as required to meet demand. Frequency increases occur in increments of 133 MHz for Nehalem microarchitecture processors and 100 MHz for Sandy Bridge microarchitecture processors. When any of the electrical or thermal limits reached, the operating frequency automatically decreases in decrements of 133 MHz/100 MHz until the processor is again operating within its design limits. Intel had started shipping its TurboBoost technology with every processor released in its successful Core series.

This means that Intel TurboBoost technology acts as if you were manually overclocking the processor frequency for various reasons (overcoming a complex task, a great computational challenge such as calculating large prime numbers etc) just for a short while, and automatically returns the values to their original state (a.k.a stock frequency).

Why complaining?

Intel manages to “guess” if the user requires more computing power by using advanced algorithms that provide statistics on which commands will be executed in the near future and acts accordingly. However, while this mechanism is extremely accurate it is not perfect.

Some browsers, such as Google Chrome, send resource allocation requests from the processor to process internet content faster, and it does that constantly. The processor, with its TurboBoost technology identifies this as a computational challenge as it should, but since it lacks the ability to see this is an ongoing action and not just a temporary process, it will initiate TurboBoost until it drops dead. As a result, the battery life reduced dramatically and the computer keeps heating up.

What can I do?

This solution is not for everyone. Although disabling TurboBoost will increase your battery life, it all comes down to how well you can profile your day-to-day usage.

Surprisingly, disabling TurboBoost is easier than you think!

All you have to do is go to your Power Options:

1

Press on “Change advanced power settings

2

Make sure the Minimum Processor State and Maximum Processor State are equal

3

And you’re done!

Since disabling TurboBoost will keep your processor in a constant frequency, many cycles may go to waste. The best thing to do is to create several profiles, each with a designated function.

To get you started I will list five profiles, fit to all three Core series models:

Model

Reading

Office

Browsing

Movie Playback

Gaming

Intel Core I3

10%

10%

7%

15%

Don’t, I beg you

Intel Core I5

5%

7%

5%

10%

1%-100%

Intel Core I7

3%

5%

5%

7%

1%-100%

Conclusions

In general, your processor should not surpass the 15% mark in any case (reading, browsing and office use rarely use your processor, movie playback use your display adapter mostly).

Cheers,

at0m q[^_^]p

Tuesday, February 21, 2012

Just browsing

For most people, HTTP is just an address prefix since most of the heavy lifting in parsing HTTP based traffic is done using the web browser.

Browsing the internet as you may know is dominated today by five main browsers: Internet Explorer, Google Chrome, Firefox, Apple Safari and Opera.

The scope of this article is far from explaining what benefits from using each one, and mostly it comes down to which features you like and feel comfortable with.

Most browsers today share a common ground and are compatible with most processors today and because of that, most browsers today won’t benefit substantially from a stronger, faster processor. One way getting around it is to compile a browser code using the SSE processing libraries.

SSE – Stands for Streaming SIMD (or Single Instruction, Multiple Data) Instructions, can greatly increase performance when exactly the same operations are to be performed on multiple data objects. Typical applications are digital signal processing and graphics processing. Intel had already introduced SSE libraries back in 1999, which replaced MMX and ever since it’s found in every Intel processor.

What’s the problem?

With the major advancements in processing technology, Intel had extended the SSE libraries and the current version is SSE 4.2, but most improvements were done in multimedia processing, so don’t expect seeing browsers compiled with SSE4 anytime soon. However, SSE2 displays improvements in terms of performance and can theoretically boost performance by using more current processing functions.

Why you no standard?

Since web browsers aim to the lowest common denominator, and have compatibility in mind, most browsers are compiled using SSE libraries and not SSE2. If you’re processor is a Pentium IV and up (or equivalent), there’s no reason you shouldn’t upgrade to a faster web browser. While there are several alternatives, one release outperforms them all: Pale Moon.

Shine on Pale Moon

Pale Moon aims to strike a balance between features and speed. As such, a choice has been made to consciously disable a few features that are not commonly used by the largest group of users (such as parental control and accessibility). While relying on 100% source code from Firefox, it is specifically optimized for current processors by making use of the enhanced instruction sets such as SSE2 to address several performance and stability issues.

Friday, January 13, 2012

WhatsApp for Windows

If you own a smartphone, there’s a very good chance you know WhatsApp. For those of you who don’t know it, WhatsApp Messanger is a cross-platform mobile messaging application that allows you to exchange messages without having to pay for SMS. It works on practically every mobile OS to date. Note the bold on mobile, it’s there for a reason.

Unlike other popular applications such as Skype or Yahoo! Messanger, WhatsApp limits its functionality to mobile devices, which is perfectly OK if you like typing text using a mobile device. If you’re like me, and like everything to be in one place, the whole “take out your phone to answer the text” looks kinda ridiculous.

So I was wondering, how many are like me that would like to have a normal WhatsApp client for their desktop computer?

Phase 1 - Virtualize a smartphone operating system

Before we can use an application from the mobile world, an operating system is required. Using Windows doesn’t make life easy for iPhone users since no official SDK exist for Windows users, so this article is going to focus on the Android operating system.

At first, the natural solution was to go and download the Android SDK from Google, but after playing around with it, it’s not what I was looking for.

First of all, it’s slow, complicated, requires additional downloads for plugins and after installation takes approx. 1.2GB of hard drive space… too much!

In quest to find an easier solution, that takes less space, I found YouWave from YouWave.com:

  • An easy-to-use interface
  • Takes a total of 500MB after installation
  • Doesn’t require additional downloads for plugins
  • Works right off the box
  • Substantially faster than the default SDK device.

YouWave has a fully featured 7-day trial period and a license for only 14.95$

Phase 2 - Installing WhatsApp on YouWave

If you are familiar with the Android interface, you shouldn’t have a problem finding your way around the virtual device.

Simply click: View->Online Content and double click on WhatsApp, that’s it!

Market

Phase 3 – Configuring WhatsApp client

WhatsApp requires a verification code sent from your phone, but we don’t have a phone, this is a PC, so you have several options:

  1. Enter your real phone number – WhatsApp does not allow using more than one account per number, so this option will force you to either uninstalling the application from your smartphone or stop using it. If you do try this option, and would like to go back, then you’ll have to uninstall your WhatApp installation and go through the whole registration again. Don’t worry about your chat history since WhatsApp are saving it in case you’d like to reinstall the application on your phone.
  2. Buy a one time SIM card – This is the best way, but if the company will recycle the number, and that user will install WhatsApp, then you’ll have trouble sending new messages, it’s a risk
  3. Use a virtual cellphone number – This option is great if you want to evaluate the service and how well WhatsApp functions on your computer.

Since I like to evaluate the entire service and see if I like it, option 3 was the best option to me, so I choose http://receive-sms-online.com

Phase 4 – Add friends

After registration is complete, use the phonebook to add friends.

  1. Simply go to your phonebook, and add a new person.
  2. Click the new person and choose the small smiley icon on the right
  3. From there, choose WhatsApp and start talking

dude 1dude 2

Phase 5 – Enjoy WhatsApp

What's up

Final Notes

This article was written for educational purposes only. If you consider this a good alternative, buy YouWave, it’s worth every penny.

Cheers q[^_^]p

Saturday, January 7, 2012

Make your life easier with Explorer.exe

There isn’t anyone on the planet today that doesn’t know the Windows operating system from Microsoft. But while most of us know and use it, very few of us know the hidden switches and handles Windows has to offer.

How is this useful?

  • You’re a penetration tester seeking creative ways to break out from the Windows Group Policy sandbox
  • You’re a Windows administrator seeking in securing the Windows Group Policy sandbox
  • You’re a Windows power user seeking to expand their knowledge
  • You’d like to make your life a bit easier with nifty shortcuts
How to

The below switches can be used via Run menu, a new shortcut, explorer address bar, via web browser address bar, via command-line or any other creative way to launch a command

Getting down to business

My Computer explorer.exe /E,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}

My Documents explorer.exe /N,::{450D8FBA-AD25-11D0-98A8-0800361B1103}

Recycle Bin explorer.exe /N,::{645FF040-5081-101B-9F08-00AA002F954E}

Network Neighborhood explorer.exe /N,::{208D2C60-3AEA-1069-A2D7-08002B30309D}

Web Browser explorer.exe /N,::{871C5380-42A0-1069-A2EA-08002B30309D}

Control Panel explorer.exe /N,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}

Printers and Faxes explorer.exe /N,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\::{2227A280-3AEA-1069-A2DE-08002B30309D}

Network Connections or My Network Place explorer.exe /N,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}

Administrative Tools explorer.exe /N,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\::{D20EA4E1-3957-11d2-A40B-0C5020524153}

Open an FTP location in Explorer view automatically:  explorer.exe /secondary,ftp://use:password@192.168.1.1/share

Open a new location: explorer.exe /e “C:\”

Some of the shortcuts were removed from this article since they failed to work under Windows 7.

Cheers q[^_^]p