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 / vagrant_lamp.sh
Created February 14, 2016 15:03
Vagrant Lamp.sh with base image
#!/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 / fstab-openwrt
Created November 15, 2016 18:50
fatab on openwrt 15.05
config 'global'
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '10'
option check_fs '0'
config 'mount'
option target '/overlay'
@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 / samba - OpenWrt
Created November 15, 2016 19:49
/etc/config/samba on OpenWrt
config samba
option 'name' 'SchoolPot'
option 'workgroup' 'SchoolPot'
option 'description' 'SchoolPot'
option 'homes' '1'
config sambashare
option name 'root'
option users 'root'
option path '/home'
@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 / Compile_Apache1.x.sh
Created November 15, 2016 23:27
script used to compile Apache1.x perfectly
#!/bin/bash
sed -i 's/getline/apache_getline/' src/support/htdigest.c
sed -i 's/getline/apache_getline/' src/support/htpasswd.c
sed -i 's/getline/apache_getline/' src/support/logresolve.c
sed -i 's/getline/apache_getline/' src/main/http_protocol.c
echo "Related files has been rewriten successfully, ready to be complied"
@cygmris
cygmris / etc-sysconfig-http
Created November 16, 2016 11:36
/etc/sysconfig/http under which apache.service read env setting
#
# This file can be used to set additional environment variables for
# the httpd process, or pass additional options to the httpd
# executable.
#
# Note: With previous versions of httpd, the MPM could be changed by
# editing an "HTTPD" variable here. With the current version, that
# variable is now ignored. The MPM is a loadable module, and the
# choice of MPM can be changed by editing the configuration file
# /etc/httpd/conf.modules.d/00-mpm.conf.
@cygmris
cygmris / uninstall_node_osx.sh
Last active November 16, 2016 19:32
uninstall node installed via pkg on osx
#!/bin/bash
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom \
| while read i; do
sudo rm /usr/local/${i}
done
sudo rm -rf /usr/local/lib/node \
/usr/local/lib/node_modules \
/var/db/receipts/org.nodejs.*