Skip to content

Instantly share code, notes, and snippets.

View mayurah's full-sized avatar
🧋
grooming next generation of problem solvers!

Mayur Pipaliya mayurah

🧋
grooming next generation of problem solvers!
View GitHub Profile
@mayurah
mayurah / Linux Static IP
Last active December 25, 2015 19:29 — forked from kylefoo/Linux Static IP
CentOS / Fedora / RedHat
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NAME="System eth0"
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
NM_CONTROLLED=yes
$ sudo sysctl -w net.inet.ip.forwarding=1
$ sudo natd -interface en1
$ sudo ipfw add divert natd ip from any to any via en1
=== VSFTPd with chroot and nginx compatibility ===
* curator: Mayur Pipaliya [ mayur {at} pipaliya {dot} com ]
* copyleft (ɔ) distribute, alter and use at your own risk.
* apply necessary alternation accordingly.
~~ Install vsftpd, nginx & nano editor ~~
$ sudo apt-get install vsftpd nginx nano
@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 / 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 / semantic-commit-messages.md
Created October 15, 2021 07:51 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@mayurah
mayurah / Search my gists.md
Created June 16, 2023 03:06 — forked from OrenBochman/Search my gists.md
How to search gists

Gist Search Cheatsheet

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:orenbochman

Find all gists with a .yml extension.
extension:yml