Skip to content

Instantly share code, notes, and snippets.

# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "public_network"
config.vm.provider "virtualbox" do |v|
v.name = "vagrant_ubuntu14.04"
v.memory = 2048
#!/usr/bin/env bash
# Repo update
#sudo apt-get update
# Install Databases
# COUCHDB
#sudo apt-get install -y couchdb
# MONGODB
#sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
@ssbozy
ssbozy / tornado.conf
Created October 2, 2015 08:46
TornadoのログをFluentdで収集する
<source>
type tail
path /hoge/fuga/tornado.log
pos_file /var/log/td-agent/tornado.log.pos
tag tornado
format multiline
format_firstline /^\[/
format1 /^\[(?<levelname>[^ ]*) (?<time>[^ ]* [^ ]*) (?<module>[^:]*):(?<lineno>[^\]]*)\] ((?<code>[^ ]*) (?<method>[^ ]*) (?<path>[^ ]*) \((?<host>[^\)]*)\) (?<responsetime>\S*)|(?<message>.*?))$/
format2 /(?<traceback>.*)/
time_format %y%m%d %H:%M:%S
from tornado import httpserver, web, ioloop, options, log
from random import random
class BaseHandler(web.RequestHandler):
'''BaseHandler for all handlers'''
def write_error(self, status_code, **kwargs):
if status_code == 400:
response = {"code":status_code, "message": "Bad Request"}
@ssbozy
ssbozy / posthaven.css
Created December 10, 2015 06:21
CSS for Posthaven
@import url(https://fonts.googleapis.com/css?family=Open+Sans:300);
#header h1 a
{
font-family: 'Open Sans', sans-serif !important;
font-weight: 300 !important;
}
.post-title h2 a
{
font-family: 'Open Sans', sans-serif !important;
@ssbozy
ssbozy / safarireadinglistexport.sh
Created October 6, 2016 21:43
Safari Reading list export
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'
@ssbozy
ssbozy / keybase.md
Created June 6, 2017 06:22
keybase

Keybase proof

I hereby claim:

  • I am ssbozy on github.
  • I am ssbozy (https://keybase.io/ssbozy) on keybase.
  • I have a public key whose fingerprint is A0C4 02C6 2156 7F30 38EB 3563 17EB 2BD1 058E 4E96

To claim this, I am signing this object:

vagrant box list | awk '{print $1}' | uniq | xargs -I {} vagrant box remove {} --all
#This little script takes into consideration a cooling rate and creates a new value for the ratings as time progresses
from datetime import datetime
import time
COOLINGRATE = 0.2
def fetch_new_rating(rating, timestamp):
diff_time = time.time() - timestamp
new_ratings = current_rating * exp(-cooling_rate * diff_time)

#To hide notification icon

* launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
* killall NotificationCenter

#To show notification icon

* launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
* Hit Command+Shift+G and go to /System/Library/CoreServices/ 
* find “Notification Center” and double-click it to launch it again