Skip to content

Instantly share code, notes, and snippets.

View dmsherazi's full-sized avatar

Dost Muhammad Shah dmsherazi

View GitHub Profile
@dmsherazi
dmsherazi / setup.sh
Last active November 6, 2019 15:25 — forked from jjvillavicencio/setup.sh
Install Android SDK on Windows Bash (WSL)
cd
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
#!/bin/bash
# Download and build libcurl, openssl and zlib for Android using Crystax NDK r7
# Must be run on 32 bit Linux as the Crystax r7 NDK doesn't support 64 bit hosts
# Tested on Ubuntu 14.04
# Make the working directory
mkdir curl-android-build
cd curl-android-build
ROOT_DIR=`pwd -P`
@dmsherazi
dmsherazi / dumb-ap-wired-link.sh
Created March 12, 2019 13:50 — forked from braian87b/dumb-ap-wired-link.sh
How to setup a Dumb AP, Wired backbone for OpenWRT / LEDE
@dmsherazi
dmsherazi / Makefile
Created October 18, 2018 11:27 — forked from hu55a1n1/Makefile
OpenWrt Makefile for Amfeltec Piranha USB FXO
#
# Copyright (C) 2014 - 2018 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# make package/feeds/telephony/amfeltec_usb/compile -j1 V=s
#
# Patch downloaded sources:
# Makefile -
@dmsherazi
dmsherazi / code.php
Created February 21, 2017 12:24 — forked from bappi-d-great/code.php
current_user_on_membership function for membership 2
<?php
if( ! function_exists( 'current_user_on_membership' ) ) {
function current_user_on_membership( $membership_id ) {
$member = MS_Model_Member::get_current_member();
$membership_items = $member->get_membership_ids();
if( in_array( $membership_id, $membership_items ) ) {
return true;
}
return false;
@dmsherazi
dmsherazi / app-module-build.gradle
Created January 2, 2017 14:10 — forked from segunfamisa/app-module-build.gradle
Using gradle extra properties to manage Android dependency versioning
// app module build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
applicationId "com.segunfamisa.gradleextraproperties"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
@dmsherazi
dmsherazi / sip_speaker.py
Created October 21, 2016 10:42 — forked from hu55a1n1/sip_speaker.py
PJSIP: Play incoming call on audio device in python
#!/usr/bin/python
#
#
# Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@dmsherazi
dmsherazi / Schema.php
Created April 11, 2016 09:49 — forked from tournasdim/Schema.php
A list of Laravel's Schema commands (Laravel 4)
<?php
Schema::create('users' , function($table)
{
$table->increments('id'); Incrementing ID to the table (primary key).
$table->string('email'); VARCHAR equivalent column
$table->string('name', 100); VARCHAR equivalent with a length
$table->integer('votes'); INTEGER equivalent to the table
@dmsherazi
dmsherazi / SimpleMqttClient.java
Created February 23, 2016 11:36 — forked from m2mIO-gister/SimpleMqttClient.java
Example MQTT Messaging in Java
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.MqttTopic;
public class SimpleMqttClient implements MqttCallback {
@dmsherazi
dmsherazi / sim900.mdown
Created November 23, 2015 09:42 — forked from tegila/sim900.mdown
SIM900 TIPS AND TRICKS

TUTORIAL

Attach to GPRS Service

-> AT+CGATT = 1
<- OK

Define PDP Context (cid, PDP type, APN)

-&gt; AT+CGDCONT=1,"IP","zap.vivo.com.br"