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)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)Using Python to check if remote port is open and accessible.
Taken from http://snipplr.com/view/19639/test-if-an-ipport-is-open/
Usage:
Here at Glitterbug Tech, Django is the lifeline of everything we make and we are big fans! Django doesn't get in the way and lets us write the language we love, python, while providing an amazing set of tools that makes creating web applications fast and fun. But, as you know, code is executed synchronously before you can send back a response. Which means when you are generating that report from your database which has a million rows, your client has to wait for a response while your application huffs and puffs trying to get everything ready (Unless he times out, in which case you receive angry calls while you try to explain what "502 Bad Gateway" means). Sometimes you just want to make your site more responsive by pushing time consuming tasks in the background ("Your comment has been posted!" while a zmq process works in the backend adding it to your db/caching layer/pushing it to followers/creating rainbows). Wha
| –ctrl a c -> create new window | |
| –ctrl a A -> set window name | |
| –ctrl a w -> show all window | |
| –ctrl a 1|2|3|… -> switch to window n | |
| –ctrl a ” -> choose window | |
| –ctrl a ctrl a -> switch between window | |
| –ctrl a d -> detach window | |
| –ctrl a ? -> help | |
| –ctrl a [ -> start copy, move cursor to the copy location, press ENTER, select the chars, press ENTER to copy the selected characters to the buffer | |
| –ctrl a ] -> paste from buffer |
A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.
Running a local server for testing purposes:
| # Copyright 2017 Dan Krause | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| #! /usr/bin/python | |
| import sys | |
| import ldap | |
| from ldap.controls import SimplePagedResultsControl | |
| from distutils.version import LooseVersion | |
| # Check if we're using the Python "ldap" 2.4 or greater API | |
| LDAP24API = LooseVersion(ldap.__version__) >= LooseVersion('2.4') |
| LDAP_SERVER = "ldaps://my-ldap-server.com/" | |
| LDAP_BASE = "dc=my-ldap-server,dc=com" | |
| def users_ldap_groups(uid): | |
| """ Returns a list of the groups that the uid is a member of. | |
| Returns False if it can't find the uid or throws an exception. | |
| It's up to the caller to ensure that the UID they're using exists! | |
| """ | |
| logger.debug("uid: ", uid) |
| import sys, ldap | |
| # DN = [email protected], secret = password, un = username | |
| DN, secret, un = sys.argv[1:4] | |
| server = "ldap://server.com" | |
| port = 389 | |
| base = "dc=example,dc=com" | |
| scope = ldap.SCOPE_SUBTREE |
| * |