Skip to content

Instantly share code, notes, and snippets.

View Cryptophobia's full-sized avatar
〰️
always seeking a state of flow

AMO ❤️⛺✨ Cryptophobia

〰️
always seeking a state of flow
View GitHub Profile
@Cryptophobia
Cryptophobia / sublimetext3.sh
Last active February 9, 2017 05:49
Install Sublime Text 3 on Fedora/Ubuntu
#!/usr/bin/env bash
# Usage: {script} [ OPTIONS ] TARGET BUILD
#
# TARGET Default target is "/usr/bin".
# BUILD If not defined tries to get the build into the Sublime Text 3 website.
#
# OPTIONS
#
# -h, --help Displays this help message.
#
@Cryptophobia
Cryptophobia / fluentd
Last active January 25, 2021 08:39
/etc/init.d/fluentd
#!/bin/bash
NAME="fluentd" #Name of service
PID_FILE=/var/run/fluentd.pid #PID file for fluentd service
CONF_FILE=/etc/fluent/fluent.conf #Config file for fluentd service
LOG_FILE=/var/log/fluent/fluent.log #Log file for fluentd process
PSNAME="fluentd" #Process to look for in ps output
RVM_PATH=home/ubuntu/.rvm/scripts/rvm #RVM path to source because RVM is awesome
RUBY_VER="default" #RVM default ruby version, you can set to specific Ruby verion
@Cryptophobia
Cryptophobia / nvm.rake
Created July 14, 2016 14:16
Rake task for nvm - node version manager
namespace :nvm do
desc "Load nvm and the node environment variables"
def file_or_symlink_exists?(path_to_file)
File.exist?(path_to_file) || File.symlink?(path_to_file)
end
desc "Load node if nvm is already installed but not on the path"
task :load_node do
sh "/bin/bash -c '. ~/.nvm/nvm.sh'"
@Cryptophobia
Cryptophobia / fetch-ssl-from-okta-com.sh
Created October 26, 2016 16:16 — forked from jpf/fetch-ssl-from-okta-com.sh
How to fetch the SSL certificate from www.okta.com
echo '' | openssl s_client -connect www.okta.com:443
@Cryptophobia
Cryptophobia / teamcity-agent.sh
Last active October 26, 2016 17:32
/etc/init.d/teamcity
#! /bin/sh
# /etc/init.d/teamcity
# Common parameters, do not edit:
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="TeamCity Agent"
NAME=teamcity-agent
SCRIPTNAME=/etc/init.d/$NAME
#
# User specific parameters:
USERNAME=ubuntu
@Cryptophobia
Cryptophobia / teamcity-agent-ubuntu.md
Created November 3, 2016 15:06 — forked from guifromrio/teamcity-agent-ubuntu.md
Instructions to Setup Teamcity Agent on EC2 Ubuntu 12.04.2 Linux with NodeJS and PhantomJS
cd /Library/Preferences
sudo rm com.sophos.sav.plist
--or--
sudo rm com.sophos.*

cd /Library/Application\ Support/Sophos/cloud/Installer.app/Contents/MacOS/tools/
sudo ./InstallationDeployer --force_remove

Sometimes the Sophos virus can exist in the /Library/Application.../Sophos/saas folder
@Cryptophobia
Cryptophobia / ssl_puma.sh
Created February 3, 2017 19:17 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@Cryptophobia
Cryptophobia / git-info.sh
Last active February 21, 2017 23:13
git info command
#!/bin/sh
#
# git-info - shows information about a Git repository a la `svn info'
#
# How to use:
# $ git info
# $ git info ~/src/somewhere/somefile
# $ git info some/relative/file_or_directory
# $ git info ~/repos/something.git
#
@Cryptophobia
Cryptophobia / kube-resque-pre-stop.sh
Last active November 9, 2018 22:34
preStop Kubernetes Lifecycle Resque Hook
#!/bin/bash
# This script gracefully stops resque workers by issuing the USR2
# signal to the resque-pool manager and then waits for the workers
# to be paused before exiting. Resque-pool master process relays
# the USR2 signal to the children.
#
# For reference:
# (1) https://github.com/nevans/resque-pool#signals
# (2) https://github.com/resque/resque/blob/master/lib/resque/worker.rb#L376-L378