Skip to content

Instantly share code, notes, and snippets.

View favoretti's full-sized avatar
💭
Tinkering...

Vladimir Lazarenko favoretti

💭
Tinkering...
View GitHub Profile
def cmpver(vA, vB):
def matchesCas(version):
return re.match("^.*\d+\.(\d{4})\.(\d+)\-(\d+)-[a-z0-9]+$", version)
if vA == vB: return 0
vA = vA.replace('-jetty-console', '')
vB = vB.replace('-jetty-console', '')
vA_Array = vA.split('-')
-(NSIndexSet *) lookupAll: (NSString *) theName
{
NSIndexSet *result = [book indexOfObjectsPassingTest:
^(id obj, NSUInteger idx, BOOL *stop)
{
if ([[obj name] caseInsensitiveCompare: theName] ==
NSOrderedSame)
return YES; // found a match, keep going
else
return NO; // keep looking
function __construct()
{
global $dataSourceName; //configuration variable, has all the information to connect to database
global $dbOpts; // configuration variable, has db operation options see config and PEAR DB module for details
global $logHandler;
global $logName;
global $logIdent;
global $logConf;
global $logLevel; //these are log configuration things. Make sure you've made your homework ;)
// mne nuzhny takie veschi
@favoretti
favoretti / gist:4506524
Created January 10, 2013 22:55
opencsw collectd SMF method
bash-3.2# cat /lib/svc/method/collectd
#!/sbin/sh
PIDFILE=/var/opt/csw/run/collectd.pid
DAEMON=/opt/csw/sbin/collectd
. /lib/svc/share/smf_include.sh
case "$1" in
start)
@favoretti
favoretti / gist:4506529
Created January 10, 2013 22:56
opencsw collectd SMF manifest
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='collectd'>
<service
name='application/collectd'
type='service'
version='1'>
<create_default_instance enabled='true' />
if (gethostname(host, sizeof(host)) == 0)
host[sizeof(host) - 1] = '\0';
else
strlcpy(host, "localhost", sizeof(host));
user_info[++i] = fmt_string("host", host);
if (user_info[i] == NULL)
errorx(1, _("unable to allocate memory"));
ud->host = user_info[i] + sizeof("host=") - 1;
#include <stdio.h>
#include <unistd.h>
int main(void) {
char host[256];
if (gethostname(host, sizeof(host)) == 0)
host[sizeof(host) - 1] = '\0';
@task
def deployComponent(filepath, config, args, fabrichelper):
def signal_handler(signal, frame):
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)

Keybase proof

I hereby claim:

  • I am favoretti on github.
  • I am favoretti (https://keybase.io/favoretti) on keybase.
  • I have a public key whose fingerprint is 1C4E C3E7 980E 72C2 ACFE DB57 9D32 1AC6 564F 47CC

To claim this, I am signing this object:

@favoretti
favoretti / zimbra-letsencrypt-renew.md
Created May 8, 2018 07:37 — forked from ugurerkan/zimbra-letsencrypt-renew.md
Zimbra 8.6.0 Letsencrypt SSL renew walkthrough.