This file contains 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
$ vi push_salesforce_chatter_message.sh |
This file contains 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 main | |
import ( | |
"fmt" | |
"os" | |
"net/http" // チャットAPIコール用 | |
"net/url" // チャットAPIコール用 | |
"strings" // チャットAPIコール用 | |
"bytes" // LINE Messaging APIコール用 | |
"encoding/json" // JSONパース用 |
This file contains 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
//////////////////////////////////////// | |
// Visualforceで入力されたメッセージ内容やタイトル等をChatworkやメール配信するApexクラス | |
//////////////////////////////////////// | |
public with sharing class PostMessage { | |
// Visualforceページのテキストエリアで入力されたChatworkへ投稿するメッセージ本文を取得 | |
public String chatwork_message { get; set; } | |
// Visualforceページのテキストボックスで入力されたChatworkへ投稿するメッセージタイトルを取得 | |
public String chatwork_title { get; set; } |
This file contains 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
<apex:page controller="PostMessage"> | |
<apex:form > | |
<apex:pageBlock title="PostMessageForm"> | |
<apex:pageMessages /> | |
<table class="chatwork_messages"> | |
<tr> | |
<th> | |
Chatworkへ投稿するメッセージタイトル 及び 送信するメール件名を入力 | |
</th> |
This file contains 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
$ uname -a | |
Darwin *********** 15.6.0 Darwin Kernel Version 15.6.0: Tue Jan 9 20:12:05 PST 2018; root:xnu-3248.73.5~1/RELEASE_X86_64 x86_64 |
This file contains 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
require 'sinatra' | |
require 'sinatra/reloader' | |
require 'json' | |
PIR_STATUS_FILE = "/tmp/example-pir-status.log" | |
PIR_STATUS_FILE.freeze | |
get '/' do | |
if File.exist?(PIR_STATUS_FILE) |
This file contains 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
@RestResource(urlMapping='/CustomContact/*') | |
global with sharing class CustomContactSample { | |
@HttpGet | |
global static sObject doGet() { | |
RestRequest req = RestContext.request; | |
String ContactName = req.params.get('name'); | |
ContactName = '%' + ContactName + '%'; | |
try { | |
Contact acc = [SELECT Id, Name, Email, Account.Name FROM Contact WHERE Name LIKE :ContactName LIMIT 1]; | |
return acc; |
This file contains 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
<div class="page-header"> | |
<h1>問い合わせ確認画面</h1> | |
</div> | |
<%= form_for @inquiry, :url => inquiry_thanks_path do |f| %> | |
<table class="table"> | |
<tr> | |
<th>名前</th> | |
<td> | |
<%= f.hidden_field :name %> |
This file contains 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
[ec2-user@example-ruby-sinatra-server ~]$ cp -p /home/ec2-user/.bashrc /home/ec2-user/.bashrc.ORG | |
[ec2-user@example-ruby-sinatra-server ~]$ diff /home/ec2-user/.bashrc /home/ec2-user/.bashrc.ORG | |
[ec2-user@example-ruby-sinatra-server ~]$ |
This file contains 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
root@ip-172-26-XXX-XXX:~# iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT | |
root@ip-172-26-XXX-XXX:~# iptables -A OUTPUT -p udp --dport 53 -j ACCEPT | |
root@ip-172-26-XXX-XXX:~# iptables -A OUTPUT -p tcp --dport 123 -j ACCEPT | |
root@ip-172-26-XXX-XXX:~# iptables -A OUTPUT -p udp --dport 123 -j ACCEPT | |
root@ip-172-26-XXX-XXX:~# iptables -A INPUT -p tcp -s 192.0.2.0/24 --dport 22 -j ACCEPT | |
root@ip-172-26-XXX-XXX:~# iptables -A INPUT -p tcp -s 198.51.100.0/24 --dport 22 -j ACCEPT | |
root@ip-172-26-XXX-XXX:~# iptables -A INPUT -p tcp -s 203.0.113.11/32 --dport 22 -j ACCEPT | |
root@ip-172-26-XXX-XXX:~# iptables -A INPUT -p tcp -s 72.21.217.0/24 --dport 22 -j ACCEPT |
NewerOlder