Skip to content

Instantly share code, notes, and snippets.

@tatsuyaueda
tatsuyaueda / gist:3632562
Created September 5, 2012 07:24
WebDAV Upload Script
#!/usr/local/bin/perl
#use strict;
use utf8;
use HTTP::DAV;
use File::Basename;
my ($dav, $url, $user, $password);
$dav = new HTTP::DAV;
@tatsuyaueda
tatsuyaueda / gist:3632604
Created September 5, 2012 07:27
Twitter RT Script
#!/usr/local/bin/perl -wT
#binmode(STDOUT, ":utf8");
use strict;
use Encode;
use Net::Twitter;
use URI::Escape;
use LWP::Simple;
use XML::DOM;
@tatsuyaueda
tatsuyaueda / gist:3791764
Created September 27, 2012 02:06
Ene Repo Power usage information acquisition Script
#!/usr/local/bin/perl
use strict;
use warnings;
use HTTP::Request::Common;
use LWP::UserAgent;
use DateTime;
my $cookie_file = "cookies.txt";
my $url = "https://ene.tokai.jp/loginform.asp?csd=0";
@tatsuyaueda
tatsuyaueda / gist:3825725
Created October 3, 2012 08:01
Asterisk RT-200NE Patch
--- channels/chan_sip.c.orig 2009-11-24 01:56:08.000000000 +0000
+++ channels/chan_sip.c 2009-11-24 02:03:17.000000000 +0000
@@ -244,6 +244,9 @@
#define INITIAL_CSEQ 101 /*!< our initial sip sequence number */
+/* RT-200NE HACK */
+#define MAX_RT200NE 4 /* Number of RT-200NEs */
+
#define DEFAULT_MAX_SE 1800 /*!< Session-Timer Default Session-Expires period (RFC 4028) */
@tatsuyaueda
tatsuyaueda / gist:4035696
Created November 8, 2012 00:51
VB.net Amazon SES Sendmail Sample
Dim sesClient As AmazonSimpleEmailServiceClient = New AmazonSimpleEmailServiceClient(strAccessID, strSecretAccessKey)
Dim sesBody As Model.Body = New Model.Body(New Model.Content(txtBody.Text))
Dim sesMsg As Model.Message = New Model.Message(New Model.Content(txtSubject.Text), sesBody)
Dim sesDest As Model.Destination = New Model.Destination()
sesDest.ToAddresses.Add(strToAddress)
Dim sesReq As Model.SendEmailRequest = New Model.SendEmailRequest(strFromAddress, sesDest, sesMsg)
sesClient.SendEmail(sesReq)
@tatsuyaueda
tatsuyaueda / gist:5590181
Last active December 17, 2015 09:49
jQueryMobile Dynamic Content Rewrite(1)
$(document).bind("pagebeforechange", function(e, data) {
if(typeof data.toPage === "string") {
var u = $.mobile.path.parseUrl(data.toPage);
var re = /^#pageID/;
if (u.hash.search(re) !== -1) {
$.get("/foo/path", function(data) {
var $page = $("#pageID");
var $content = $page.children( ":jqmData(role=content)" );
$content.html($("<div>" + data + "</div>").children("#pageID").children( ":jqmData(role=content)" ).children()).trigger( "create" );
@tatsuyaueda
tatsuyaueda / gist:5596200
Created May 17, 2013 00:37
jQueryMobile Dynamic Content Rewrite(2)
$(".force-reload").click(function() {
$.get(document.URL, function(data) {
// 読み込みし直すページコンテナを指定
var anchor = "#" + document.URL.split("#")[1];
var $content = $(anchor).children(":jqmData(role=content)")
var $newContent = $("<div>" + data + "</div>").children(anchor).children(":jqmDatazrole=content)").children();
$content.html($newContent).trigger("create");
$content.find(":jqmData(role=listview)").listview();
})
@tatsuyaueda
tatsuyaueda / app.js
Last active December 22, 2017 07:14
Lambda to AWS SNS Linphone Push Notification
console.log('Loading function');
var aws = require('aws-sdk');
var sns = new aws.SNS({
apiVersion: '2010-03-31',
region: 'us-east-1'
});
exports.handler = function(params, context) {
@tatsuyaueda
tatsuyaueda / gist:4ed33c3cd3f1ae4f1035
Created March 23, 2016 04:42
Excel 2010 File Format to Excel 2003 File Format(Using COM)
Module Module1
'' このプログラムはExcel 2010形式のファイルをExcel 2003形式に変更するプログラムです。
'' 内部でExcelのCOMオブジェクトを利用するため、実行する環境でExcel 2010形式のファイルを開くことが出来る必要があります。
Sub Main(ByVal CmdArgs() As String)
' ファイル名
Dim strFilePath As String = ""
' Xls変換後ファイル名
@tatsuyaueda
tatsuyaueda / snmp_trap_template.xml
Created September 21, 2017 03:40
ZABBIX3 SNMP Trap Template
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>3.0</version>
<date>2017-09-21T03:40:17Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>