Skip to content

Instantly share code, notes, and snippets.

View briancline's full-sized avatar

Brian Cline briancline

  • SoftLayer / IBM Cloud
  • Dallas, Texas
View GitHub Profile
@stefanozanella
stefanozanella / enable_serial_console.sh
Created January 16, 2013 18:26
Enable serial console output in CentOS (useful for OpenStack + KVM)
echo "ttyS0" > /etc/securetty
vi /etc/grub.conf
# Add console=ttyS0 to the end of kernel line(s)
vi /etc/sysconfig/init
# Edit ACTIVE_CONSOLES to look like:
ACTIVE_CONSOLES="/dev/tty[1-6] /dev/ttyS0"
# If on a live system, do the following
@stefanozanella
stefanozanella / cnxsoft.md
Last active June 12, 2023 23:05
Emulate a Raspberry Pi with Qemu+ KVM

Booting with CNXSoft image

Reference: http://www.cnx-software.com/2012/07/31/84-mb-minimal-raspbian-armhf-image-for-raspberry-pi/

curl -O https://dl.dropbox.com/u/45842273/2012-07-15-wheezy-raspian-minimal.img.7z

yum install p7zip
7za e 2012-07-15-wheezy-raspian-minimal.img.7z

qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda 2012-07-15-wheezy-raspian-minimal.img -net nic -net user -vnc :0 -net tap,ifname=vnet0,script=no,downscript=no
@sudorandom
sudorandom / network_graphs.py
Last active December 12, 2015 02:38
Generates graphs of VLANs/hardware/CCIs/firewalls from data in the SoftLayer API.
#!/usr/bin/env python
"""
Generates graphs of VLANs and connected hardware/CCIs from data in the
SoftLayer API.
"""
import argparse
import time
import math
import matplotlib.pyplot as plt
@brianm
brianm / .gitignore
Last active April 26, 2024 07:34
Go net/rpc over ssh+netcat and unix domain sockets It would be nice if ssh.Session implemented io.ReaderWriter
local_client
server
client
ext
@rbarrois
rbarrois / mock_datetime.py
Created April 21, 2013 20:18
Proper module for patching datetime.datetime.now().
# This code is in the public domain
# Author: Raphaël Barrois
from __future__ import print_function
import datetime
import mock
@cldotdev
cldotdev / config
Last active February 27, 2019 05:44
bpython configuration
# This is a standard python config file
# Valid values can be True, False, integer numbers, strings
# By default bpython will look for ~/.config/bpython/config or you
# can specify a file with the --config option on the command line
# General section tag
[general]
# Display the autocomplete list as you type (default: True).
# When this is off, you can hit tab to see the suggestions.
@Zettt
Zettt / OpenMeta2OSXTags.sh
Last active December 3, 2024 11:00
Script that reads OpenMeta tags and writes them to OS X Mavericks tags. http://mosx.tumblr.com/post/54049528297/convert-openmeta-to-os-x-mavericks-tags-with-this This requires a OpenMeta binary to be installed. Change its path, if you prefer it to be somewhere else. For the files to be processed properly don't include a trailing slash in `$files…
# =============================================================
# = OpenMeta to OS X Tags =
# =============================================================
# Script to convert OpenMeta tags to OS X Mavericks tags.
#
# Created by Zettt (Andreas Zeitler) on 2013-06-28
# Source www.macosxscreencasts.com, mosx.tumblr.com
#
# OpenMeta to OS X Tags by Andreas Zeitler is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike
@syzdek
syzdek / ipv6-regex-test.sh
Last active December 19, 2025 02:36
Simple script to test my IPv6 regular expression.
#!/bin/sh
#
# Use posixregex CLI tool from: https://github.com/syzdek/dmstools/blob/master/src/posixregex.c
RE_IPV4="((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])"
posixregex -r "^(${RE_IPV4})$" \
127.0.0.1 \
10.0.0.1 \
192.168.1.1 \
@adamhjk
adamhjk / README.md
Last active July 25, 2021 05:44
Prove that Chef Solo works just fine with default attributes. Output of chef-solo -c solo.rb -j test.json:

Proves that default attributes work fine in Chef Solo:

chef-solo -c solo.rb -j test.json

  /t/w/solo-def ❯❯❯ chef-solo -c solo.rb -j test.json
  Starting Chef Client, version 11.4.4
  Compiling Cookbooks...
  [2013-08-02T10:30:01-07:00] WARN: I see that solo works... fine
 Converging 1 resources
root@server:~# debconf-get-selections | grep -i "grub\/" > /tmp/grub.preseed
root@server:~# less /tmp/grub.preseed
# /boot/grub/device.map has been regenerated
root@server:~# debconf-get-selections | grep -i grub
grub-pc grub-pc/kopt_extracted boolean false
grub-pc grub2/kfreebsd_cmdline string
# /boot/grub/device.map has been regenerated
grub-pc grub2/device_map_regenerated note
# GRUB install devices:
grub-pc grub-pc/install_devices multiselect /dev/disk/by-id/ata-VBOX_HARDDISK_VB8ca0c0c6-b3b6b95c-part1