Skip to content

Instantly share code, notes, and snippets.

@basharam
basharam / ActivityasDlg.java
Created April 18, 2012 14:34
How to show Activity as Dilaog without buttons in Android
public class ActivityasDlg extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activtyasdlg);
}
mkdir ~/android-tools/
cd ~/android-tools/
wget https://android.googlesource.com/platform/system/core/+archive/master.tar.gz
tar -xzf master.tar.gz
cd libmincrypt
gcc -c *.c -I../include
ar rcs libmincrypt.a *.o
cd ../mkbootimg
gcc mkbootimg.c -o mkbootimg -I../include ../libmincrypt/libmincrypt.a
@basharam
basharam / Makefile
Last active August 29, 2015 13:57
Makefile template in parent directory to invoke makefile in subdirectories
STATIC_LIB1 = foldername1
STATIC_LIB2 = foldername2
STATIC_LIB3 = foldername3
DYNAMIC_DLL = foldername4
RUN_SH_SCRIPT= foldername5
#$(LIBPCAP_LINUX)
ALL_TARGETS=$(RUN_SH_SCRIPT)\
@basharam
basharam / Makefile
Last active June 21, 2024 05:16
Makefile template for Static library.
# Makefile template for Static library.
# 1. Compile every *.cpp in the folder
# 2. All obj files under obj folder
# 3. static library .a at lib folder
# 4. run 'make dirmake' before calling 'make'
CC = g++
OUT_FILE_NAME = libNAME.a
@basharam
basharam / Android.mk
Last active March 1, 2018 02:02
Link prebuilt static library Android
#Link prebuilt static library Android
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#run scipt
#ECHO_RESULT := $(info $(shell ($(LOCAL_PATH)/testscript.sh)))
@basharam
basharam / git_knowhow.txt
Last active August 29, 2015 13:57
git V1.7.9.5 First Time
git V1.7.9.5 First Time
:::::::::::::::Non Bare repo:::::::::::::::::::::::::::::::
+++++++Use case 1+++++
$ git clone ~/ext/test_nb_repo/ testnb
$ cd tesnb
$ cat README
$ vi README
$ git add *
$ git commit -am "rem line 4 in readme"
@basharam
basharam / multi_adb_shell.sh
Last active August 29, 2015 14:03
open adb shell for all devices connected to host(tested on ubuntu 12.04)
#!/bin/sh
#getprocess=`adb devices`
#echo $getprocess
#set $getprocess
#deviceid=$5
#echo $deviceid
#adb -s $deviceid shell
#if [ -z "$7" ]; then
@basharam
basharam / testcmd.sh
Created July 10, 2014 10:21
test command example
#/bin/sh
echo -n Enter you Age:
read aAge
if test -z "$aAge"
then
echo Enter Age in Numeric value.
exit
fi
@basharam
basharam / hadoop_multinode_cluster_setup
Created December 29, 2014 10:39
Hadoop 2.6.0 Multinode cluster Setup
#Hadoop 2.6.0 Multinode cluster Setup
From Blog http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-multi-node-cluster/
###Machine 1(master).
Prequisite:
java version
java -version
pdp-mbp: ~ $ cat hostlist.txt
sfo-crawl-4
sfo-crawl-5
sfo-crawl-6
sfo-crawl-7
sfo-crawl-8
sfo-crawl-9
sfo-crawl-11
sfo-crawl-14
pdp-mbp: ~ $ csshX --host hostlist.txt