Skip to content

Instantly share code, notes, and snippets.

View mnsami's full-sized avatar

Mina Nabil Sami mnsami

View GitHub Profile
@ethyde
ethyde / .bash_profile
Created December 3, 2015 11:06
Bash profile load ssh-agent and add all key in ~/.ssh/id_rsa*
# SSH Agent
# Note: ~/.ssh/environment should not be used, as it
# already has a different purpose in SSH.
# source : https://www.schoonology.com/technology/ssh-agent-windows/
env=~/.ssh/agent.env
# Note: Don't bother checking SSH_AGENT_PID. It's not used
# by SSH itself, and it might even be incorrect
# (for example, when using agent-forwarding over SSH).
@ldong
ldong / download_egghead_videos.md
Last active December 7, 2023 16:16
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});
@hans2103
hans2103 / .htaccess-mod_headers
Created April 13, 2015 08:33
.htaccess rules to set cache control.
<IfModule mod_headers.c>
Header set Connection keep-alive
# Cache-control headers
# 2 HOURS
#<filesMatch "*">
Header set Cache-Control "max-age=7200, must-revalidate"
#</filesMatch>
# 480 weeks - 290304000
@kevinkarwaski
kevinkarwaski / install-brew.sh
Last active September 13, 2023 21:34
Install Brew and set up for Standard OSX User
#!/usr/bin/env bash
# This script installs brew and chowns the right directories needed to run
# brew as a standard user. Your user should be the owner of /usr/local which
# gets set during the installation of brew. The global homebrew cache directory
# group should be set to 'staff' which is not set during a brew install. This
# script fixes that.
# To begin, you MUST execute this script with your user account while it has
# admin privileges. Once the script completes, you can change your
# Note: ~/.ssh/environment should not be used, as it
# already has a different purpose in SSH.
env=~/.ssh/agent.env
# Note: Don't bother checking SSH_AGENT_PID. It's not used
# by SSH itself, and it might even be incorrect
# (for example, when using agent-forwarding over SSH).
agent_is_running() {
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@jonavon
jonavon / CIDR.php
Created March 13, 2012 13:50
CIDR class for IPv4
<?php
/**
* CIDR.php
*
* Utility Functions for IPv4 ip addresses.
* Supports PHP 5.3+ (32 & 64 bit)
* @author Jonavon Wilcox <jowilcox@vt.edu>
* @revision Carlos Guimarães <cvsguimaraes@gmail.com>
* @version Wed Mar 12 13:00:00 EDT 2014
*/