Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mugifly's full-sized avatar
🏠
Working from home

Masanori Ohgita mugifly

🏠
Working from home
View GitHub Profile
@mugifly
mugifly / dokku-in-proxy.md
Last active July 6, 2018 06:41
Dokku in Proxy

Dokku in proxy

$ export http_proxy=http://example.com:8080/
$ export https_proxy=$http_proxy
$ sudo -E sh -c "echo 'Acquire::http::proxy \"$http_proxy\";' >> /etc/apt/apt.conf"
$ sudo -E sh -c "echo 'Acquire::https::proxy \"$https_proxy\";' >> /etc/apt/apt.conf"

$ wget https://raw.githubusercontent.com/progrium/dokku/v0.4.3/bootstrap.sh
$ sudo -E DOKKU_TAG=v0.4.3 bash bootstrap.sh
@mugifly
mugifly / docker-container-ip.sh
Last active October 5, 2020 10:26
Simple inspector for Docker container IP address (shell script)
#!/bin/bash
# Simple inspector for Docker container IP address
# https://gist.github.com/mugifly/3bb1c54b48764340eda8
print_help () {
echo -e "USAGE: docker-container-ip.sh KEYWORD\n"
echo "KEYWORD: A keyword string for target container."
echo " e.g. dokku.mysql.foobar"
echo -e "\n[Example usecases]"
echo " Connect to MySQL database in container:"
@mugifly
mugifly / ftp-clone.sh
Last active November 20, 2015 16:44
FTP directory clone script for Unix OS (Required: bash & wget command)
#!/bin/bash
# FTP directory clone script for Unix OS
# Required: bash & wget command
# https://gist.github.com/mugifly/931624e375d40267afc4
# Copy source (Remote FTP server)
SRC_HOST="example.com"
SRC_USERNAME="xxxx"
SRC_PASSWORD="yyyy"
SRC_DIRECTORY="/home/xxxx/src"
#!/bin/bash
# Database migration script for Sakura to Any
SRC_IS_SSH_USE=1
SRC_SSH_SAKURA_USER="example"
SRC_SSH_HOST="${SRC_SSH_SAKURA_USER}.sakura.ne.jp"
SRC_SSH_USERNAME="${SRC_SSH_SAKURA_USER}"
SRC_SSH_PASSWORD="foobar"
SRC_DB_HOST="mysql0000.db.sakura.ne.jp"
@mugifly
mugifly / make-mysql-db-and-user.pl
Created February 24, 2016 06:38
MySQL Database and User Generator
#!/usr/bin/env perl
print "MySQL Database and User Generator\n";
print "Input database name: ";
my $db_name = <STDIN>;
chomp $db_name;
if (length($db_name) <= 0) {
exit 0;
}
function test () {
postToSlack('Hello!');
}
function postToSlack (text) {
var SLACK_WEBHOOK_URL = 'https://hooks.slack.com/services/XXXXX/YYYYY/ZZZZZ';
@mugifly
mugifly / set-le-certs-to-dokku.sh
Last active May 15, 2016 12:33
Setup Script for the Let's Encrypt Certificate to Dokku apps
#!/bin/bash
# Setting Script for Let's Encrypt Certificate for Dokku apps
# Path of Let's Encrypt command
PATH_LE="/root/letsencrypt/"
# Base domain of dokku apps
DOKKU_BASE_DOMAIN="example.com"
# App names
@mugifly
mugifly / magnum-ci-build-android-apk-and-post-to-slack.md
Last active November 24, 2017 11:40
Build of Android Studio Project and Post the apk to Slack from Magnum CI

Build of Android Studio Project and Post the apk to Slack from Magnum CI

  • Build the Android Studio Project (Gradle Project) which exist on your Git repository.
  • Upload the generated apk file to Slack.

Basic Setup

  • Name: YOUR-REPOSITORY-NAME
  • Repository URL: git@github.com:XXX/YYY.git
  • Provider: Github
  • Source control: Git
  • Project type: Generic
@mugifly
mugifly / circle.yml
Last active March 25, 2021 13:48
Faster test & Build of Android Studio Project (Gradle Project) on Circle-CI.
machine:
java:
version: oraclejdk8
environment:
# Java options
JAVA_OPTS: "-Xms512m -Xmx2048m"
# ADB options
ADB_INSTALL_TIMEOUT: 5000
dependencies:
@mugifly
mugifly / circle.yml
Last active June 28, 2016 15:14
Test of Perl project (dependency managed using cpanm & carton) on Circle-CI
machine:
environment:
# Path
PATH: "$PATH:/home/$USER/perl5/bin"
# cpanm - Install destination of libraries
PERL_CPANM_OPT: "--local-lib=/home/$USER/perl5"
# perl - Include path
PERL5LIB: "/home/$USER/perl5/lib/perl5:$PERL5LIB"
dependencies: