Skip to content

Instantly share code, notes, and snippets.

View Bharat-B's full-sized avatar

Bharat B Bharat-B

  • Secunderabad,Andhra Pradesh, India.
View GitHub Profile
@Bharat-B
Bharat-B / report.py
Created November 29, 2015 18:49
OpenVZ node information reporter
#!/usr/bin/python
import subprocess
import platform
import urllib2
import urllib
#Add your url to post data here
server_url = "url_to_post_here"
def bash(command):
@Bharat-B
Bharat-B / imap.php
Last active October 10, 2020 07:30
php-imap-class
<?php
class IMAP {
protected $constring;
protected $connection;
protected $extensions = array( "txt", "jpg", "jpeg", "png", "xls", "doc", "docx", "xlsx", "zip", "rar", "pdf" );
protected $mimeType = array( "text", "multipart", "message", "application", "audio", "image", "video", "other" );
@Bharat-B
Bharat-B / backup.sh
Last active March 21, 2017 10:15
Bash script to backup any organization's github repositories to AWS S3 and post notifications to slack channel
#!/bin/bash
#Define variables
now=`date "+%Y-%m-%d-%H-%M-%S"`
#Github Organization
GB_ORG=""
#Github Username
GB_USR=""
#Github Password
GB_PWD=""
@Bharat-B
Bharat-B / keybase.md
Last active September 28, 2017 12:27
Keybase

Keybase proof

I hereby claim:

  • I am bharat-b on github.
  • I am bharatb (https://keybase.io/bharatb) on keybase.
  • I have a public key ASD8PaDhbgWnjD_BGah4s6x7EmgOC__2VlYea3dhotCf2Qo

To claim this, I am signing this object:

@Bharat-B
Bharat-B / hostname.conf
Created February 23, 2018 08:22
WHMCS nGINX rules for SSL / Non SSL
### NON SSL | STANDARD HTTP
server {
listen 80;
server_name domain.com;
root /path/to/whmcs;
index index.php index.html;
access_log /var/log/nginx/domain.com.log combined;
access_log /var/log/nginx/domain.com.bytes bytes;
error_log /var/log/nginx/domain.com.error.log error;
location / {
@Bharat-B
Bharat-B / README.md
Last active February 3, 2024 05:12
A python script that downloads multiple files in parallel with support for s3:// | http:// | https:// protocols

Python

A script that downloads multiple files in parallel with support for s3:// | http:// | https:// protocols

Description

downloader.py

Usage: python downloader.py url1 url2 url3

@Bharat-B
Bharat-B / whmcs.php
Last active May 19, 2019 14:34
WHMCS remote execution
<?php
class HypervisorWHMCS {
protected $action, $params = [], $config, $error, $output = "";
public function __construct($config) {
$this->config = $config;
}
@Bharat-B
Bharat-B / install.sh
Created September 14, 2020 17:22
Install.sh
#!/bin/bash
ECHO_PATH=/usr/bin/echo
TEE_PATH=/usr/bin/tee
YUM_PATH=/usr/bin/yum
CURL_PATH=/usr/bin/curl
TAR_PATH=/usr/bin/tar
WGET_PATH=/usr/bin/wget
INSTALL_LOG=./hypervisor-install.log
@Bharat-B
Bharat-B / readydedis.com.conf
Last active March 4, 2024 18:02
nGINX rewrite rules for whmcs 8
server {
listen 80 default_server;
server_name readydedis.com www.readydedis.com;
return 301 https://readydedis.com$request_uri;
}
# HTTPS server
#
server {
listen 443;
@Bharat-B
Bharat-B / prox_gen.php
Created March 24, 2021 14:19
A virtualizor dependent php script to regenerate proxmox vm configs for kvm.
<?php
# Execution /usr/local/emps/bin/php /usr/local/virtualizor/prox_gen.php "server_id"
include_once 'scripts/inc.php';
$res = makequery("
SELECT
vps_name as conf,
disks.bus_driver as diskdriver,