Skip to content

Instantly share code, notes, and snippets.

View williamjoy's full-sized avatar
:octocat:
Hello World!

williamjoy williamjoy

:octocat:
Hello World!
  • Demonware
  • Vancouver
View GitHub Profile
#replace dns service to 127.0.0.1, for example can run dnsmasq locally
sudo scutil << EOF
get State:/Network/Service/net.pulsesecure.pulse.nc.main/DNS
d.remove ServerAddress
d.add ServerAddresses * 127.0.0.1
set State:/Network/Service/net.pulsesecure.pulse.nc.main/DNS
exit
EOF
scutil <<< 'show State:/Network/Service/net.pulsesecure.pulse.nc.main/DNS'
import asyncio
import time
class human:
def __init__(self, name):
""" """
self.name = name
self.time = 2
@williamjoy
williamjoy / MegaCli.ks.sh
Last active August 29, 2015 14:19
MegaCli.ks
%pre
#!/bin/bash
#------------------------------------------------------------------------------#
# PRE-INSTALL HARDWARE RAID SETUP #
#------------------------------------------------------------------------------#
SERVER='some.host.com' # ftp server containing MegaCli and its library
FTP_DIR='path/to/wherever/MegaCli/is/on/ftp/server/'
exec < /dev/tty3 > /dev/tty3 2>&1
#https://github.com/rlisagor/pynetlinux/blob/master/pynetlinux/ifconfig.py
import fcntl
import os
import re
import socket
import struct
import ctypes
import array
import math
@williamjoy
williamjoy / init
Created December 26, 2014 05:51
CentOS 5 initramfs /init script
#!/bin/nash
mount -t proc /proc /proc
setquiet
echo Mounting proc filesystem
echo Mounting sysfs filesystem
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mkdir /dev/pts
Devtmpfs lets the kernel create a tmpfs instance called devtmpfs
very early at kernel initialization, before any driver-core device
is registered. Every device with a major/minor will provide a
device node in devtmpfs.
Devtmpfs can be changed and altered by userspace at any time,
and in any way needed - just like today's udev-mounted tmpfs.
Unmodified udev versions will run just fine on top of it, and will
recognize an already existing kernel-created device node and use it.
file { '/etc/hosts':
audit => [ owner, group, mode ],
}
puppet catalog --render-as dot find localhost > catalog.dot
@williamjoy
williamjoy / eruby.vim
Created August 6, 2014 23:53
eruby vim
" Vim syntax file
" Language: eRuby
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
" Info: $Id: eruby.vim,v 1.23 2008/06/29 04:18:43 tpope Exp $
" URL: http://vim-ruby.rubyforge.org
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
if exists("b:current_syntax")
finish
@williamjoy
williamjoy / puppet.vim
Created August 6, 2014 23:49
Puppet VIM
" puppet syntax file
" Filename: puppet.vim
" Language: puppet configuration file
" Maintainer: Luke Kanies <luke@madstop.com>
" URL:
" Last Change:
" Version:
"
" Copied from the cfengine, ruby, and perl syntax files