Skip to content

Instantly share code, notes, and snippets.


Daniel Serodio dserodio

View GitHub Profile
dserodio /
Created Jan 5, 2017 — forked from davidwindell/
Set a files last modified time to match it's git commit timestamp
#!/bin/bash -e
# based on
# Set's the last modified timestamp of a file to it's repositories commit timestamp.
# Particularly useful with docker when building after a new git checkout has been made,
# can improve docker build times for composer, bower, npm, etc
# @see
View gist:48635d457e01de3d4134f0dcabc9390b
#!/bin/bash -e
# based on
# Helper script to update the Last modified timestamp of files in a Git SCM
# Projects working Copy
# When you clone a Git repository, it sets the timestamp of all the files to the
# time when you cloned the repository.
# This becomes a problem when you want the cloned repository, which is part of a
View nfs-pvc.yaml
kind: PersistentVolumeClaim
apiVersion: v1
name: dserodio-pvc
- ReadWriteMany
storage: 1Mi
dserodio /
Created Dec 8, 2016
Attach to Moby Dock VM in Docker for Mac
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
dserodio /
Created Nov 29, 2016
Get native (no VM) Docker support for Kubernetes on OS X
# get native (no VM) docker support (see also Docker for Mac, but this is to support minikube)
brew install docker-machine-driver-xhyve
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
minikube start --vm-driver=xhyve
# or do this first
minikube config set vm-driver xhyve
minikube start
dserodio /
Last active Dec 17, 2018
Some git tips

Don't blame people for changing whitespaces or moving code

git blame will show the author of the last commit that modified the particular line. If whitespaces were removed or that piece of code was moved around, blame will show that commit and you might blame the wrong person.

git blame -w -M

-w will ignore whitespaces and -M will detect moved or copied lines.


View .tmux.conf
# Set the default terminal mode to 256color mode
set -g default-terminal "screen-256color"
# Enable utf-8
set -g status-utf8 on
## Keybindings
# use PREFIX | to split window horizontally and PREFIX - to split vertically
bind | split-window -h
dserodio /
Last active Nov 29, 2018
Python snippets
# Parse date
# $ pip install python-dateutil
from dateutil import parser
begin = parser.parse("Aug 28 1999 12:00AM")
end = parser.parse("2013-09-11")
# Print duration
delta = end - begin
print str(delta)
dserodio /
Last active Aug 15, 2016
Code for a Java CLI app to install SSL/TLS certs from a hostname/port into Java's keystore
// Blog post:
// Code found at
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
dserodio / ruby22.spec
Created May 16, 2016 — forked from ik5/ruby22.spec
A ruby 2.2.x rpm spec file
View ruby22.spec
%define rubyver 2.2.0
%define debug_package %{nil}
Name: ruby
Version: %{rubyver}
Release: 1%{?dist}
License: Ruby License/GPL - see COPYING
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel unzip openssl-devel db4-devel byacc make libyaml-devel valgrind-devel gmp-devel clang
You can’t perform that action at this time.