Skip to content

Instantly share code, notes, and snippets.

View manniru's full-sized avatar

MUHAMMAD MANNIR AHMAD manniru

View GitHub Profile
from twilio.rest import TwilioRestClient
class TwilioSMS:
def __init__(self):
self.account_sid = "AC0b56c1b6b1ff87e0caaf2c41ee5a7380"
self.auth_token = "d788a0bac58674a4efdd8fdb86c201a6"
def viewsms(self):
mkdir /home/pi/noip
cd /home/pi/noip
wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
tar vzxf noip-duc-linux.tar.gz
cd noip-2.1.9-1
sudo make
sudo make install
sudo /usr/local/bin/noip2
// install unpn server and dnla server
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
sudo npm install npm -g
http://nodejs.org/dist/v0.10.29/node-v0.10.29.tar.gz
wget http://nodejs.org/dist/v0.8.1/node-v0.8.1.tar.gz
@manniru
manniru / OpenCVRaspberry.sh
Created July 19, 2014 04:57
Install OpenCV on Raspberry Pi
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install pkg-config
sudo apt-get install libpng12-0 libpng12-dev libpng++-dev libpng3
sudo apt-get install libpnglite-dev libpngwriter0-dev libpngwriter0c2
sudo apt-get install zlib1g-dbg zlib1g zlib1g-dev
sudo apt-get install pngtools libtiff4-dev libtiff4 libtiffxx0c2 libtiff-tools
sudo apt-get install libjpeg8 libjpeg8-dev libjpeg8-dbg libjpeg-progs
sudo apt-get install ffmpeg libavcodec-dev libavcodec52 libavformat52 libavformat-dev
sudo apt-get install libgstreamer0.10-0-dbg libgstreamer0.10-0 libgstreamer0.10-dev
// http://elinux.org/RPi_Text_to_Speech_%28Speech_Synthesis%29
// test sound
aplay /usr/share/sounds/alsa/*
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install alsa-utils
sudo nano /etc/modules
@manniru
manniru / springwebmvc
Last active August 29, 2015 14:04
Spring MVC 4 Quickstart Maven Archetype
mvn archetype:generate -DarchetypeGroupId=com.github.spring-mvc-archetypes -DarchetypeArtifactId=spring-mvc-quickstart -DarchetypeVersion=1.0.0-SNAPSHOT -DgroupId=com.mannir -DartifactId=mobilenfc -Dversion=1
cd mobilenfc
mvn test tomcat7:run
<?php
// input misspelled word
$input = 'carrrot';
// array of words to check against
$words = array('apple','pineapple','banana','orange',
'radish','carrot','pea','bean','potato');
// no shortest distance found, yet
$shortest = -1;
@manniru
manniru / select_single_row.sql
Created July 31, 2014 17:45
select if rows contain morethan 1 value
SELECT `fullname`,if(count(`fullname`)>1,fullname,'NULL') as fullname
FROM (SELECT * FROM `_application` ORDER BY fullname ASC)
`_application`
GROUP BY `fullname`
ORDER BY `id` ASC
sudo apt-get install tcl 8.4-dev tk 8.4-dev
sudo apt-get install build-essential autoconf automake libxmu-dev
bashrc
# LD_LIBRARY_PATH
OTCL_LIB=/your/path/ns-allinone-2.31/otcl-1.13
NS2_LIB=/your/path/ns-allinone-2.31/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB