##安装
opkg update && opkg install samba luci-app-samba
##配置
#/etc/config/samba
config sambashare
#! /usr/bin/env bash | |
# Variables | |
APPENV=local | |
DBHOST=localhost | |
DBNAME=dbname | |
DBUSER=dbuser | |
DBPASSWD=test123 | |
echo -e "\n--- Mkay, installing now... ---\n" |
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 |
#!/bin/bash | |
# Run as root | |
set -e | |
apt-get update | |
apt-get install -y build-essential | |
apt-get install -y libncurses5-dev | |
useradd mysql |
#!/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 |
#用正则简单过滤html的<>标签 | |
import re | |
str = "<img /><a>srcd</a>hello</br><br/>" | |
str = re.sub(r'</?\w+[^>]*>','',str) | |
print str |
(function(exports){ | |
var userRoles = { | |
public: 1, // 001 | |
user: 2, // 010 | |
admin: 4 // 100 | |
}; | |
exports.userRoles = userRoles; | |
exports.accessLevels = { |
#!/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 |
#!/usr/bin/python | |
import sys | |
import re | |
import subprocess | |
if len(sys.argv) != 2: | |
print "bridge name needed" | |
sys.exit() |