This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getRequest(url: string): Promise<any> { | |
return new Promise<any>( | |
function (resolve, reject) { | |
const request = new XMLHttpRequest(); | |
request.onload = function () { | |
if (this.status === 200) { | |
resolve(this.response); | |
} else { | |
reject(new Error(this.statusText)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
import os | |
import sys | |
import stat | |
import md5 | |
filesBySize = {} | |
def walker(arg, dirname, fnames): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cz.osladil.fblogin; | |
import com.gargoylesoftware.htmlunit.WebClient; | |
import com.gargoylesoftware.htmlunit.WebWindow; | |
import com.gargoylesoftware.htmlunit.html.HtmlElement; | |
import com.gargoylesoftware.htmlunit.html.HtmlPage; | |
import com.gargoylesoftware.htmlunit.html.HtmlPasswordInput; | |
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput; | |
import com.gargoylesoftware.htmlunit.html.HtmlTextInput; | |
import com.gargoylesoftware.htmlunit.util.Cookie; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use utf8; | |
use encoding 'utf8'; | |
use Date::Calc qw(Delta_Days); | |
my $mailLog = '/data/var/lib/kms/logs/mail.log'; | |
my $dbLog = './log.txt'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use utf8; | |
use encoding 'utf8'; | |
use LWP::Simple; | |
use XML::RSS; | |
use Data::Dumper; | |
use Encode; #qw/encode decode/; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These two files should help you to import passwords from mac OS X keychains to 1password. | |
Assumptions: | |
1) You have some experience with scripting/are a power-user. These scripts worked for me | |
but they haven't been extensively tested and if they don't work, you're on your own! | |
Please read this whole document before starting this process. If any of it seems | |
incomprehensible/frightening/over your head please do not use these scripts. You will | |
probably do something Very Bad and I wouldn't want that. | |
2) You have ruby 1.9.2 installed on your machine. This comes as standard with Lion, previous | |
versions of OS X may have earlier versions of ruby, which *may* work, but then again, they |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# use warnings; | |
# use strict; | |
die('File not specified') if not $ARGV[0]; | |
open FILE, $ARGV[0] or die $!; | |
my %months = (); | |
my ($firstRecord, $lastRecord); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Kerio Control - Sample Application. | |
* | |
* STATUS: In progress, might change in the future | |
* | |
* This api is currently under development. | |
* The api is not intended for stable use yet. | |
* Functionality might not be fully verified, documented, or even supported. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'src/KerioControlApi.php'; | |
$api = new KerioControlApi('Create user', 'Miroslav Osladil', '1.0'); | |
try { | |
$session = $api->login('fw.company.local', 'username', 'password'); | |
/* a new user */ | |
$newUser = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'src/KerioControlApi.php'; | |
$api = new KerioControlApi('Setup Custom HTTP Rule', 'Miroslav Osladil', '1.0'); | |
try { | |
$session = $api->login('fw.company.local', 'username', 'password'); | |
/* get current http rules */ | |
$result = $api->sendRequest('HttpPolicy.get'); |