Skip to content

Instantly share code, notes, and snippets.

@SuryaElite
SuryaElite / merge_all_csv_to_large_one
Created October 13, 2014 12:03
Merge all the CSV to a Large CSV file in a Folder.
# This program will merge all the csv files to a single large file. Headers should be same.
# sampleFile.csv = Provide a file that contains the header of csv.
{ head -n1 sampleFile.csv; for f in *.csv; do tail -n+2 "$f"; done; } > largeFile.csv
@SuryaElite
SuryaElite / magento2.0.dev
Last active April 15, 2016 05:58
Nginx Configuration for Magento 2.*
# Nginx Configuration for Magento Community Edition 2.0*
# run on Browser http://magento.dev/setup/
# In your php.ini set cgi.fix_pathinfo to 1
upstream fastcgi_backend {
# use tcp connection
# server 127.0.0.1:9000;
# or socket
server unix:/var/run/php5-fpm.sock;
}
@SuryaElite
SuryaElite / keybase.md
Last active May 2, 2016 09:35
keybase.md

Keybase proof

I hereby claim:

  • I am SuryaElite on github.
  • I am suryaelite (https://keybase.io/suryaelite) on keybase.
  • I have a public key whose fingerprint is EEF6 A1FF 0F26 F12E C2FE DB0E 2BB8 05C1 1445 AE66

To claim this, I am signing this object:

@SuryaElite
SuryaElite / convert.php
Created June 14, 2016 09:14
Hex Binary Conversion PHP
<?php
// Converts text to decimal. Only onne character. Returns in format: 0-255
function txt2dec($txt)
{
return ord($txt);
}
// Converts text to hex. Only one character. Returns in format: XX not X
function txt2hex($txt)
{
@SuryaElite
SuryaElite / deploy.sh
Created June 14, 2016 09:21
Deploy Code via Bash Git Hub
#!/bin/bash
# App Vars
GIT_DIR='~/user/code'
GIT_BRANCH='integration'
USER=`whoami`
GIT=`which git`
# Go to the Git Directory
cd $GIT_DIR
@SuryaElite
SuryaElite / print_star_vertically.php
Created February 10, 2017 21:18
Funny Problems: Print Stars Vertically
<?php
$values = array(2,4,1,3,1,9);
$max = max($values);
$count = count($values);
$finalString = "";
for ($i = 0 ; $i < $max; $i++) {
for($j = 0; $j < $count ; $j++) {
$values[$j] < ($max - $i) ? $finalString .= " " : $finalString .= " * ";
@SuryaElite
SuryaElite / ngnix.conf
Last active March 9, 2017 10:42
Sample nginx conf with ssl enabled letsencrypt
server {
listen 80;
server_name suryaelite.com www.suryaelite.com;
return 301 https://suryaelite.com$request_uri;
}
server {
listen 443 ssl spdy;
server_name www.suryaelite.com;
return 301 https://suryaelite.com$request_uri;
@SuryaElite
SuryaElite / whatsapp_phone_enumerator_floated_div.js
Created May 12, 2017 13:17
PoC WhatsApp enumeration of phonenumbers, profile pics, about texts and online statuses (floated div)
/*
PoC WhatsApp enumeration of phonenumbers, profile pics, about texts and online statuses
Floated div edition
01-05-2017
(c) 2017 - Loran Kloeze - loran@ralon.nl
This script creates a UI on top of the WhatsApp Web interface. It enumerates certain kinds
of information from a range of phonenumbers. It doesn't matter if these numbers are part
of your contact list. At the end a table is displayed containing phonenumbers, profile pics,
about texts and online statuses. The online statuses are being updated every
@SuryaElite
SuryaElite / Convert XLSX or XLS file to Array in PHP
Created September 9, 2014 15:53
Convert XLSX or XLS file to Array in PHP
<?php
function convertXLStoArray($infile, $outfile){
if(!file_exists($infile) || !is_readable($infile) || !file_exists($outfile) || !is_readable($outfile))
return FALSE;
$fileType = PHPExcel_IOFactory::identify($infile);
$objReader = PHPExcel_IOFactory::createReader($fileType);
@SuryaElite
SuryaElite / postgres-brew.md
Created May 5, 2019 11:21 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update