Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdlib.h>
#define NPROC 64
enum procstate { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE };
struct proc {
enum procstate state;
struct proc *next;
int pid;
#include <stdio.h>
#include <stdlib.h>
#define NPROC 64
enum procstate { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE };
struct proc {
enum procstate state;
struct proc *next;
int pid;
[Unit] │root 29985 0.9 1.2 1009776 49924 pts/0 Sl+ 19:45 0:00 node /usr/bin/shout --home /srv/app
Description=Shout IRC Network Socket │ubuntu@ip-10-20-122-234:~$ ps aux | grep shout | grep root | head
PartOf=shout-irc.service │root 29984 0.0 0.1 55756 4040 pts/0 S+ 19:45 0:00 sudo shout --home /srv/app
│root 29985 0.8 1.2 1009776 49924 pts/0 Sl+ 19:45 0:00 node /usr/bin/shout --home /srv/app
[Socket]
@jamesbeedy
jamesbeedy / acng.conf
Last active May 16, 2017 15:35
/etc/apt-cacher-ng/acng.conf
CacheDir: /var/cache/apt-cacher-ng
LogDir: /var/log/apt-cacher-ng
SupportDir: /usr/lib/apt-cacher-ng
Port:3142
BindAddress: 0.0.0.0
Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian # Debian Archives
Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu # Ubuntu Archives
Remap-cygwin: file:cygwin_mirrors /cygwin # ; file:backends_cygwin # incomplete, please create this file or specify preferred mirrors here
@jamesbeedy
jamesbeedy / interfaces
Created June 9, 2017 19:01
interfaces for bridged lxd vlan routing
auto lo
iface lo inet loopback
# LAN interface
auto eno1
iface eno1 inet dhcp
auto vlan200
iface vlan200 inet manual
vlan-raw-device eno1
@jamesbeedy
jamesbeedy / lxd-profile-show
Created June 9, 2017 19:11
show lxd profiles for lxdbr1 and lxdbr2
$ lxc profile show seattle
config: {}
description: seattle LXD profile
devices:
eth0:
nictype: bridged
parent: lxdbr1
type: nic
root:
path: /
root@las-vegas0:~# curl ipinfo.io/67.203.20.122
{
"ip": "67.203.20.122",
"hostname": "67.203.20.122-static.colocationamerica.com",
"city": "Las Vegas",
"region": "Nevada",
"country": "US",
"loc": "36.1113,-115.2791",
"org": "AS17252 Colocation America Corporation",
"postal": "89147"
$ lxc launch ubuntu:16.04 las-vegas0 -p las-vegas
Creating las-vegas0
Starting las-vegas0
$ lxc launch ubuntu:16.04 seattle0 -p seattle
Creating seattle0
Starting seattle0
lxd-host00:~$ lxc exec las-vegas0 bash
root@las-vegas0:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
@jamesbeedy
jamesbeedy / x-ruby.py
Last active June 15, 2017 01:51
ruby plugin
from shutil import rmtree
from os import makedirs, environ
from os.path import exists, join, abspath
from snapcraft import BasePlugin
from snapcraft.sources import Tar
class RubyPlugin(BasePlugin):
{
"bridge": "lxdbr0"
}