Skip to content

Instantly share code, notes, and snippets.

@wilsontayar
wilsontayar / star_all_installed_atom_packages.sh
Created January 17, 2017 04:38
Automatically star all your installed atom packages so you can install them easily in another computer later
apm stars
#create an account and type your token
apm star $(apm list --installed -b | cut -d '@' -f 1)
#and finally, use the code below to install all starred packages in another computer
apm stars --install
#!/bin/bash
MY_NAGIOS_HOSTNAME="http://<insert_nagios_here>"
SLACK_SERVICE_URL="https://hooks.slack.com/services/aaaaaa/aaaaa/aaaaaaa"
if [[ "${NAGIOS_SERVICEOUTPUT}" == *"CRITICAL"* ]]
then
COLOR="danger"
elif [[ "${NAGIOS_SERVICEOUTPUT}" == *"OK"* ]]
then
@wilsontayar
wilsontayar / Dockerfile
Last active January 17, 2017 04:41
Basic node.js hello world app with dockerfile
FROM mhart/alpine-node:6.2.2
WORKDIR /src
ADD . .
ENV NODE_ENV production
RUN npm install
EXPOSE 3000
@wilsontayar
wilsontayar / nginx.conf
Last active August 29, 2015 14:06 — forked from rodolfofadino/nginx.conf
nginx.conf file optimized for nginx 1.7.4 with the pagespeed module installed
worker_processes 5;
worker_rlimit_nofile 300000;
pid /var/run/nginx.pid;
events {
worker_connections 10540;
# multi_accept on;
}
Import-Module NetworkLoadBalancingClusters
$CopyOrigin="C:\inetpub\wwwroot\xxxx"
$TimeOut=5
$Servers = New-Object System.Collections.ArrayList
$Servers.Add(@{Ip="xxx.xxx.xxx";Path="E:\xxxx";Urls=("/","/appx")})
$Servers.Add(@{Ip="xxx.xxx.xxx";Path="F:\xxxx";Urls=("/","/appx")})
$Servers.Add(@{Ip="xxx.xxx.xxx";Path="G:\xxxx";Urls=("/","/appx")})
@wilsontayar
wilsontayar / newRelicDeploy.ps1
Last active December 30, 2015 05:48 — forked from kfrancis/gist:3164709
Fast way to send a deploy to New Relic using PowerShell. Just throw curl (http://curl.haxx.se/download.html) inside your %WINDIR%\system32 folder and [C:\newRelicDeploy.ps1 -User "John Doe" -Revision "v.6.6.6.0" -Changelog "list of changes in this version"].
param([String] $User, [String] $Revision, [String] $Description, [String] $Changelog)
$appID = "<your app id here>"
$apiKey = "<your api key here>"
"Sending deploy to New Relic API..."
$command = "curl -k -H 'x-api-key:$apiKey' -d 'deployment[application_id]=$appID' -d 'deployment[description]=$Description' -d 'deployment[revision]=$Revision' -d 'deployment[changelog]=$Changelog' -d 'deployment[user]=$User' https://api.newrelic.com/deployments.xml"
Invoke-Expression $command