Skip to content

Instantly share code, notes, and snippets.

View glinton's full-sized avatar

Greg glinton

View GitHub Profile
*
/ \
/ \
+_/ / / | \ \ \_+
||*|||*||
|+||*||+|
/ \
+_/ / / | \ \ \_+
||*|||*||
|+||*||+|

Ossec for Ubuntu

Server, agent, and web-ui

Install Ossec

# get build-essentials
apt-get install build-essential

# get server
wget http://www.ossec.net/files/ossec-hids-2.6.tar.gz
@glinton
glinton / smart-pub.md
Last active November 20, 2024 13:32
SmartOS zone manipulation. Snapshot, image, rollback, and migrate.

SmartOS Zone Manipulation

Notes on snapshots, images, and migrations

Create Zone/KVM

# Create zone
vmadm create <<EOL
{
 "brand": "joyent",
 .
@glinton
glinton / bundler1.7-err.md
Last active August 29, 2015 14:05
bundler 1.7 error on `bundle install --deployment`

Bundler 1.7 error

$ bundle install --deployment
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have added to the Gemfile:
* source: rubygems repository https://[email protected]/me/, https://rubygems.org/
@glinton
glinton / 0.0.7
Last active May 5, 2016 15:05
DiscordCanary crashed with SIGSEGV in _XReply()
Title: DiscordCanary crashed with SIGSEGV in _XReply()
SegvAnalysis:
Segfault happened at: 0x7f73b6eb6b5d <clone+109>: mov %rax,%rdi
PC (0x7f73b6eb6b5d) ok
source "%rax" ok
destination "%rdi" ok
Stack memory exhausted (SP below stack segment)
SP (0x7f73aafb8cc0) ok
Reason could not be automatically determined.
@glinton
glinton / readwrite.go
Created December 9, 2016 22:48
Working example of one way to Read() large(ish) data (1MB) from a golang net.Conn
// Package main is intended to provide a working example of how to properly
// read from a net.Conn without losing data or integrity. The data is generated
// from alphabetical characters rather than simply rand to prevent the
// generation of an `EOF`
package main
import (
"crypto/md5"
"fmt"
"io"
@glinton
glinton / 0-runme.sh
Last active February 17, 2017 21:47
Downgrade kernel to last-known less oom-killy version (Ubuntu 14.04/16.04 on Digital Ocean)
# Install older linux kernel (extras for docker)
apt-get install -y linux-image-4.4.0-53-generic linux-image-virtual linux-image-extra-4.4.0-53-generic linux-image-virtual
# Point to desired kernel entry (from /boot/grub/grub.cfg) v menuentry within submenu
sed -i 's|GRUB_DEFAULT.*|GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 4.4.0-53-generic"|g' /etc/default/grub
# ^From grub.cfg:17 ^menuentry title from grub.cfg:53
# Generate new grub.cfg
update-grub
# Reboot into specified kernel
@glinton
glinton / database.md
Last active September 11, 2018 20:16
Develop with nanobox while connected to production database

Launch a database in production and connect to it inside local nanobox app.

Create a boxfile with just a database and deploy

boxfile.yml

run.config:
  # set your engine like normal
  engine: none
@glinton
glinton / aProxy.md
Last active September 11, 2017 21:00
Install and use nanobox on a linux cloud box (or about any other linux box). Tested on DigitalOcean 16.04

This guide assumes you have a remote dev server set up and have deploy[ed] dry-run, as well as added the mytest.dev dns alias to the dry-run environment

Create a config file for portal

portal.json

{
 "api-token": "123",
 "api-host": "0.0.0.0",
 "api-port": 8443,

>> "just-proxy": true,

@glinton
glinton / dbTunnel.md
Created July 6, 2017 17:31
Share app databases on nanobox (experimental, non-recommended, and non-supported)

Tunnel to your other app's shared database

This requires two apps that you own/have access to. For clarity, we'll refer to the app with the shared database as the "server" app, and the one wanting to connect, the "client" app. This is not recommended nor supported by nanobox.

Note: You'll need to ensure NANOBOX_USERNAME and NANOBOX_PASSWORD are set on your "client" app

Manual Walkthrough

Fetch the nanobox binary. Run from your client component(s) in your client app