Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
<?PHP | |
// Generates a strong password of N length containing at least one lower case letter, | |
// one uppercase letter, one digit, and one special character. The remaining characters | |
// in the password are chosen at random from those four sets. | |
// | |
// The available characters in each set are user friendly - there are no ambiguous | |
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option, | |
// makes it much easier for users to manually type or speak their passwords. | |
// | |
// Note: the $add_dashes option will increase the length of the password by |
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
$HTTP["host"] =~ "^source\.com$" { | |
url.redirect = ( "^/(.*)" => "http://dest.com/$1") | |
} |
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
# ~/.osx — http://mths.be/osx | |
############################################################################### | |
# General UI/UX # | |
############################################################################### | |
# Menu bar: disable transparency | |
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false | |
# Disable the “Are you sure you want to open this application?” dialog |
#!/bin/bash | |
# This script creates a user account under Mac OS X | |
# === Typically, this is all you need to edit === | |
USERNAME= | |
FULLNAME= | |
PASSWORD= | |
# A list of (secondary) groups the user should belong to |
#include <unistd.h> | |
#include <errno.h> | |
main( int argc, char ** argv, char ** envp ) | |
{ | |
if( setgid(getegid()) ) perror( "setgid" ); | |
if( setuid(geteuid()) ) perror( "setuid" ); | |
envp = 0; /* blocks IFS attack on non-bash shells */ | |
system( "/path/to/bash/script", argv, envp ); | |
perror( argv[0] ); |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
Copyright (c) 2010-2015 Giulia Alfonsi <electric.g@gmail.com> | |
Permission is hereby granted, free of charge, to any person | |
obtaining a copy of this software and associated documentation | |
files (the "Software"), to deal in the Software without | |
restriction, including without limitation the rights to use, | |
copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the | |
Software is furnished to do so, subject to the following | |
conditions: |