Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Sunday, 8 September 2013

Python - Fix Non-ASCII Character in File

Encode in ANSI


Additional Headers (On Top of code)
#! /usr/bin/env python
# -*- coding: utf-8 -*-

EXTRA: For Windows (Optional)

Friday, 30 August 2013

Python - Sip2sip with Pjsua

Rebuild Python Pjsua TLS Support with VS2008

config_site.h
#include <pj/config_site_sample.h>
#define PJ_HAS_SSL_SOCK 1
VC++ Header and Library Path

Build then Install
pjproject\pjsip-apps\lib\_pjsua.pyd
python pjsip-apps\src\python\setup-vc.py install

Sip2Sip.info Authentication Script
try:
    ua_cfg = pj.UAConfig()
    ua_cfg.nameserver = ['8.8.8.8', '8.8.4.4'] # Example: Google Public DNS
    lib.init(ua_cfg=ua_cfg, log_cfg=pj.LogConfig(level=4, callback=log_cb))
    transport = lib.create_transport(pj.TransportType.TLS, pj.TransportConfig(port=5060))
    lib.start()
 
    acc_cfg = pj.AccountConfig()
    acc_cfg.id = "sip:ID@sip2sip.info"
    acc_cfg.reg_uri = "sip:sip2sip.info;transport=tls"
    acc_cfg.auth_cred = [pj.AuthCred(
        realm="sip2sip.info",
        username="USERNAME",
        passwd="PASSWORD",
    )]
    acc_cb = MyAccountCallback(acc_cfg)
    acc = lib.create_account(acc_cfg, cb=acc_cb)
except Exception, err:
    print 'Error creating account:', err
References:
http://trac.pjsip.org/repos/wiki/Getting-Started/Installing-OpenSSL-Windows
http://trac.pjsip.org/repos/wiki/TLS

Thursday, 29 August 2013

Windows - VMWare Sound Audio Troubleshooting

Check Realtek Audio Manager

Ensure Both Playback and Recording Devices Working

Check VMWare player Sound Device Setting


Python - Pjsua 1.16 Build Fixes for Windows

Build Python2.7 x32 Windows 7 x64
pjsua==1.16-svn
http://svn.pjsip.org/repos/pjproject/branches/1.x/
Python2.7 <- Visual Studio 2008

VC++ Include & Library Directory (MenuBar -> Tools -> Options)



Replace python24.lib to python27.lib
py_pjsua.dsp
py_pjsua.vcproj
python_pjsua.vcproj
python_pjsua.dsp
Save as UTF-8 or Unicode (Optional)
g7221.h
Backup compiled pjsua 1.16:
pjproject\pjsip-apps\lib\_pjsua.pyd
python pjsip-apps\src\python\setup-vc.py install
https://www.dropbox.com/s/sgdrp8yxk2v6xe6/_pjsua.pyd

References: 
http://trac.pjsip.org/repos/wiki/Getting-Started/Download-Source
http://trac.pjsip.org/repos/wiki/Python_SIP/Build_Install
http://trac.pjsip.org/repos/wiki/Getting-Started/Windows

Monday, 29 July 2013

Windows - Heroku SSH Troubleshooting

Could not open a connection to your authentication agent.

# Check your default .pub location, e.g. c:\users\username\.ssh
ssh -v git@github.com 
# Make sure both files included in the directory (id_rsa & id_rsa.pub)

My Key Files for Directory c:\users\username\.ssh
github_rsa
github_rsa.pub
id_rsa
id_rsa.pub
# Rename filename to id_rsa & id_rsa.pub

Cygwin - Command Shell Enable Copy Paste

1. Right Click Properties on Shell




2. Enable Quick Edit Mode Mode

OR

Edit .bachrc (Add following code)



Edit .inputrc (Add following code)

Thursday, 18 July 2013

Windows - Fix Virtualenv No Site Packages

*Using virtualenv-win

C:\Python27\workon.bat
C:\Python27\toggleglobalsitepackages.bat

Friday, 21 June 2013

Windows - Bluestacks GUID MAC Address

CMD -regedit
HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\BootParameters

noxsave noxsaveopt root=/dev/sda1 SRC=/android DATA=/dev/sdb1 SDCARD=/dev/sdc1 PREBUNDLEDAPPSFS=/dev/sdd1 HOST=WIN GUID=b29d353b-f31c-11e1-a112-dc3ea1f1211f VERSION=0.7.12.896 GlHotAttach=1 OEM=BlueStacks LANG=en_US armApps=true GlMode=1 P2DM=1

Android - Copy Bluestacks Whatapps Data to Windows

Root Bluestacks
Download
https://www.dropbox.com/s/iqpvapy3uinbdup/Root.7z
Backup & Replace Root.fs MOD
C:\ProgramData\BlueStacks\Android\Root.fs
OR
http://old.androidfilehost.com/main/Misc/Bluestack/Rooting BlueStacks Beta/HowTo/HowTo Root BlueStacks.pdf

Backup Latest Conversation
Bluestacks -> Whatsapp -> Settings -> Chat Settings -> Backup Conversations

Copy
adb root
adb pull /sdcard/WhatsApp C:\Whatsapp

References:
- Bluestacks 0.7.12.896
- Whatsapp 2.10.222

Wednesday, 12 June 2013

Windows - CMD to Console2

Download Console2
Replacement for CMD with Features and Enhancement
http://sourceforge.net/projects/console/

Copy to SystemRoot and Call Console via RUN
Append ";%SystemRoot%\SysWOW64" to PATH environment variable (Directory of Console2.exe)
Modify this path appropriately if you installed Console2 to a different location.

Add Start up Script (Optional)


Python2.7 cmd
@echo off
set PATH=%PATH%;C:\Python27;C:\Python27\Scripts
D:
cd D:\Projects\
cmd

PhantomJS - Windows Graphic Cards Hang Process

Problem
PhantomJS can't be terminated.


Possible Solution
If the computer have 2 graphic cards, set the preferred graphic processing handler to high performance processor to solve the hang issue.


More Info: https://github.com/ariya/phantomjs/issues/10845

Saturday, 1 June 2013

Python - snippetscream fix on Windows

snippetscream\_186.py
Replace
self.tmpfile = tempfile.NamedTemporaryFile()
To
self.tmpfile = tempfile.NamedTemporaryFile(delete=False)
# If delete is true (the default), the file is deleted as soon as it is closed. (New in version 2.6: The delete parameter.) [1]
Reference: http://docs.python.org/2/library/tempfile.html#tempfile.NamedTemporaryFile
Download: https://github.com/shaunsephton/django-snippetscream