[TipJar] Quickly transferring information to an android device

No Comments

No time to read through contexts? Jump to the TL;DR; section.

For security reasons my internet access in the office is restricted and most if not all of the sites that allow saving of data is blocked by the office proxy server. This becomes a pain if I come across some articles and sites that would be good to read later or heaven forbid something that I need. The usual route that would allow me to schedule reading the article is to save the links in my company email drafts folder, or email it to myself so I can remember to move them to my bookmarking or reminder site when I get home. This setup has been fine but being the perennial procastinator (or busy if you want to put a positive spin on it) I sometimes forget to do it immediately. The other alternative is horrible: type the url on my android device as I encounter the sites and articles. That option is as pleasing as going to the doctor for a rectal probe. I forgot to mention that my Android device doesn’t have continuous Internet by the way, which would have made my life easier and this post an academic exercise. 🙂

I have an alternative solution which works if you have a QR reader on your device. The main gist is to transfer the information to the device using a QR code. The steps follow:

More

[TipJar] Common Punk: replace my text

No Comments

The SOA server I am currently working with had a nasty quirk on its services that I havent figured out yet on how to fix: it fails on requests with an XML comment. We use SOAPUI to trigger requests and the quirk requires most of us to strip the comments that is automatically generated by the tool. This quirk however gives me a good segue on this IT tipjar: how to leverage pattern matching to batch remove comments. This should serve as an introduction in other pattern matching applications when dealing with text/ascii content.
More

[TipJar] Enabling Aero window service from the command line

3 Comments

Aero is a default theme in Windows Vista and Windows 7 Home Premium or better but is not enabled by default. Aero adds some nifty features like Peek (showing thumbnail previews when hovering on the open programs), Shake (shaking the window minimizes all other windows), Snap (dragging the window to the edges snaps it, useful for side by side windows organization). Aero however consumes additional CPU and GPU power but in some cases it can introduce some efficiency like repainting only the areas that are affected by window movement.

Enabling Aero requires two services to be started before they can be used: the Desktop Windows Management (uxsms), and the Themes (themes) services. Enabling them from the Control Panel->Services MMC console is fairly easy but this tip jar is about enabling them from the command line to reduce the wait and teach the basics of interacting with the Windows services using command line options.

The command are split into two categories: making sure the services are enabled, and starting them up.

sc config uxsms start= auto
net start uxsms

sc config themes start= auto
net start themes

These are administrative activities so they need to be done from within a command window that has administrative privileges. Refer to previous TipJar entries on how to do this. The “auto” parameter of the sc commands can be changed to “demand” if the services are to be start manually so as not to consume resources ?at every Windows startup. The sc invocations are only required to be done once.

[TipJar] Before you flick me off… (Windows 7 edition)

No Comments

This is a spin-off of the original article found here. For the rationale on the benefits and gotchas for hibernation then refer to the original post. This post is dedicated on how to enable hibernation in Windows 7 as the instruction has changed.

Enabling the hibernation feature requires that the process be done using an administrative account on the machine.

  • Open an administrative command window by pressing the Window key, typing cmd, highlighting the cmd entry under the Programs group, and pressing Ctrl+Shift+Enter.
  • Execute the command “powercfg -h on” to enable the hibernate feature.
  • powerconfig

  • Open the Power Options group in the Control Panel and click the “Change plan settings” of the current active plan.
  • current active plan

  • Click on the “Change advanced power settings” link in the resulting window.
  • power advance settings

  • Under the Sleep tree item, disable the hybrid sleep option. The hibernate option will not be available if this option is enabled.
  • hybrid sleep off

  • Click on the Apply button and dismiss all succeeding dialog windows. The hibernate option should now be present on the Shutdown submenu.
  • hibernate-win7

ciao!

[TipJar] High and Snipe

No Comments

At work, the Windows 7 workstation we were given came with a Trojan-esque gift: several instances of wscript.exe are running at startup and uses all available CPU processing cycles. Killing them off does not show any adverse effects (yet) but the graphical way is a bit time consuming as the machine is already slow at this point.

Below is the quickest way to snipe these instances using the lowest memory-guzzler tool in every Windows arsenal: the command line processor window. The only catch is that the wscript instances would require the kill command to be executed from an elevated command prompt as the Windows User Access Control (UAC) is active.
1. Press the Window key to bring up the startup menu.
2. In the Start menu search box, type “cmd”. The first entry highlighted is the program entry.

elevated cli

3. Press “Ctrl+Shift+Enter” to run the command in elevated mode. If UAC is really running, a confirmation prompt will be displayed for the command line processor.

elevated cli

4. Invoke the command “taskkill /im wscript.exe /f ” to kill all running instances of wscript.exe.

5. To validate if there are still instances running, run the command “tasklist | find “wscript” ” (omit the first and last double quotes). Nothing should be shown.

The exercise above can be adapted to quickly kill some errant processes without going through the task manager or resource monitor GUI clients. Be careful in what you kill for it might bite back. 🙂

[UPDATE] A colleague,Ron Emil Castro, has provided this trick on combining both in a script that will load up with administrator privileges upon startup for Vista/Win7 machines.

  • Create a batch script with the following code

CHOICE /N /C YN /T 15 /D Y
taskkill /im wscript.exe /f

The first command waits for 15 seconds to give the script enough time to run and the second kills it as specified in the script above.

  • Open the startup folder by right-clicking on the Start->All Programs->Startup item then selecting the Open option.
  • Create a shortcut to the batch script. Right-click on the shortcut and open the properties window. Select the “Run as Administrator” option under the Advanced section.

[UPDATE] The processes are because of an errant firewall checker script loaded by the domain policies. The alternate solution provided by the support team is to execute the C:\Windows\system32\wscript.exe binary and set the timeout to a low number (5 or 10 seconds). Use the recommendation at your own risk as this basically handicaps the execution of other scripts that would require more time than the set timeout.

Older Entries

Social Media Auto Publish Powered By : XYZScripts.com