Skip to content

Instantly share code, notes, and snippets.

View ushios's full-sized avatar
🎵
Chuck Berry - Johnny B. Goode

Shugo USHIO ushios

🎵
Chuck Berry - Johnny B. Goode
View GitHub Profile
@jsmouret
jsmouret / struct.go
Last active January 10, 2025 07:17
Convert map[string]interface{} to a google.protobuf.Struct
package pb
import (
"fmt"
"reflect"
st "github.com/golang/protobuf/ptypes/struct"
)
// ToStruct converts a map[string]interface{} to a ptypes.Struct
#!/bin/bash
set -xe
cd $HOME
# Remove the build cache and get Glide
rm -Rf $GOPATH/src/*
go get github.com/Masterminds/glide
mkdir -p $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME/
cd $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME
@ygotthilf
ygotthilf / jwtRS256.sh
Last active May 4, 2025 08:04
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@LoicMahieu
LoicMahieu / pm2
Last active August 29, 2015 14:04
Logrotate for pm2
/root/.pm2/logs/*.log {
daily
rotate 52
missingok
notifempty
compress
sharedscripts
dateext
dateformat %Y-%m-%d
postrotate
@stephanetimmermans
stephanetimmermans / ubuntu-compass-ruby
Last active May 16, 2024 03:29
Install Compass+Ruby on Ubuntu 14.04
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default

pecl imagickいれなおす

ImageMagick6.2.9から使える関数が必要なため。

今のバージョンを調べる

rpm -qa | grep -i imagemagick
ImageMagick-6.2.8.0-4.el5_5.3
ImageMagick-devel-6.2.8.0-4.el5_5.3
@sansmischevia
sansmischevia / nginx.conf
Last active June 3, 2024 22:56
nginx http proxy to s3 static websites
##
## This nginx.conf servers as the main config file for webflow reverse proxy
##
## RCS:
## https://gist.github.com/sansmischevia/5617402
##
## Hardening tips:
## http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html
##
@DavidAllison
DavidAllison / s3-file.rb
Created April 1, 2013 22:19
An update to @peplin's work on https://gist.github.com/peplin/470321 that makes this gist compatible with the more modern AWS-SDK gem and new APIs, and updates for Chef 11.x (still works with 10.x too).
#
# Author:: Christopher Peplin (<[email protected]>)
# Copyright:: Copyright (c) 2010 Bueda, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@drewolson
drewolson / reflection.go
Last active November 21, 2024 15:11
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
@jasonthomas
jasonthomas / sns.coffee
Last active December 11, 2015 07:48
AWS SNS script for hubot
# Description:
# This script receives messages from AWS SNS topic for cloudwatch
#
# Author:
# jasonthomas
irc = require('irc')
SNSClient = require('aws-snsclient')
module.exports = (robot) ->