Skip to content

Instantly share code, notes, and snippets.

View gdakram's full-sized avatar
😺

Shahrier Akram gdakram

😺
  • Slytrunk
  • Pacifica, CA
View GitHub Profile
@gdakram
gdakram / install-elastic-search.sh
Created February 11, 2014 19:55
Debian - Install ElasticSearch
VERSION=0.90.1
sudo apt-get update
sudo apt-get install openjdk-6-jdk
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb
sudo dpkg -i elasticsearch-$VERSION.deb
# be sure you add "action.disable_delete_all_indices" : true to the config!!
@gdakram
gdakram / install-rabbitmq.sh
Created February 11, 2014 20:51
Debian - RabbitMQ Installtion
# as root
echo -e "\ndeb http://www.rabbitmq.com/debian/ testing main" >> /etc/apt/sources.list
wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
apt-key add rabbitmq-signing-key-public.asc
apt-get update
@gdakram
gdakram / install-rabbitmq.sh
Created February 12, 2014 18:32
CentOS - RabbitMQ Installation
# Install rabbitmq
wget -O /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo
yum install erlang
rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
rpm -Uvh http://www.rabbitmq.com/releases/rabbitmq-server/v3.2.3/rabbitmq-server-3.2.3-1.noarch.rpm
@gdakram
gdakram / elasticsearch.repo
Last active August 29, 2015 13:56
CentOS (64bit) - ElasticSearch Installation
[elasticsearch-1.0]
name=Elasticsearch repository for 1.0.x packages
baseurl=http://packages.elasticsearch.org/elasticsearch/1.0/centos
gpgcheck=1
gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch
enabled=1
@gdakram
gdakram / yoda.java
Created May 23, 2014 06:44
media player with surface view example that scales with cropping
final SurfaceView sv = (SurfaceView) findViewById(R.id.splash_surface);
MediaPlayer mp = new MediaPlayer();
mp.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onPrepared(MediaPlayer mp) {
mp.setVideoScalingMode(MediaPlayer.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING);
mp.setDisplay(sv.getHolder());
mp.start();
# Try to tap the screen until view open on screen
# x:: starting x value
# y:: starting y value
# x_delta:: Value to change in x direction
# y_delta:: Value to change in y direction
# query:: query to wait for the view
# number_of_tries:: number of tries
def touch_element_by_moving(x, y, x_delta, y_delta, query, number_of_tries=5)
i = 0
begin
# Bash snippet to open new shells in most recently visited dir.
# Useful if you want to open a new terminal tab at the present
# tab's location.
#
# Put this in your .bashrc or whatever.
pathed_cd () {
if [ "$1" == "" ]; then
cd
else
ps aux | grep http | grep "\-k" | awk {/[0-9]+/ '{print $2}' | xargs kill -9
$j(document).ready(function(){
if (window.location.href.match(/avatarSelect/)) {
var greeting = $j("<p><a href='http://questatlantis.org'>Apapane, I like how I look. What next?</p></a>");
$j("input[name=btnSubmit]:first").parent().append(greeting);
}
});