Skip to content

Instantly share code, notes, and snippets.

View davidlonjon's full-sized avatar
🏠
Working from home

David Lonjon davidlonjon

🏠
Working from home
View GitHub Profile
@davidlonjon
davidlonjon / nohup-output-to-file.sh
Created September 26, 2016 05:55 — forked from umidjons/nohup-output-to-file.sh
Redirect nohup output to a file
# redirect output and errors into file output.log:
nohup some_command > output.log 2>&1&
# abbreviated syntax for bash version >= ver.4:
nohup some_command &> output.log
@davidlonjon
davidlonjon / Documentation.md
Created April 24, 2016 13:19 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@davidlonjon
davidlonjon / gist:3771485984b799045b43
Created March 11, 2016 07:40 — forked from ssx/gist:2649191
WordPress: WP_Query $args Ultimate Reference
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@davidlonjon
davidlonjon / pedantically_commented_playbook.yml
Created January 12, 2016 12:26 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@davidlonjon
davidlonjon / zeropad.js
Last active December 25, 2015 16:39 — forked from s4y/zeropad.js
Javascript: Quick pad
function zeroPad(input, length, character){
var padding = length + 1 - input.length;
return (padding > 0 ? Array(length + 1 - input.length).join(character || '0') + input : input);
};
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
#!/bin/bash -ex
# Paste this into ssh
# curl -sL https://gist.github.com/gists/2913223/download | tar -xzO | /bin/bash -ex
# When forking, you can get the URL from the download button.
pushd $HOME
aptget='sudo apt-get'
chsh='sudo chsh'
%pseudo-content-before {
position: relative;
&:before {
content: " ";
position: absolute;
display: block;
}
}
%pseudo-content-after {
$default_rounded_amount: 5px
// Round corner at position by amount.
@mixin round-corner($position, $amount: $default_rounded_amount)
border-#{$position}-radius: $amount
-webkit-border-#{$position}-radius: $amount
@mixin round-corner-mozilla($position, $amount: $default_rounded_amount)
-moz-border-radius-#{$position}: $amount
// Round left corners by amount
@davidlonjon
davidlonjon / pricing.txt
Created November 27, 2015 08:17 — forked from thbkrkr/pricing.txt
Amazon AWS vs Google Compute Engine (GCE) vs DigitalOcean vs OVH RunAbove
------------
Amazon (http://calculator.s3.amazonaws.com/index.html)
------------
type price CPU RAM Disk I/O EBS opt.
t2.micro 10$ 1 1.0 -- Low --
t1.micro 15$ 1 0.6 -- Very Low --
t2.small 10$ 1 2.0 -- Low --
m1.small 34$ 1 1.7 1 x 160 Low --
t2.medium 41$ 2 4.0 -- Low --
m3.medium 56$ 1 3.7 SSD 1 x 4 Moderate --