Skip to content

Instantly share code, notes, and snippets.

@andromedarabbit
andromedarabbit / chmodr.sh
Created October 17, 2012 06:16 — forked from francisbyrne/chmodr.sh
Recursive chmod script for dirs and/or files
#!/bin/sh
#
# chmodr.sh
#
# author: Francis Byrne
# date: 2011/02/12
#
# Generic Script for recursively setting permissions for directories and files
# to defined or default permissions using chmod.
#
@andromedarabbit
andromedarabbit / JQueryValidator.js
Created December 28, 2012 10:15
JQuery Validator 의 커스터마이징
<script type="text/javascript">
<!--
JQuery Validator의 경고 메시지를 alert 창에 표시한다.
-->
$(document).ready(function(){
$.validator.setDefaults({
onkeyup: false
, onclick: false
, onfocusout: false
, showErrors: function(errorMap, errorList) {
@andromedarabbit
andromedarabbit / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# for Python 3
str(sample_bytes, 'utf8')
@andromedarabbit
andromedarabbit / gist:7077eb9f66c183a9368e
Created June 5, 2015 05:16
Install Python packages using requirements.txt
pip3 install -r requirements.txt
@andromedarabbit
andromedarabbit / convert-string-to-datetime.py
Created June 15, 2015 02:16
Convert String to Datetime
from dateutil import parser
dt = parser.parse("Aug 28 1999 12:00AM")
@andromedarabbit
andromedarabbit / turn-on-puppet-syntax-highlight-in-vim.sh
Created June 15, 2015 06:00
Turn on puppet syntax highlight in vim
sudo apt-get install vim-puppet
ln -s /usr/share/vim/addons/syntax/puppet.vim ~/.vim/plugin/
from django.core import mail
@property
is_django_in_test_mode():
return hasattr(mail, 'outbox')
@andromedarabbit
andromedarabbit / install-puppet-4-2-on-ubuntu-14.sh
Last active December 21, 2015 07:51
Install Puppet 4.2 on Ubuntu 14
wget http://apt.puppetlabs.com/puppetlabs-release-pc1-wheezy.deb
sudo dpkg -i puppetlabs-release-pc1-wheezy.deb
# install the server
sudo apt-get update
sudo apt-get install puppetserver -y
sudo ln -s /opt/puppetlabs/bin/puppet /usr/local/bin/puppet
sudo ln -s /opt/puppetlabs/bin/facter /usr/local/bin/facter
sudo ln -s /opt/puppetlabs/bin/hiera /usr/local/bin/hiera
sudo ln -s /opt/puppetlabs/bin/mco /usr/local/bin/mco
@andromedarabbit
andromedarabbit / check-if-remote-udp-port-is-open
Last active August 29, 2015 14:23
Check if remote UDP port is open
# check if the remote ntp port is open
sudo nc -uv 10.0.0.11 123