Wednesday, February 25, 2015

Enabling SMEP in VMware Windows 8.1 guest

I have many VMs on my Windows 8.1 64-bit host. I have both Windows 8.1 32-bit and Windows 8.1 64-bit as guests. I noticed that SMEP is enabled on my 32-bit guest, but not my 64-bit one.

SMEP is not enabled.

So I tried something: I checked the box under VM settings -> Hardware -> Processors -> Disable acceleration for binary translation.

Disabling acceleration for binary translation

And SMEP now works on my 64-bit Win 8.1 guest!


SMEP enabled after disabling acceleration.


Wednesday, November 5, 2014

Using Yowsup to get groups and group information

Took me a while to figure this out.

I had a particularly annoying problem with Python: it thinks that I'm giving it 14 parameters when I'm giving it 2. In particular, I had to add dummy parameters to sendGetGroups and sendGetGroupInfo inside connectionmanager.py so that I can pass arguments to them correctly.

Using Yowsup to get information about a group

Using Yowsup to get the list of all groups the user is participating in

Files:
Yowsup\connectionmanager.py
Examples\GroupInfoClient.py
Examples\GetAllGroupsClient.py
yowsup-cli

Tuesday, November 4, 2014

Using Yowsup to send contacts

Contacts are referred to as Vcards inside the library, so I'll refer them as Vcards from the next sentence on. Vcards work in the same way as location, as both of them do not need the media request, media upload, send media chain. A call to message_vcardSend will do. message_vcardSend accepts 3 parameters: JID of person to send to, data, and name. I had no idea what data is, so I started off writing a listener for Vcards instead, to learn the format of the data parameter.


I've included the files for the listener below.

Following the format as shown above, I wrote the code for sending Vcards. It generally works, but occasionally, the send doesn't get through and the receiver will receive nothing. If anyone can pinpoint why this happens please enlighten me.




Files:





Monday, November 3, 2014

Using Yowsup to send location

Previously when sending images, video and audio, the flow goes like this:

Request media upload -> request success -> upload -> upload success -> send url of uploaded media to other people

I realised that sending location does not follow this pattern. All it requires is calling message_locationSend with the correct parameters and it'll work.

Nevertheless, I had to fix up connectionmanager.py a bit as it does not include the "name" attribute, and it crashes my Whatsapp on iOS everytime the location is sent (as of 4 Nov 2014)...the updated connectionmanager.py is posted below. The line that is changed is marked with #sirpoot

If you send with a name, longitude and latitude you'll get this:





If you send with an empty name, you'll replicate the same thing as what Whatsapp on iOS does:






 Files:
Examples\LocationUploaderClient.py
Yowsup\connectionmanager.py
yowsup-cli





Sunday, November 2, 2014

Using Yowsup to send audio and video

It works.

Sending audio and video files work in the same way as sending images. It begins with a call to media_requestUpload with the hash, a string of the type of file to upload, and the filesize as arguments, and once the request succeeds, the client has to use MediaUploader to upload the local file, and finally when the upload completes the client can then send the URL to friends using the method message_imageSend, message_audioSend, and message_videoSend for images, audio files and video files respectively. The only difference in the API for these 3 methods are: message_audioSend does not have a preview as argument, while message_videoSend and message_imageSend both have a argument for the preview (which can be None).

Please note that most of the audio and video uploader code is copy-pasted from the image uploader, and I haven't wrote in preview code for the video uploader due to the infinite variety of video formats out there. This code is more for people to look at and see how it works than to be used in production.

Examples\VideoUploaderClient.py
yowsup-cli

Tested with .mp3 and .wav for audio, and .mp4 for video.

Using Yowsup to send audio and video files

Saturday, August 16, 2014

Multi-monitor gaming

Managed to dig out spare monitors from the storehouse, now I can finally play games on 3 monitors!

My graphics card is the Chinese Colorful GTX 750. It has 3 ports at the back, 1 VGA, 1 DVI, and 1 HDMI. I used 1 HDMI to DVI cable for the first monitor, 1 DVI to DVI for the 2nd, and 1 VGA to VGA for the third monitor.

Here's the outcome:

I now have one super wide desktop. Panorama wallpapers look absolutely awesome!

3-monitor Payday 2. All 3 monitors have 4:3 aspect ratio

3-monitor Payday 2



In this experiment, I tried to determine if the same monitors (the same aspect ratio) is needed for 3-monitor gaming to work. For this and the following photo I replaced the center monitor with a widescreen one (16:9 aspect ratio). To my surprise, the center monitor isn't skewed or stretched; it worked perfectly!

Aspect ratios of monitors from left to right: 4:3, 16:9, 4:3. No problems with the graphics!

After playing several rounds of Payday 2 I discovered that the side monitors really help in spatial awareness. I can remember map layouts much better with the side monitors around!

Tuesday, August 12, 2014

Using Yowsup to send pictures to a group

So, I intended to send pictures to my whatsapp group...these are the steps I took.

1. Buy a cheap SIM card, take note of that number
2. Edit the config file, use yowsup-cli to register using that phone number and input the subsequent verification code

Register a Whatsapp account using phone number


3. Extend the ListenerClient to listen for group messages, ask one of my groupmates to send the group a test message. This allows me to obtain the JID of the group.

Listen for group messages to obtain JID of the group

4. Extend CmdClient.py and fix it, and add in my own additions to yowsup-cli to be able to send

Sending images to group chat


Here are all my files at the end:

Examples\GroupListenerClient.py
Examples\UploaderClient.py
Examples\CmdClient.py
yowsup-cli


References:

Using the yowsup-cli, registering a new account
http://hacktracking.blogspot.sg/2013/02/yowsup-cli-send-whatsapp-messages-from.html

Getting JID of the group
https://github.com/tgalal/yowsup/issues/162

Sending images by SamsonBox
https://github.com/tgalal/yowsup/issues/178

Creating preview images
https://github.com/tgalal/yowsup/issues/35#issuecomment-41364453