Skip to content

Instantly share code, notes, and snippets.

View skyrocknroll's full-sized avatar

Yuvaraj L skyrocknroll

View GitHub Profile
@skyrocknroll
skyrocknroll / RelianceUsageQuery
Created June 5, 2011 06:43
Reliance Usage Query
http://myservices.relianceada.com/datausage/jsp/ProcessCDRRequest?Mdn=7483099313&StartDate=2011-06-04&EndDate=2011-06-05&ProductType=1&RequestType=Query
@skyrocknroll
skyrocknroll / sim300_AT_CMD
Created August 6, 2011 11:13
AT Commands Sim #300
AT+IPR? // Will return serial baud rate
AT+IPR=? // Will return possible baud rates
AT+IPR=9600 // sets the serial baud rate to 9600 bps
AT&W // Write the settings
AT&F // Restore factory settings
ATD09849985245; //To dial
AT+CPIN?
+CPIN: READY
OK
@skyrocknroll
skyrocknroll / gsm
Created September 3, 2011 06:17
GSM Code Text Message Read...
#include <string.h> //Used for string manipulations
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2); //LCD Initialization
int i,j = 0;
int startRead = 1;
char smsVal = 0;
char sms[64]={
'\0'};
@skyrocknroll
skyrocknroll / gist:1688232
Created January 27, 2012 10:42
Google mp3 search query
-inurl:(htm|html|php) intitle:"index of" +"last modified" +"parent directory" +description +size +(wma|mp3) "Nirvana"
-inurl:(htm|html|php) intitle:"index of" +"last modified" +"parent directory" +description +size "Tamil"
@skyrocknroll
skyrocknroll / mysqlDBtoRAM
Created March 9, 2012 11:24
Loading the DB into memory.
Move the data directory to an in-memory filesystem.
In Linux, it’s usually in /dev/shm.
1. stop the server
2. cd /usr/local/mysql
3. mv data data1
4. cp -R data1 /dev/shm/data
5. ln -s /dev/shm/data /usr/local/mysql/data
@skyrocknroll
skyrocknroll / latency.txt
Created May 31, 2012 13:48 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
@skyrocknroll
skyrocknroll / photovault
Created November 28, 2012 12:59
nginx Config file
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/localhost.access.log;
root /uploads;
index index.html index.htm;
if_modified_since before; #if modified header
# Make site accessible from http://localhost/
@skyrocknroll
skyrocknroll / apacheploting
Last active October 13, 2015 09:37
GNUPlot Script
#To install apt-get install gnuplot gnuplot-x11 (tested)
#To install apt-get install gnuplot gnuplot-qt (Not tested)
set xlabel "Requests"
set ylabel "Response time (ms)"
set title "ab -n 1000 -c 100"
plot "apache1000-100-200K.tsv" using 9 smooth sbezier with lines title "time for 200K",\
"apache1000-100-500K.tsv" using 9 smooth sbezier with lines title "time for 500K",\
"apache1000-100-1M.tsv" using 9 smooth sbezier with lines title "time for 1M",\
@skyrocknroll
skyrocknroll / ab.c
Created December 7, 2012 09:22
Gwan Performance Tuning and Benchmarking
// ----------------------------------------------------------------------------
// ab.c is a wrapper for Apache Benchmark, HTTPerf and Weighttp (from Lighttpd)
// ----------------------------------------------------------------------------
// For max speed, build and run ab.c: gcc ab.c -O2 -o abc -lpthread (and ./abc)
// You can also edit & play this program in one step this way: ./gwan -r ab.c
// ============================================================================
// Benchmark framework to test the (free) G-WAN Web App. Server http://gwan.ch/
// See the How-To here: http://gwan.com/en_apachebench_httperf.html
// ----------------------------------------------------------------------------
// 1) invoke Apache Benchmark (IBM), Weighttp (Lighttpd) or HTTPerf (HP) on
#!/bin/sh
# Print the serial number of your disks with this script
ls /dev/disk/by-id/ata* | awk -F- '{ if (NF==4) { print $NF} }' | while read SERIAL;
do
DEVICE=$(readlink -f /dev/disk/by-id/*$SERIAL);
echo $DEVICE" "$SERIAL;
done | sort;