Skip to content

Instantly share code, notes, and snippets.

@Rajeshr34
Rajeshr34 / prometheus.sh
Last active March 15, 2016 07:36
PROMETHEUS 0.17.0 + NODEEXPORTER 0.12.0rc3 + GRAFANA 2.6.0 on UBUNTU 15+ (64 Bit)
#After Installation Complete.
#http://your_server_ip:3000/
#ADD Data Source
#Name: Prometheus
#Type: Prometheus
#URL: http://<your_server_ip>:9090, (default port is 9090)
#Access: proxy
#Basic Auth: Enabled or Disabled, as your Prometheus server is configured.
#Visit http://grafana.org/assets/dashboards/prometheus-dash.json
#Import Json File.
@Rajeshr34
Rajeshr34 / console.log.js
Last active November 30, 2016 08:08
FontAwesome To Android XML Array String CheatSheet
// Vist "http://fontawesome.io/cheatsheet/" then Run this in Console
var container = $('.container .page-header').parents('.container');
var ix = "";
container.find('.row > div').each(function(i, e) {
$(e).find('i').remove();
$(e).find('.text-muted.pull-right').remove();
let result = $.trim($(e).text()).replace(/(\s|\(alias\))+/g, " ");
ix += "," + result;
})
@Rajeshr34
Rajeshr34 / wkhtmltopdf.sh
Last active July 8, 2024 05:42
Wkhtmltopdf With Patched QT Setup Ubuntu 16+
cd ~
apt-get install libfontenc1 xfonts-75dpi xfonts-base xfonts-encodings xfonts-utils openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig -y
#https://github.com/wkhtmltopdf/wkhtmltopdf/releases
#replace arch
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
apt --fix-broken install
@Rajeshr34
Rajeshr34 / settings.text
Created June 27, 2017 09:55
Google Custom Search Chrome
Search Engine:
Google
keyword:
google.co.in
Query:
{google:baseURL}search?q=%s&tbs=qdr:y&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:iOSSearchLanguage}{google:searchClient}{google:sourceId}{google:instantExtendedEnabledParameter}{google:contextualSearchVersion}ie={inputEncoding}
@Rajeshr34
Rajeshr34 / getBase64.sh
Created October 26, 2017 05:32
Google App signing der file to Facebook base64
type deployment_cert.der | openssl sha1 -binary | openssl base64
@Rajeshr34
Rajeshr34 / jwtRS256.sh
Created October 30, 2017 02:17 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@Rajeshr34
Rajeshr34 / _cors
Last active November 4, 2017 16:23
cors
#location ~ \.php$ {
# try_files $uri =404;
# fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
# fastcgi_index /index.php;
# include fastcgi_params;
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_param PATH_INFO $fastcgi_path_info;
# fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#
@Rajeshr34
Rajeshr34 / nginx_redirect
Last active November 23, 2017 06:53
Nginx Redirect www to non WWW
#Main Domain
#https?://www.example.com;
server {
listen 80;
server_name ~^www\.(?<dname>\w+)\.(?<dtype>\w+)$;
return 301 $scheme://$dname.$dtype$request_uri;
}
#Sub Domains if in case
@Rajeshr34
Rajeshr34 / Query.zep
Last active March 15, 2019 06:15
Phalcon\Mvc\Model\Query.zep
/*
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2017 Phalcon Team (https://phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file LICENSE.txt. |
| |
@Rajeshr34
Rajeshr34 / tracker.php
Last active September 12, 2018 07:36
Price Tracker India
<?php
use DiDom\Document;
use Stringy\Stringy as S;
class tracker
{
public function __construct()
{
$this->priceTrack();