Skip to content

Instantly share code, notes, and snippets.

View mayurah's full-sized avatar
🏔️
grooming next generation of leaders and problem solvers!

Mayur Pipaliya mayurah

🏔️
grooming next generation of leaders and problem solvers!
View GitHub Profile
@mayurah
mayurah / rule.php
Created April 2, 2017 17:19 — forked from shhetri/rule.php
<?php
/**
* Rule 2 : Naming
*/
$mf = new Form(); //is bad
$monitoringForm = new Form(); //is good
//this is bad
foreach ($people as $x) {
@mayurah
mayurah / byobuCommands
Created April 2, 2017 18:39 — forked from jshaw/byobuCommands
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
@mayurah
mayurah / status.json
Created May 19, 2017 04:12
data format for predictive analytics on services
{
"service": "transaction_api",
"timestamp": "2017-05-16T18:15:14Z",
"latency": "10ms",
"status": "up",
"description": "Transaaction API facilitates credit card processing channel communicating with multiple processors",
"overall_outage": 5,
"uptime": 99.9,
},
{
@mayurah
mayurah / macos_sierra.as
Created August 9, 2017 18:46
macOS Sierra - CLI installer Steps
0x00 - Download the macOS Sierra installer from App Store (Purchased)
0x01 - Format Flash Drive to: "OSXSierra" and choose the Format "OS X Extended (Journaled)",
0x02 - Terminal cmd> sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/OSXSierra --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction
0x03 - Boot Test> Press and hold the Option (⌥) key immediately upon hearing the startup chime!
@mayurah
mayurah / sips: CR2 to jpeg
Created August 9, 2017 20:42
Mass convert CR2 (Raw Image File) to JPEG in macOS command-line.
# Mass convert CR2 (Raw Image File) to JPEG in macOS command-line.
mkdir Converted
for i in *.CR2; do sips -s format jpeg $i --out Converted/$i.jpg;done
@mayurah
mayurah / splunk enterprise
Last active November 3, 2017 19:56
Splunk enterprise on Ubuntu
# misc.
./splunk install app -update 1 -auth :
By default, splunk ports are listening on all iterfaces with port 8000, and 127.0.0.1 with port 8065... this can be modified by tinkering with /opt/splunk/lib/py*/site-packages/splunk/appserver/mrsparkle/root-py --proxied=...
splunk/kvstore/mongo
# To start splunk daemon
sudo /opt/splunk/bin/splunk start
# To make local Linux splunk instance available online
@mayurah
mayurah / speedtest.sh
Created January 4, 2018 20:25 — forked from mariusrugan/speedtest.sh
CURL download benchmark
#!/ffp/bin/bash
# https://linhost.info/2013/10/download-test-files/
SOURCES=(
"http://ns0.multikabel.net/100mb.nul"
"http://servermars.nl/100mb.bin"
"http://speedtest.tweak.nl/100mb.bin"
"http://cachefly.cachefly.net/100mb.test"
"http://mirror.leaseweb.com/speedtest/100mb.bin"
@mayurah
mayurah / batchdl.ps1
Created January 11, 2018 19:05
Batch download
####################################################################################################
# This function copies a folder (and optionally, its subfolders)
#
# When copying subfolders it calls itself recursively
#
# Requires WebClient object $webClient defined, e.g. $webClient = New-Object System.Net.WebClient
#
# Parameters:
# $source - The url of folder to copy, with trailing /, e.g. http://website/folder/structure/
# $destination - The folder to copy $source to, with trailing \ e.g. D:\CopyOfStructure\
@mayurah
mayurah / pre-commit
Created May 1, 2018 15:34 — forked from hraban/pre-commit.md
Git pre-commit hook (.git/hooks/pre-commit) to prevent accidentally committing debug code (add NOCOMMIT in source comment)
#!/bin/sh
# This pre-commit hook will prevent you from committing any line (or filename) containing
# the string NOCOMMIT. Use that tag in comments around source code you want to avoid
# accidentally committing, like temporary IP addresses or debug printfs.
#
# To add it to an existing repository, save it to .git/hooks/pre-commit (or append, if
# that file already exists). Remember to make executable (chmod +x ...)
#
# To automatically add this pre-commit hook to every repository you create or clone:
@mayurah
mayurah / proxmox_notes.as
Last active August 27, 2018 13:06
Proxmox Notes
## INSTALL VALID SSL
(Helps fix VNC error with SSL) Err: Failed to start VNC server: Our own certificate /etc/pve/local/pve-ssl.pem failed validation against /etc/pve/pve-root-ca.pem: The certificate hasn't got a known issuer
# Must rm/mv existing SSL
/etc/pve/pve-root-ca.pem
/etc/pve/priv/pve-root-ca.key
/etc/pve/nodes/<node>/pve-ssl.pem
/etc/pve/nodes/<node>/pve-ssl.key