Skip to content

Instantly share code, notes, and snippets.

@rgalite
rgalite / chef_solo_bootstrap.sh
Created October 31, 2012 10:19 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo with Bitnami Ruby AMI
#!/usr/bin/env bash
# Set locale to en_US
sudo echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/default/locale
echo "export LC_ALL=\"en_US.UTF-8\"" >> /home/bitnami/.bash_profile
export LC_ALL="en_US.UTF-8"
# Fix libstdc++
sudo rm /opt/bitnami/common/lib/libstdc++.so.6 && sudo ln -s /usr/lib/libstdc++.so.6 /opt/bitnami/common/lib/libstdc++.so.6
@rgalite
rgalite / Gemfile
Created December 14, 2012 13:56
Deploy with capistrano and unicorn
group :development do
gem 'capistrano'
gem 'rvm-capistrano'
gem 'capistrano-unicorn', :require => false
end
@rgalite
rgalite / i18n.js
Created August 4, 2017 20:13
Make node accept more locales
import areIntlLocalesSupported from 'intl-locales-supported'
const localesMyAppSupports = [
'fr',
'en',
]
if (global.Intl) {
// Determine if the built-in `Intl` has the locale data we need.
if (!areIntlLocalesSupported(localesMyAppSupports)) {
@rgalite
rgalite / authorize.json
Last active November 3, 2017 15:08
Slackbot API
{
"team_id": 1234,
"code": "fkkemglogkdkjdekgkflgmp",
"access_token": "logfepvpbozqmdpig"
}
@rgalite
rgalite / resizeInstanceGroup.js
Created June 17, 2020 08:58
Auto-replace preemptible VMs
const MANAGED_INSTANCE_GROUP_NAME = 'instance-group-2'
const MANAGED_INSTANCE_GROUP_ZONE = 'europe-north1-a'
const MANAGED_INSTANCE_GROUP_TEMPLATE_NAME_ONDEMAND = 'global/instanceTemplates/instance-template-ondemand-vms'
const MANAGED_INSTANCE_GROUP_TEMPLATE_NAME_PREEMTIBLE = 'global/instanceTemplates/instance-template-preemptible-vms-1'
const { auth, Compute } = require('google-auth-library')
const fns = {
resize: async () => {
const client = new Compute()