Showing posts with label Other. Show all posts
Showing posts with label Other. Show all posts

Wednesday, October 1, 2014

Flash trace() in browser Console

This is Super awesome. You can view the Flash trace in browser console, using the following commands in Actionscript. It works fine in Chrome and FireFox.
You are free to debug your swf in your website.


import flash.external.ExternalInterface;

ExternalInterface.call("console.log", "YourString");

Thursday, September 18, 2014

Secure file copy to Amazon Elastic Compute Cloud (Amazon EC2)

1. First connect to the instance using ssh command, make sure .pem (private key) is available in your ssh directory in ~/.ssh with permission chmod 400 <<my-key-pair.pem>>

ssh -i my-key-pair.pem ec2-user@ec2-198-51-100-1.compute-1.amazonaws.com

2.  After successfully connected, Execute the following command

scp -ir my-key-pair.pem <<Source path>> ec2-user@ec2-198-51-100-1.compute-1.amazonaws.com:<<destination path>>


Friday, August 1, 2014

autocomplete="off" is not working in chrome

This is one simple issue drove me crazy all afternoon...

I want to ignore the browser autofill option to save the password. Like, sometimes user select the option to save password for the website and Chrome just autofills the password for the user. But, the same machine can be used by multiple users. So you might want to protect the user password, even through user selects to save the password by mistake.

I started searching the solution in Google and I tried, autocomplete="off" for the <input />, it doesn't work, then someone in another post suggested, it will work only if you add autocomplete="off" to the <form /> tag.

Guess what? It didn't work. Since chrome is just ignoring the autocomplete="off" option.

I found a workaround to solve this issue. 

"Chrome autofill the password <input /> tag and the previous <input /> tag. 
So , I added 

<input style="display:none" />
<input type="password" style="display:none" />

It works like a charm. Autofill goes to these <input /> tag, which will not display and the real one works as expected.

Thursday, November 14, 2013

Git Commands - Quick Reference

Install git in Mac
http://code.google.com/p/git-osx-installer, Other OS, please refer here : http://git-scm.com/book/en/Getting-Started-Installing-Git


Initialize a Git repository and make the first commit

$ git init
$ git add .
$ git commit -m "Initial commit"

Create a new repository and push it up to GitHub:

$ git remote add origin git@github.com:<username>/demo_app.git
$ git push origin master

Create a branch and switch to the branch at the same time

$ git checkout  - b newbranch-dev
(or)

$ git branch  newbranch-dev
$ git checkout newbranch-dev

To List out the available Branch

$ git branch -a

To switch to master branch

$ git checkout master
$ git branch -a

To push the changes to particular branch. (origin is the remote created for the git url using <<git remote add command>>)

$ git push origin newbranch-dev

To get the latest version by cloning the git project, for first time (Reference : http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository)

$ git clone <<git clone public URL>>

To get the latest version from the git project after cloning. (origin is the remote created for the git url using <<git remote add command>>)

$ git pull origin newbranch-dev

To find the difference between current working copy and last version

$ git diff HEAD


To find the difference between any commit and Last version, you can get the commit_id by using this command(
$ git log -4 --pretty="%h - %s" - will give last 4 commits)

$ git diff commit_id HEAD


To find the difference between last version and previous commit


$ git diff HEAD^ HEAD

To get the current configured git user information

$ git config --list

To undo local changes and restore them to the current versions in the repository

$ git reset --hard

Tuesday, November 5, 2013

Processing the Error Log

It hard to search the specific error occurred in the log file, to go through manually, when the file is of huge size.

- to find number times it occurred
-to find the pattern of the error
-or quick review of the error message

I found an easy way to do that, You can use this command not only for log file, any text file. This commands is for Windows machine

>Find "Sent alert email to admin for email" ErrorLog11052013.log >EmailErr.txt

Display all the line that matches ""Sent alert email to admin for email" in the file "ErrorLog11052013.log" and the Output will be redirected to "EmailErr.txt" file.

Friday, September 6, 2013

TryRuby

Learn ruby basic commands in 15 minutes using the link http://tryruby.org, Which has command line interpreter, and you can have short desc for each command. You can go back and forth to check.

Tuesday, February 26, 2013

Remote Connection


There are several tools available for remote connection and i found it most effective and efficient tools

1. TeamViewer
 
You can connect you machine from Windows to Mac/Mac to Windows or iPad/iPhone/Android to Mac/windows.... Everything is possible. I found it more useful.
You can follow the instruction here
http://www.pcworld.com/article/248991/how_to_log_in_to_your_pc_remotely_with_teamviewer.html


2. Join.me (Meeting &amp; remote control others machine)
https://join.me/

3. LogMeIn
https://secure.logmein.com/products/free/