Sunday, September 18, 2016

PngQuant: Ultimate image size reducer

Use pngquant for lossy compression. https://pngquant.org/


pngquant --verbose --force --ext .png *.png

use pngcrush for non-quality loss compresss

Monday, August 29, 2016

How to use brew to start services

install brew services
brew tap homebrew/services

use services command
brew services start mysql

Most important things in life

1. Don't ignore yourself.
2. Separate opinions from fact. Look for fact and proof before believing things.
3. You can achieve any skill by practice.
4. You are born with enough intelligence to do what others can do.
5. Avoid loans
6. Try to invest every penny. Compounding power can generate wealth in future.
7. Earn respect by value generation. Be valuable to others.
8. Leave things in better state. Don't repeat wrong of others.

Wednesday, August 24, 2016

Marketing tips - summary of Traction book

summary of traction book:

  • Critical Path
  • BullsEye
  • Viral Pockets
  • 50% rule
  • 3 Phase growth.
  • A/B testing.
  • Traction goal.
  • HARO ( PR -> HARO)[ where target come for source)
  • Unconventional PR 
  •    > publicity stunt 
  •    >  customer appreciation like T-Shirts.
  •    > Meet with customers.
  • Adwords quality score.
  • focus on long tail keywords.
  • Niche Ad networks
  • find out competition’s channel.
  • offline
  • social ads
  • content marketing
  • email marketing (personalized channel)
  • > on-boarding
  • > reminders
  • notifications to build brand.
  • free tools/product for inbound traffic.
  • affiliate marketing
  • partnership building
  • Sale ( PNAME)
  •  > Process, Need, Authority, Money
  • sale -> find blockages?
  • affiliate sites-> coupon/discount
  • shows/conference
  • community building / loyal fans. 

Learning of day: COBRA effect

 Cobra Effect (a type of Perverse Incentive), which is a phenomenon that occurs when an attempted solution to a problem actually makes the problem worse.

why cobra: british paid for dead cobra to get rid of them in delhi, people started farming of it. more cobra population.

Thursday, July 14, 2016

Tips to safeguard websites

1. Keep minimum number of resources online.

2. do password protection of internally accessed resources.

3. Do regular website scanning. Acunetix is one good tool.

4. Engage security consultants to do security audits. www.securityescape.com  is one recommended by me.

5. Check folder permissions. use 755 as default permission. 

6. Be very extra careful with uploading files. 

7. Use WSO.php to understand damage possible if any file uploaded successfully.

8. Keep code and data separately. use php engine off on data folders.

Tuesday, July 12, 2016

Setup mod security on apache2

apt-get install libapache2-modsecurity
mv /etc/modsecurity/modsecurity.conf{-recommended,}
Find this line
SecRuleEngine DetectionOnly
and change it to:
SecRuleEngine On

use below link:

https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_security-with-apache-on-debian-ubuntu


Monday, July 11, 2016

Regulate non public traffic on site

use below in .htaccess

AuthType Basic
AuthName "Please Log In"
AuthUserFile /some/path/.htpasswd
Require valid-user
Order deny,allow
Deny from all
Allow from 127.0.0.1
Satisfy any

Wednesday, July 6, 2016

Security tips to protect site

Below is good read about security tips to protect websites:

http://www.creativebloq.com/web-design/website-security-tips-protect-your-site-7122853


Monday, May 9, 2016

Google play store formatting

  • Single line breaks are ignored; double line breaks open a new paragraph.
  • Single line breaks can be enforced by ending a line with two spaces (similar to Markdown).
  • A limited set of HTML tags (optionally nested), specifically:
    • <b>…</b> for boldface,
    • <i>…</i> for italics,
    • <u>…</u> for underline,
    • <br /> to enforce a single line break,
    • I could not find any way to get strikethrough working (neither HTML or Markdown style).
  • A fully-formatted URL such as http://google.com; this appears as a hyperlink.
    (Beware that trying to use an HTML <a> tag for a custom description does not work and breaks the formatting.)
  • HTML character entities are supported, such as &rarr; (→), &trade; (™) and &reg; (®); consult this W3 reference for the exhaustive list.
  • UTF-8 encoded characters are supported, such as é, €, £, ‘, ’, ★ and ☆.
  • Indentation isn't strictly possible, but using a bullet and em space character looks reasonable (&#8226;&#8195; yields "• ").
  • Emoji are also supported (though on the website depends on the user's OS & browser).
Special notes concerning only Google Play app:
  • Some HTML tags only work in the app:
    • <blockquote>…</blockquote> to indent a paragraph of text,
    • <small>…</small> for a slightly smaller text,
    • <sup>…</sup> and <sub>…</sub> for super- and subscripts.
    • <font color="#a32345">…</font> for setting font colors in HEX code.
  • Some symbols do not appear correctly, such as ‣.
  • All these notes also apply to the app's "What's New" section.
Special notes concerning only Google Play website:
  • All HTML formatting appears as plain text appears in the website's "What's New" section (i.e. users will see the HTML source).


source:http://stackoverflow.com/questions/11071127/google-play-app-description-formatting


Thursday, May 5, 2016

How to secure apache access or website folder access

Use below tricks:
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /home/secure/apasswords
Require user vivek

# chown www-data:www-data /home/secure/apasswords
# chmod 0660 /home/secure/apasswords
 vi .htaccess
Add following text:
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /home/secure/apasswords
Require user vivek

Saturday, April 23, 2016

What user do on your app - use AppSee

AppSee is best analytics tool to know what your user are doing on app. It will give video of user actions.

https://dashboard.appsee.com/login

Thursday, April 14, 2016

android alarm best practice

- reset at boot complete
- use RTC_WAKEUP

pending alarms use:
adb shell dumpsys alarm

sample code:

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

<receiver    android:name="<receiver path in code>"    android:enabled="true"    android:screenOrientation="portrait">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED" />
    </intent-filter>
</receiver>
public class RestartPhoneReceiver extends BroadcastReceiver {
    @Override    public void onReceive(Context context, Intent intent) {
        try {
            common.Log("In boot receive event");
            Long morningTime=common.GetMillisecondsTime("08:05");
            Calendar cal = Calendar.getInstance();
            cal.setTimeZone(TimeZone.getTimeZone("Asia/Calcutta"));
            cal.setTimeInMillis(morningTime);
            cal.add(Calendar.DAY_OF_MONTH,1);
            cal.add(Calendar.MINUTE_OF_HOUR,<random number>);

            long calendarTIme=cal.getTimeInMillis();

            Intent alarmintent = new Intent(context, MyAlarmService.class);

            PendingIntent sender = PendingIntent.getBroadcast(context, 12345,alarmintent, PendingIntent.FLAG_UPDATE_CURRENT|Intent.FILL_IN_DATA);
            //6*60*60*1000            AlarmManager am = (AlarmManager) context.getSystemService(context.ALARM_SERVICE);
            am.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 24*60*60*1000, sender);
        } catch (Exception e)
        {
            //        }
    }
}

Monday, February 29, 2016

attaching new volume to EC2 machine

sudo mkfs -t ext4 /dev/xvdb
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html#create_file_system_step