Skip to content

Instantly share code, notes, and snippets.

Mac OS Xでsshを別のポート番号でlistenさせる設定

注意

設定方法

追加でポート10022番でsshdをlistenさせる設定。

//
// mqtt_pub_hdc1000_s9648_100.ino - mqtt publish sample for Arduino Yun
//
#include <YunClient.h>
#include <PubSubClient.h>
#include <Wire.h>
char *server = "mqtt.example.com";
int port = 1883;
char *username = "username";
@yoggy
yoggy / mail.rb
Created September 1, 2015 11:11
Rubyのmailライブラリではまったこと ~ sendという名前の関数が定義されていると、mail.deliverの実行に失敗する...
#!/usr/bin/ruby
require 'mail'
def send
#sendという名前の関数が定義されていると、mail.deliverの実行に失敗する...
end
mail = Mail.new do
from "[email protected]"
to "[email protected]"
@yoggy
yoggy / memo.md
Created August 19, 2015 04:59
Rubyのpitを使っていてたまに遭遇するエラーについてメモ

Rubyのpitを使っていてたまに遭遇するエラーについてメモ

Rubyのpitを使っていて、~/.pit/pit.yamlの中身が壊れていると

$ ruby ./test.rb
/var/lib/gems/1.9.1/gems/pit-0.0.7/lib/pit.rb:76:in `load': undefined method `[]' for false:FalseClass (NoMethodError)
      from /var/lib/gems/1.9.1/gems/pit-0.0.7/lib/pit.rb:47:in `get'
    .
    .
#!/usr/bin/ruby
str = ""
ARGF.read.each_line do |l|
str << l.chomp
end
puts str
#!/usr/bin/ruby
Dir.glob("*.mp4") do |f|
next if /-org/ =~ f
vcopy_file = f;
org_file = f + ".-org.mp4"
File.rename(f, org_file);
cmd = "ffmpeg -i #{org_file} -vcodec copy -map 0:0 #{vcopy_file}"
puts "exec : #{cmd}"

スクリーンロックする時のショートカットのメモ

Windows

  • Windowsキー + L

Mac OS X

  • ctrl + shift + 電源ボタン

Ubuntu (Unity)

電源を入れたときにtty1を自動ログインする設定あれこれ集.md

CentOS

CentOS7 (systemd)

次のコマンドを実行

$ sudo systemctl edit getty@tty1

@yoggy
yoggy / java_invokestatic_memo.md
Created June 18, 2015 06:23
Javaでinner classのprivateメソッドの呼び出しにはinvokestaticが使われるのが仕様みたい?

まず、PseudoSketch.javaというファイルを用意する。

public class PseudoSketch {
    class A {
        private void a() {
            System.out.println("a");
        }
    }
void setup() {
size(200, 200);
}
void draw() {
background(255);
strokeWeight(3);
stroke(0, 255, 0);