Thursday, July 17, 2014

Passing parameters to javascript action methods

http://stackoverflow.com/questions/8442552/passing-parameters-to-a-jquery-function-from-a-button-click


Wednesday, July 9, 2014

Re-codesign iPhone apps (.ipa files) with Enterprise Certificates

http://avinashdongarwar.blogspot.com/2013/12/re-codesign-iphone-apps-ipa-files-with.html

Pre-Requisites

1)   Download the distribution certificate from iOS Developer Enterprise Program account. Include it in keychain by double clicking on downloaded .cer file. 
2)   Download the provisioning profile for the app that needs to be resigned from  iOS Developer Enterprise Program Account.
3)   Have the .ipa file of the app that needs to be resigned.

How to Re-sign -
 Lets say Application.ipa is the one we are re-signing.
Open terminal  and -
1)  Unzip the .ipa file.
unzip Application.ipa 
2)  At this stage, you will be having a directory named “Payload” in your working directory with a file with .app extension inside.  In this case it will be Application.app.
3)  In case you want to check the signing authority of the app -
 codesign -dvv Payload/Application.app
4)  Remove old code signature.
rm -r "Payload/Application.app/_CodeSignature" "Payload/Application.app/CodeResources" 2> /dev/null | true
5)   In case Bundle identifier used for registering the application while creating provisioning profile through Enterprise account differs from what was used while signing the app for the first time, we need to change Bundle               identifier using Plistbuddy.
/usr/libexec/PlistBuddy Payload/Apps.app/Info.plist
Use following commands -
a)  Set :CFBundleIdentifier
b)  Save
c)  Quit
6)  In case app uses OS capabilities like Shared keychain, SSO, push notifications etc. we need to add an entitlements property list while resigning in order to enable App Sandbox for the application. For example:
. A new entilements file can be created using –
     /usr/bin/codesign -d --entitlements :entitlements.plist Payload/Application.app
7)  Open the entitlements.plist and edit it.
a) vi entitlements.plist
b) Press i.
c) Entilements.plist looks like -
UTF-8
"?>
http://www.apple.com/DTDs/PropertyList-1.0.dtd
">
        application-identifier
        XXXXXXXX.
        get-task-allow
       
        keychain-access-groups
       
                XXXXXXXX.
                XXXXXXXX.< keychain group id>
                …………..etc………..
       

In the above chunk, XXXXXXXX part has to be replaced with team ID of the Enterprise Account.
d)  Press esc
e)  :wq!
8) Replace embedded provisioning profile.
cp "" "Payload/Apps.app/embedded.mobileprovision"
9) Re-sign








 /usr/bin/codesign -f -s "" --resource-rules "Payload/Application.app/ResourceRules.plist" --entitlements entitlements.plist "Payload/Application.app"
Certificate Authorities can be even checked in "Keychain Access" Utility application on MAC systems. Open "Keychain Access"  and search with keyword "iPhone Distribution".
  
10) Repackage
    zip -qr "Application.resigned.ipa" Payload

Wednesday, July 2, 2014

Resigning an application

http://avinashdongarwar.blogspot.com/2013/12/re-codesign-iphone-apps-ipa-files-with.html

Friday, June 6, 2014

Crashing avd emulator

http://timvoet.com/2013/01/04/avd-emulator-crashes-on-mac/

Wednesday, April 23, 2014

Enable syslog server on Mavericks

http://stackoverflow.com/questions/5510563/how-to-start-syslogd-server-on-mac-to-accept-remote-logging-messages

Tuesday, April 22, 2014

Installing geoip to mavericks

http://www.krishnasunuwar.com.np/2014/02/installation-maxmind-geoip-python-library-in-os-x-10-9-mavericks/

Steps to installing GeoIP for django

1.  Install C Library
2.  Download binary database and put it in share folder
3. Download python library GeoIP 1.3.1 (pip install geoip)
4.  Configure Django settings.py
    'django.contrib.gis',

Tuesday, February 4, 2014

OSSIM Custom Collectors

http://santi-bassett.blogspot.com/2012/09/hands-on-3-creating-custom-ossim-plugin.html

Wednesday, January 29, 2014

Dynatables custom column sort

https://github.com/alfajango/jquery-dynatable/issues/27

Monday, January 27, 2014

iOS Provisioning Profiles location

/Users/$(username)/Library/MobileDevice/Provisioning Profiles/

Monday, January 20, 2014

Update Android SDK command line

 android update sdk --no-ui

Tuesday, October 29, 2013

Tastypie valid lookups


exact
iexact
contains
icontains
in
gt
gte
lt
lte
startswith
istartswith
endswith
iendswith
range
year
month
day
week_day
isnull
search
regex
iregex

Ex:

class ThemeResource(ModelResource):
class Meta:
allowed_methods = ['get', 'put']
queryset = Theme.objects.all()
resource_name = 'theme'
filtering = {
'name': ['exact', 'icontains'],
'id':('exact'),
}

http://local.test:8000/api/v1/theme/?format=json&name__icontains=agenda

Monday, October 28, 2013

django Incorrect string value for object_repr

http://stackoverflow.com/questions/11497744/django-mysql-unicode-errors

ALTER TABLE django_admin_log MODIFY object_repr VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;

Wednesday, October 16, 2013

Showing collation and setting collation MySQL



mysql> show full columns from [table];


ALTER TABLE [table] CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

Thursday, September 26, 2013

Load iOS 6.1 SDK into XCode5



  1. Find the SDK file, like iPhoneOS6.1.sdk, in your or your friend's older Xcode directory.
  2. Sym link the old SDK to the new XCode5 app directory:
  3. ln -s /Applications/Xcode4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk

Thursday, August 15, 2013

RabbitMQ Installing rabbitmqadmin


rabbitmq-plugins enable rabbitmq_management

Restart rabbitmq server:
rabbitmqctl stop
./rabbitmqctl-server

Download rabbitmq_management from:
http://[server]/cli/

Friday, August 2, 2013

Django filter on multiple object IDs

https://docs.djangoproject.com/en/1.5/topics/db/queries/

# Get blogs entries with id 1, 4 and 7
>>> Blog.objects.filter(pk__in=[1,4,7])

# Get all blog entries with id > 14
>>> Blog.objects.filter(pk__gt=14)

Monday, July 22, 2013

Print attributes of python object

from pprint import pprint
pprint (vars(your_object))