Skip to content

Instantly share code, notes, and snippets.

@dgitman
dgitman / generate-ssh-key.sh
Last active Apr 12, 2019 — forked from grenade/generate-ssh-key.sh
Correct file permissions for ssh keys and config.
View generate-ssh-key.sh
ssh-keygen -t rsa -b 4096 -N '' -C "david@gitman.net" -f ~/.ssh/id_rsa
@dgitman
dgitman / Dockerfile
Created Mar 22, 2019 — forked from georanma/Dockerfile
Docker Magento 1 w/ Xdebug
View Dockerfile
FROM php:7.2-fpm
RUN apt-get -qq update && apt-get -qq install libxml++2.6-dev > /dev/null
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
zlib1g-dev \
libicu-dev \
g++ \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
@dgitman
dgitman / local.xml
Last active Feb 20, 2018 — forked from jasontipton/local.xml
Magento Local.xml NOINDEX/NOFOLLOW Catalog Search
View local.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<!-- Search Results page -->
<catalogsearch_result_index>
<reference name="head">
<action method="setRobots"><value>NOINDEX,NOFOLLOW</value></action>
</reference>
</catalogsearch_result_index>
View cueConnectOnboadingEngineerTest.html
<!-- Questions
1- Format/Structuer the Html code above
2- Make the "Hello Cue" title Blue and bold, with text size = 20px
3- Make span lined up with the Hello Cue title
4- Use JQuery to Change the Title to "Hello Dolly" and to Add a new class named "cue-link"
5- Add this HTML tag "<cue id='cue-stream'>My List</cue>" next to the <span> and make the span and the cue tag shows in a separate new line
6- Use Css to style the <cue> and make it with a pointer on hover-over
-->
@dgitman
dgitman / osx-for-hackers.sh
Created Jul 5, 2016 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
View osx-for-hackers.sh
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@dgitman
dgitman / System Design.md
Created Apr 26, 2016 — forked from vasanthk/System Design.md
System Design Cheatsheet
View System Design.md

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@dgitman
dgitman / csv_splitter.py
Created Mar 14, 2016 — forked from jrivero/csv_splitter.py
A Python CSV splitter
View csv_splitter.py
import os
def split(filehandler, delimiter=',', row_limit=10000,
output_name_template='output_%s.csv', output_path='.', keep_headers=True):
"""
Splits a CSV file into multiple pieces.
A quick bastardization of the Python CSV library.
Arguments:
View update-pingdom-iptables.sh
#!/bin/bash
#
# Whitelist Pingdom probe-servers in iptables.
#
# Create a chain called "PINGDOM" and jump to it somewhere before
# the final REJECT/DROP, e.g.
#
# # New chain for Pingdom rules
# :PINGDOM - [0:0]
#
View Magento Sales Query Test
SELECT
DATE_FORMAT(
sales_flat_order.created_at,
'%Y-%m-%d'
) AS DAY,
CONCAT(
'$',
FORMAT(
SUM(sales_flat_order.`grand_total`),
2
View optimizeFragmentedTables.sh
#!/bin/sh
mysql -NBe "SHOW DATABASES;" | grep -v 'lost+found' \
| while read database ; do
#skip system-db
if [ "$database" = "mysql" ] ; then
continue
fi
mysql -NBe "SHOW TABLE STATUS;" $database \
| while read name engine version rowformat rows avgrowlength \
You can’t perform that action at this time.