Skip to content

Instantly share code, notes, and snippets.

@Kishanjvaghela
Kishanjvaghela / start_emulator.sh
Created August 21, 2019 06:26 — forked from itmammoth/start_emulator.sh
Start an android emulator with changing DNS server to Google public DNS
#!/bin/bash
EMULATOR=~/Library/Android/sdk/tools/emulator
if [ $# -ne 1 ]; then
echo "ERROR: Please specify the target AVD from the list below" 1>&2
$EMULATOR -list-avds 1>&2
exit 1
fi
$EMULATOR -avd $1 -dns-server "8.8.8.8,8.8.4.4"
@Kishanjvaghela
Kishanjvaghela / ubuntu-eol.md
Created January 21, 2018 18:56 — forked from dergachev/ubuntu-eol.md
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]
@Kishanjvaghela
Kishanjvaghela / opacity.txt
Created December 8, 2017 09:00 — forked from alvinthen/opacity.txt
Convert opacity values in percentage to hexadecimal
0% - 00
1% - 03
2% - 05
3% - 08
4% - 0A
5% - 0D
6% - 0F
7% - 12
8% - 14
9% - 17
@Kishanjvaghela
Kishanjvaghela / gradle.md
Last active September 29, 2018 15:18 — forked from suwhs/gradle.md
5 steps for bintray-upload build.gradle (for jcenter)

add bintray and maven plugin to buildscript dependencies (project's build.gradle)

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.2'
 classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' // ADD THIS LINE
@Kishanjvaghela
Kishanjvaghela / TLSSocketFactory.java
Last active November 20, 2018 12:14 — forked from fkrauthan/TLSSocketFactory.java
Custom SSLSocketFactory Implementation to enable tls 1.1 and tls 1.2 for android 4.1 (16+)
package net.cogindo.ssl;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLContext;