Skip to content

Instantly share code, notes, and snippets.

@frenck
frenck / hassio_ubuntu_install_commands.sh
Last active February 1, 2023 05:38
Simple install command for installing Hass.io on a Generic Ubuntu/Debian machine
Unbuntu is no longer support by the Home Assistant project.
The installation commands previous listed here, are not up 2 date, not recommended, not supported and, therefore, removed.
@darencard
darencard / gnuplot_quickstart.md
Created August 31, 2017 14:20
A quick-start guide for using gnuplot for in-terminal plotting

A quick-start guide for using gnuplot for in-terminal plotting

Sometimes it is really nice to just take a quick look at some data. However, when working on remote computers, it is a bit of a burden to move data files to a local computer to create a plot in something like R. One solution is to use gnuplot and make a quick plot that is rendered in the terminal. It isn't very pretty by default, but it gets the job done quickly and easily. There are also advanced gnuplot capabilities that aren't covered here at all.

gnuplot has it's own internal syntax that can be fed in as a script, which I won't get into. Here is the very simplified gnuplot code we'll be using:

set terminal dumb size 120, 30; set autoscale; plot '-' using 1:3 with lines notitle

Let's break this down:

@jamescmartinez
jamescmartinez / slack_delete.rb
Last active May 28, 2024 15:00
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@neerolyte
neerolyte / vssh
Last active November 16, 2016 23:24
vssh - significantly faster ssh for vagrant
#!/bin/bash -e
# vssh - significantly faster Vagrant SSHing
# Usage: vssh [vagrant host] [regular ssh arguments]
# find the .vagrant directory scanning up from $PWD
find_vagrant_dir() {
cdir="$PWD"
while ! [[ -d "$cdir/.vagrant" ]] && [[ "$cdir" != "/" ]]; do
cdir="$(dirname "$cdir")"
@olvesh
olvesh / ssh-multi.sh
Last active December 30, 2015 11:29 — forked from dmytro/ssh-multi.sh
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then
@jmahowald
jmahowald / gist:7654558
Created November 26, 2013 07:21
Chef shell script in vagrant to debug chef-solo-search problems
Chef::Config[:cookbook_path] = "/tmp/vagrant-chef-1/chef-solo-1/cookbooks/"
run_list = "recipe[chef-solo-search]"
cl = Chef::CookbookLoader.new(Chef::Config[:cookbook_path])
cl.load_cookbooks
cookbook_collection = Chef::CookbookCollection.new(cl)
@events = Chef::EventDispatch::Dispatcher.new()
node.run_context = Chef::RunContext.new(node, cookbook_collection, @events)
node.run_list = Chef::RunList.new(run_list)
node.run_context.load(node.expand!)
@jkrell
jkrell / check_solr_cloud.py
Created September 12, 2013 13:02
A simple python script for checking status of a SolrCloud instance using Nagios
#!/usr/bin/python2.7
"""
check_solr_cloud.py
Nagios plugin for checking the status of a SolrCloud instance by
examining the clusterstate.json file on zookeeper.
Usage:
check_solr_cloud.py --zkhosts=<zookeeper hosts> --collection=<collection>
@oogali
oogali / ssh-tab-completion.bash
Created July 11, 2013 13:58
Should have known better than to paste into HN...
# Tab completion for scp/sftp/ssh based on ~/.ssh/config
complete -o default -o nospace -W "$(/usr/bin/ruby -ne 'puts $_.split(/[\s,]+/)[1..-1].reject { |h| h.match /\*|\?/ } if $_.match /^\s*Host[s]*\s+/' < ~/.ssh/config)" scp sftp ssh 2>/dev/null
@willurd
willurd / web-servers.md
Last active July 23, 2024 17:12
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@bcarlin
bcarlin / .bashrc
Last active July 12, 2019 17:23
Alias for sublime text to automatically open a project when calling "subl" if a .sublime-project file is found in the current directory.This alias declaration to put in a bashrc file.
# [...]
function project_aware_subl {
project_file=$(ls *.sublime-project 2>/dev/null | head -n 1)
command subl ${*:-${project_file:-.}}
}
alias subl="project_aware_subl"
# [...]