Skip to content

Instantly share code, notes, and snippets.

Daniel Serodio dserodio

Block or report user

Report or block dserodio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dserodio
dserodio / hook_stdout_stderr
Last active Dec 4, 2015
Hook into stdout and stderr of a running process
View hook_stdout_stderr
sudo strace -p $PID -e trace=write -e write=1,2
# To log started and elapsed times, add -ttT
@dserodio
dserodio / 0_reuse_code.js
Created Oct 22, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dserodio
dserodio / find_broken_jars.sh
Created Mar 2, 2016
Find HTML files named *.jar (to find broken JARs downloaded from codehaus.org)
View find_broken_jars.sh
find ~/.m2/repository -name '*.jar' -exec sh -c "file {} | grep -q HTML && echo {}" \; | tee ~/broken-jars.txt
@dserodio
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
URL: http://www.ruby-lang.org/
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
@dserodio
dserodio / log.py
Last active Aug 3, 2016
Python logging setup
View log.py
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)-.5s %(message)s')
logging.getLogger('requests').setLevel(logging.WARN)
@dserodio
dserodio / InstallCert.java
Last active Aug 15, 2016
Code for a Java CLI app to install SSL/TLS certs from a hostname/port into Java's keystore
View InstallCert.java
// Blog post: https://web.archive.org/web/20080308103645/http://blogs.sun.com/andreas/entry/no_more_unable_to_find
// Code found at https://web.archive.org/web/20080308103645/http://blogs.sun.com/andreas/resource/InstallCert.java
/*
* 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
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
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb|
vb.name = "ubuntu.local"
vb.customize [ 'modifyvm', :id, '--memory', '512' ]
vb.customize [ 'modifyvm', :id, '--cpus', '1' ]
end
View nfs-pvc.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: dserodio-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Mi
View gist:48635d457e01de3d4134f0dcabc9390b
#!/bin/bash -e
####
# based on https://gist.github.com/jeffery/1115504
# 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
You can’t perform that action at this time.