Skip to content

Instantly share code, notes, and snippets.

View cygmris's full-sized avatar

Chris cygmris

View GitHub Profile
@cygmris
cygmris / install_mysql.sh
Created February 12, 2016 12:33 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy.
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"
@cygmris
cygmris / download.py
Created September 9, 2016 02:04 — forked from mjohnsullivan/download.py
Python HTTP download with resume and optional MD5 hash checking
import os.path
import urllib2
import shutil
import hashlib
import logging
def validate_file(file_path, hash):
"""
Validates a file against an MD5 hash value
@cygmris
cygmris / samba-openwrt.md
Created November 15, 2016 19:21 — forked from lanceliao/samba-openwrt.md
Samba on OpenWrt 配置

##安装

opkg update && opkg install samba luci-app-samba

##配置

匿名登录

#/etc/config/samba
config sambashare
@cygmris
cygmris / build_mysql.sh
Created November 15, 2016 21:53 — forked from shichao-an/build_mysql.sh
Build and install MySQL 5.1 from source on Ubuntu 14.04
#!/bin/bash
# Run as root
set -e
apt-get update
apt-get install -y build-essential
apt-get install -y libncurses5-dev
useradd mysql
@cygmris
cygmris / gist:4e46edd69f1305a01d009d4d828dab82
Created December 8, 2016 20:07 — forked from nbluis/gist:1408921
JBoss 7 Simple Startup Script
#!/bin/sh
### BEGIN INIT INFO
# Reference: http://stackoverflow.com/questions/6880902/start-jboss-7-as-a-service-on-linux
# Provides: jboss
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop JBoss AS v7.0.0
### END INIT INFO
@cygmris
cygmris / re.py
Created April 9, 2017 05:24 — forked from dervn/re.py
Python中过滤HTML标签的函数
#用正则简单过滤html的<>标签
import re
str = "<img /><a>srcd</a>hello</br><br/>"
str = re.sub(r'</?\w+[^>]*>','',str)
print str
@cygmris
cygmris / osx_developer_installation.rst
Created July 19, 2017 07:13 — forked from stefanfoulis/osx_developer_installation.rst
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

(function(exports){
var userRoles = {
public: 1, // 001
user: 2, // 010
admin: 4 // 100
};
exports.userRoles = userRoles;
exports.accessLevels = {
@cygmris
cygmris / openstack-delete-instance.sh
Created March 7, 2018 07:44 — forked from frgaudet/openstack-delete-instance.sh
Delete instance from database
#!/bin/bash
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@cygmris
cygmris / ovs-dump-flows.py
Created March 21, 2018 12:53 — forked from djoreilly/ovs-dump-flows.py
Make ovs-ofctl dump-flows more readable. Remove stats, sort by table and priority, replace port numbers with port names.
#!/usr/bin/python
import sys
import re
import subprocess
if len(sys.argv) != 2:
print "bridge name needed"
sys.exit()