Skip to content

Instantly share code, notes, and snippets.

View ishiis's full-sized avatar
🐟
🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟

ishiis

🐟
🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟
View GitHub Profile
@ishiis
ishiis / postgresql_through_ssh_tunnel.py
Last active February 10, 2023 06:25
Example Airflow Dag to export data from PostgreSQL through ssh tunnel.
from datetime import timedelta
import pendulum
from airflow import DAG
from airflow.operators.python import PythonOperator
from airflow.providers.ssh.hooks.ssh import SSHHook
from airflow.providers.postgres.hooks.postgres import PostgresHook
from airflow.models.variable import Variable
echo "alias java='java -Duser.language=ja -Dfile.encoding=UTF-8'" >> ~/.bashrc
echo "alias javac='javac -J-Dfile.encoding=UTF-8'" >> ~/.bashrc

ソート

public class Sort {
  public static void main(String... args) {
    int[] array = {8, 6, 1, 10, 4, 7, 2, 5, 3, 9};
    printArray(array);
    quickSort(array, 0, array.length - 1);
    printArray(array);

finally -> try

public class Example {
  public static void main(String... args) {
    System.out.println(testFinally());
  }

  public static String testFinally() {
@ishiis
ishiis / create-table.sql
Last active September 7, 2017 16:25
Android 作成 Gist
$ mysql --version
mysql Ver 15.1 Distrib 5.5.52-MariaDB, for Linux (x86_64) using readline 5.1
DROP TABLE article;
CREATE TABLE IF NOT EXISTS article (
id INT(11) NOT NULL AUTO_INCREMENT,
title VARCHAR(50) DEFAULT NULL,
created_datetime DATETIME NOT NULL,
updated_datetime DATETIME NOT NULL,
PRIMARY KEY(id)
root$ cat /etc/wpa_supplicant/wpa_supplicant.conf
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid=""
    psk=""
    psk=WPA-PSK
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
$minion_instances = 1
$hosts = "192.168.33.21 centos-master-1\n"
(1..$minion_instances).each do |i|
$hosts << "192.168.33.#{30 + i} centos-minion-#{i}\n"
end
$hosts << "192.168.33.41 centos-nas-1"
# [member]
ETCD_NAME=master1
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
#ETCD_WAL_DIR=""
#ETCD_SNAPSHOT_COUNT="10000"
#ETCD_HEARTBEAT_INTERVAL="100"
#ETCD_ELECTION_TIMEOUT="1000"
ETCD_LISTEN_PEER_URLS="http://centos-master-1:2380"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
#ETCD_MAX_SNAPSHOTS="5"
package com.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

/**
 * Created by ishiis on 16/10/21.