Skip to content

Instantly share code, notes, and snippets.

var fortunes = [
"Have a nice day",
"You look really good today",
"It's your birthday!",
"Never play leapfrog with a unicorn"
];
var net = require('net');
var server = net.createServer(function(connection){
connection.write("Enter the number of fortunes you want: ");

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

browserify for webpack users

There's been a strange explosion in misinformation about browserify recently, particularly in comparisons to webpack.

Generally speaking, most of this confusion stems from how webpack is more willing to pull features into its core to ease discoverability while browserify is more likely to push features out to userland instead.

I think that longer-term, separability has more benefits from a maintenance and

@agsdot
agsdot / deployment-tool-ansible-puppet-chef-salt.md
Created April 16, 2016 19:46 — forked from jaceklaskowski/deployment-tool-ansible-puppet-chef-salt.md
Choosing a deployment tool - ansible vs puppet vs chef vs salt

Requirements

  • no upfront installation/agents on remote/slave machines - ssh should be enough
  • application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
  • configuration templating
  • environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
  • deployment process run from Jenkins

Solution

@agsdot
agsdot / Installing Drupal with drush
Created June 21, 2016 00:20 — forked from klan/Installing Drupal with drush
Step-by-step Drupal install with drush. Includes installation of: Omega theme (and sub-theme), Adminimal theme, Adminimal admin menu, Module Filter, Views, Context, ctools, Devel, Diff, Features, Entity API, Entity Reference, jQuery Update, Pathauto and Token.
› drush dl drupal --drupal-project-rename="projectname"
• Install site
› cd projectname/sites/all/modules/
› mkdir contrib custom
› drush dl adminimal_theme adminimal_admin_menu module_filter
› drush en -y adminimal_admin_menu module_filter
› drush variable-set admin_theme adminimal
@agsdot
agsdot / osx-10.9-setup.md
Created June 28, 2016 21:01 — forked from kevinelliott/osx-10.9-setup.md
Clean Install – Mac OS X 10.9 Mavericks

Mac OS X 10.9 Mavericks

Custom recipe to get OS X 10.9 Mavericks running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install.

Install Software

The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.

Install from App Store

@agsdot
agsdot / AddRepositoryToPacmanForYaourt
Created July 26, 2016 21:24 — forked from DenverDias/AddRepositoryToPacmanForYaourt
This snippet adds the repository to pacman that contains yaourt...
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch
@agsdot
agsdot / README.md
Created July 26, 2016 21:26 — forked from ichpuchtli/README.md
create_ap systemd service
@agsdot
agsdot / node-and-npm-in-30-seconds.sh
Created July 27, 2016 22:55 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@agsdot
agsdot / env.conf
Created August 7, 2016 02:22 — forked from ryenus/env.conf
/etc/systemd/system/elasticsearch.service.d/env.conf
[Service]
Environment=PATH=/opt/java/bin:/usr/local/sbin:/usr/local/bin:/usr/bin
Environment=ES_HOME=/usr/share/elasticsearch
Environment=ES_INCLUDE=/usr/share/elasticsearch/bin/elasticsearch.in.sh