Skip to content

Instantly share code, notes, and snippets.

View chayanforyou's full-sized avatar
🤖
Learning

Chayan Mistry chayanforyou

🤖
Learning
View GitHub Profile
@chayanforyou
chayanforyou / gist:30ef3064566d0f9aa1e0
Last active January 31, 2016 17:21 — forked from anonymous/gist:5154933
Nokia Experiment2
#define BUFFERSIZE 127
uint8_t inBuffer[BUFFERSIZE];
int inLength; // length of data in the buffer
int numLoop = 0; // number of times we looped
int ledPin = 13;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop() {
@chayanforyou
chayanforyou / 4-esc-arduino.ino
Created September 6, 2016 04:47
Control 4 brushless motors with arduino
#include <Servo.h>
//Create the 4 esc objects
Servo esc1;
Servo esc2;
Servo esc3;
Servo esc4;
//Esc pins
int escPin1 = 8;
@chayanforyou
chayanforyou / genymotionwithplay.md
Created July 10, 2017 07:52 — forked from udev/genymotionwithplay.md
Genymotion with Google Play Services

#Download the following ZIPs: ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)

#Download the correct GApps for your Android version: Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip) Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip) Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip) Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip) Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip) Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)

@chayanforyou
chayanforyou / counting-millis.c
Created April 11, 2019 03:15 — forked from adnbr/counting-millis.c
Counting the passing of milliseconds using Timer1 on AVR.
/* Counting Milliseconds with Timer1
* ---------------------------------
* For more information see
* http://www.adnbr.co.uk/articles/counting-milliseconds
*
* 620 bytes - ATmega168 - 16MHz
*/
// 16MHz Clock
#define F_CPU 16000000UL
@chayanforyou
chayanforyou / Arduino 230v Light bulb dimming
Created July 4, 2019 14:24 — forked from ryanamaral/Arduino 230v Light bulb dimming
Arduino 230v Light Bulb Dimming (Portugal 220V 50 Hz)
//source: http://electronics.stackexchange.com/q/59615
int AC_LOAD = 3; // Output to Opto Triac pin
int dimming = 128; // Dimming level (0-128) 0 = ON, 128 = OFF
void setup()
{
pinMode(AC_LOAD, OUTPUT); // Set the AC Load as output
attachInterrupt(0, zero_crosss_int, RISING); // Choose the zero cross interrupt # from the table above
}
@chayanforyou
chayanforyou / gist:a9b215b8f737f83f5ce15f25cc0d0980
Created January 21, 2020 12:50 — forked from sonvp/gist:7873060a99895f483ca48fdc030c71ad
DrawableLeft to top or DrawableRight to top in TextView multiline.
1. Create Custom TextView.
public class TextViewDrawable extends android.support.v7.widget.AppCompatTextView {
public TextViewDrawable(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
/**
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(

SSL handshake error

192.168.0.14:56294: CONNECT android.googleapis.com:443
 << Cannot establish TLS with client (sni: android.googleapis.com): TlsException("SSL handshake error: Error([('SSL routines', 'ssl3_read_bytes', 'sslv3 alert certificate unknown')],)",)

sslv3_alert_certificate_unknown

Solution

@chayanforyou
chayanforyou / 00-android-bypass-certificate-pinning-and-mitm-attack-setup.md
Created November 25, 2021 04:28 — forked from approovm/00-android-bypass-certificate-pinning-and-mitm-attack-setup.md
Certificate Pinning Bypassing: Setup with Frida, mitmproxy and Android Emulator with a writable file system

You can download this file from the browser or from the console. The latter is shown below (note: the specific Node.js version might be different for you):

wget http://nodejs.org/dist/v14.15.0/node-v14.15.0-linux-x64.tar.gz
sudo tar -C /usr/local --strip-components 1 -xzf node-v14.15.0-linux-x64.tar.gz

You may find list of node version on http://nodejs.org/dist/