Skip to content

Instantly share code, notes, and snippets.

View lowstz's full-sized avatar
🐡
专业摸鱼

Aaron Chen lowstz

🐡
专业摸鱼
View GitHub Profile
@gkleiman
gkleiman / resident-tasks.md
Last active April 5, 2016 10:34
Resident Tasks tutorial

Using Resident Tasks (Persistent Storage) with Marathon v0.16.0

Requirements

  • Mesos version v0.28.0 or greater.
  • The connection between Mesos and Marathon has to be authenticated.

Setting up Mesos and Marathon

Configuring the Mesos Masters

@nathwill
nathwill / haproxy_http_log.lua
Last active January 8, 2022 17:20
heka haproxy syslog decoder
--[[
Inspired by: https://github.com/mozilla-services/lua_sandbox/pull/22
*Haproxy log-format Directive*
log-format %ci:%cp\ [%t]\ %ft\ %b/%s\ %Tq/%Tw/%Tc/%Tr/%Tt\ %ST\ %B\ %CC\ %CS\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %hr\ %hs\ %{+Q}r
*Example Config*
[haproxy_udp_input]
type = "UdpInput"
@rocket-ron
rocket-ron / gist:bf7d7ce3e5b8b7cd9197
Created August 3, 2015 05:21
Resize (increase) Root Partition on AWS EBS Volume Linux LVM
This is a resize of the actual EBS volume as opposed to adding additional disks using LVM
1. Follow the steps here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/storage_expand_partition.html
2. Use the instructions for gdisk further down the page to set the new partition table, not gparted or fdisk.
3. Reboot the instance once the partition table is written.
4. On the instance, execute:
sudo pvresize /dev/xvda2 (or whatever the device name is)
sudo pvdisplay
@vcastellm
vcastellm / haproxy.lua
Last active January 8, 2022 17:22
Heka haproxy lua decoder
local dt = require "date_time"
local ip = require "ip_address"
local l = require 'lpeg'
local syslog = require "syslog"
l.locale(l)
local msg = {
Timestamp = nil,
Hostname = nil,
Payload = nil,
@desyncr
desyncr / zmq
Last active April 12, 2018 15:57
Monit check pid-less process (without script)
check process zmq with pidfile '/tmp/zmq.pid'
start program '/bin/bash -c "/usr/bin/php /var/www/sm/public/index.php zmq daemon execute & echo $! > /tmp/zmq.pid"'
stop program '/usr/bin/killall --full "zmq daemon execute"'
@sukharevd
sukharevd / wildfly-install.sh
Last active September 9, 2024 09:14
Script to install JBoss Wildfly 10.x as service in Linux
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 10.x
#more :http://sukharevd.net/wildfly-8-installation.html
#author :Dmitriy Sukharev
#date :2016-06-18T02:45-0700
#usage :/bin/bash wildfly-install.sh
#tested-version1 :10.0.0.CR3
#tested-distros1 :Ubuntu 15.10; Debian 7,8; CentOS 7; Fedora 22
#tested-version2 :10.0.0.Final
@westonruter
westonruter / fetch-snapshots.sh
Last active August 2, 2023 12:39
Grab a snapshot from an RTSP video stream every 1 second.
#!/bin/bash
url='rtsp://10.0.1.10:554/video-stream'
avconv -i $url -r 1 -vsync 1 -qscale 1 -f image2 images%09d.jpg
@lamengao
lamengao / gist:1560715
Created January 4, 2012 16:08
dl.cuoluo.me nginx config
server {
listen 80;
server_name dl.cuoluo.me;
location / {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://dl.dropbox.com/u/1812807/dl.cuoluo.me/index.html;
if ($request_method = POST) {
layout title date comments categories
post
Installing Octopress
2011-08-18 19:56
true
linux octopress ruby rvm jekyll rubygems

I (rather obviously) recently found myself attempting to install Octopress. Sure, it has great documentation, but some areas were lacking -- specifically, initial setup. As someone who has not worked with Ruby before other than a rather limited Windows install for a jekyll project, I had virtually no experience installing Ruby, using RVM, or even playing with RubyGems.