Skip to content

Instantly share code, notes, and snippets.

View maximkott's full-sized avatar
💭
☕️ + 🍕 + 🍺 = 1100 1010 0011

Maxim Kott maximkott

💭
☕️ + 🍕 + 🍺 = 1100 1010 0011
View GitHub Profile
exec ssh-agent bash
chmod 600 path/to/.ssh/id_rsa
ssh-add path/to/.ssh/id_rsa
ssh-add -l
@maximkott
maximkott / mcd
Created June 12, 2015 11:42
Make dir and cd.
mkdir -p "$@" && cd "$_";
@maximkott
maximkott / mr
Created February 27, 2015 14:37
Recursively replace a pattern in files
#!/bin/bash
if [ -z "$1" ]; then
echo "mising argument: query"
exit 0
fi
if [ -z "$2" ]; then
echo "mising argument: replace"
exit 0
@maximkott
maximkott / swap.php
Last active August 29, 2015 14:15
Swap two files/folders.
#!/usr/bin/env php
<?php
function ask($string) {
echo "$string (y/n): ";
$handle = fopen("php://stdin","r");
$line = trim(fgets($handle));
if ($line == 'y' or $line == 'yes') {