Skip to content

Instantly share code, notes, and snippets.

@prasanthj
prasanthj / ec2-nvme-count.txt
Created January 18, 2019 08:08
Mount NVMe SSDs in AWS EC2 instances
Mount Separately
----------------
# mount nvme SSDs to /dataN when available for specific instance types
# There are only 4 nvme slots in r5 instances. /dev/nvme0n1 is root EBS volume.
for i in $(seq 1 4); do
if [ -e "/dev/nvme${i}n1" ]
then
echo "Mounting /dev/nvme${i}n1 to /data${i}"
sudo mkfs.ext4 -E nodiscard /dev/nvme${i}n1
sudo mkdir -p /data${i}
@andrewmwilson
andrewmwilson / gmail_to_slack.js
Last active May 31, 2023 13:02
Google Apps Script: Send Gmail emails to Slack
// You will also need to create a gmail filter to add the 'send-to-slack' label
// to any emails you want sent to slack
function sendEmailsToSlack() {
var label = GmailApp.getUserLabelByName('send-to-slack');
var messages = [];
var threads = label.getThreads();
for (var i = 0; i < threads.length; i++) {
messages = messages.concat(threads[i].getMessages())
@matsuyoro
matsuyoro / gist:c53d82017b2763633e5b
Last active June 1, 2021 13:00
GAS(google app script)で指定ラベルのGmailをslackに通知
// slackのwebhook URL
var postUrl = "https://hooks.slack.com/services/xxxxxxxxxxx";
// 通知したいslackのチャネル(部屋)
var postChannel = "#n_app_review";
// 抽出元のGmailのラベル
var checkLabel = "TO_ME";
function myFunction() {
@bigsnarfdude
bigsnarfdude / gist:b2eb1cabfdaf7e62a8fc
Last active March 8, 2021 09:40
ubuntu 14.04 install scala 2.11.7 and sbt 13.9 and java 8 and git
# scala install
wget www.scala-lang.org/files/archive/scala-2.11.7.deb
sudo dpkg -i scala-2.11.7.deb
# sbt installation
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
sudo apt-get update
sudo apt-get install sbt
#!/usr/bin/env ruby
require 'aws-sdk'
require 'optparse'
require 'yaml'
require 'json'
begin
require 'aws/profile_parser'
rescue LoadError; end