start new:
tmux
start new with session name:
tmux new -s myname
| -- a quick LUA access script for nginx to check IP addresses against an | |
| -- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
| -- | |
| -- allows for a common blacklist to be shared between a bunch of nginx | |
| -- web servers using a remote redis instance. lookups are cached for a | |
| -- configurable period of time. | |
| -- | |
| -- block an ip: | |
| -- redis-cli SADD ip_blacklist 10.1.1.1 | |
| -- remove an ip: |
| ldap_server auth1 { | |
| url "ldap://vmcentos64:389/ou=Users,ou=Accounts,dc=acme,dc=com?cn?sub?(objectClass=*)"; | |
| binddn "cn=manager,dc=acme,dc=com"; | |
| binddn_passwd password; | |
| group_attribute cn; | |
| group_attribute_is_dn on; | |
| require valid_user; | |
| } | |
| # |
| var MyApp = angular.module('MyApp'); | |
| MyApp.factory('msgBus', ['$rootScope', function($rootScope) { | |
| var msgBus = {}; | |
| msgBus.emitMsg = function(msg, data) { | |
| data = data || {}; | |
| $rootScope.$emit(msg, data); | |
| }; | |
| msgBus.onMsg = function(msg, func, scope) { | |
| var unbind = $rootScope.$on(msg, func); | |
| if (scope) { |
| # Ubuntu upstart file at /etc/init/ejabberd.conf | |
| respawn | |
| respawn limit 20 5 | |
| start on runlevel [2345] | |
| stop on runlevel [06] | |
| script | |
| exec start-stop-daemon --start --name ejabberd --user ejabberd --chuid ejabberd --exec /usr/local/sbin/ejabberdctl -- start |
| package main | |
| import ( | |
| "compress/gzip" | |
| "io" | |
| "net/http" | |
| "strings" | |
| ) | |
| // Gzip Compression |
| // Add to Cargo.toml | |
| // [dependencies] | |
| // winapi = "*" | |
| // user32-sys = "*" | |
| extern crate winapi; | |
| extern crate user32; | |
| fn from_wide_ptr(ptr: *const u16) -> String { | |
| use std::ffi::OsString; | |
| use std::os::windows::ffi::OsStringExt; |