Skip to content

Instantly share code, notes, and snippets.

@smoofit
smoofit / mosquitto_websockets.md
Last active March 5, 2024 17:34
Howto install mosquitto with websockets
@subfuzion
subfuzion / mysql-autostart-osx.md
Created March 18, 2014 22:39
mysql auto start on OS X

Install with Homebrew

brew install mysql

Set up launchctl to auto start mysql

$ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents

/usr/local/opt/mysql/ is a symlink to /usr/local/Cellar/mysql/x.y.z (e.g., 5.6.16)

@metachris
metachris / tcpclient.py
Last active July 2, 2020 07:46
Tornado TCP Client (Simple)
import errno
import socket
from threading import Thread
from tornado import ioloop
class IOLoopThread(Thread):
def __init__(self):
Thread.__init__(self)
self.running = True
def verify_sign(public_key_loc, signature, data):
'''
Verifies with a public key from whom the data came that it was indeed
signed by their private key
param: public_key_loc Path to public key
param: signature String signature to be verified
return: Boolean. True if the signature is valid; False otherwise.
'''
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.
@davewongillies
davewongillies / Running sentry under chaussette.md
Last active December 18, 2015 05:29
Running sentry under chaussette
  • In the home directory of the user that the sentry chausette process will run under: mkdir ~/.sentry
  • copy sentry.conf.py into ~/.sentry
  • running chaussette sentry.wsgi.application should be enough to get it started. Add options as required, eg:
chaussette sentry.wsgi.application --backend meinheld --port 8091
@fernandoaleman
fernandoaleman / gist:5083680
Last active October 17, 2023 12:02
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@ninehills
ninehills / backgroudmix.py
Last active December 10, 2015 17:08 — forked from methane/gist:2185380
tornado add block task to ThreadPool
from time import sleep
import tornado
from multiprocessing.pool import ThreadPool
_workers = ThreadPool(10)
class BackgroundMix(tornado.web.RequestHandler):
"""将block任务放入线程池中执行
EXAMPLE:
# blocking task like querying to MySQL
@ilyar
ilyar / VBoxGuestAdditionsUpdate
Last active December 9, 2015 18:08
Update VBoxGuestAdditions in Ubuntu VM
#!/bin/bash
wget -c http://download.virtualbox.org/virtualbox/4.3.8/VBoxGuestAdditions_4.3.8.iso -O VBoxGuestAdditions.iso
sudo mount VBoxGuestAdditions.iso -o loop /mnt
sudo sh /mnt/VBoxLinuxAdditions.run --nox11
rm VBoxGuestAdditions.iso
@harmy
harmy / 12factor.md
Created August 23, 2012 14:30
12factor

中文翻译:梁山 英文原文:Adam Wiggins

简介

如今,软件通常会作为一种服务来交付,它们被称为网络应用程序,或“软件即服务”(SaaS)。“十二要素应用程序”(12-Factor App)为构建如下的SaaS应用提供了方法论:

  • 使用标准化流程自动配置,从而使新的开发者花费最少的学习成本加入这个项目;
  • 和操作系统之间尽可能的划清界限,在各个系统中提供最大的可移植性
  • 适合部署在现代的云计算平台,从而在服务器和系统管理方面节省资源;