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
#!/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 / gist-clone-ssh.pl
Last active December 26, 2015 11:59
Gist ssh-clone script (git clone via ssh)
#! /usr/bin/env perl
# Gist ssh-clone script
# Help: $ perl git-clone-ssh.pl --help
# (c) Masanori Ohgita (http://ohgita.info/) - 2013, MIT License.
use warnings;
use strict;
use utf8;
use File::Basename qw//;
@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;
}
@mugifly
mugifly / arch-cfs10-kernel-rebuild.pl
Last active March 18, 2016 16:21
Arch Linux - Linux kernel rebuild script for Let's note CF-S10 series. (Required: perl 5.x)
#!/usr/bin/env perl
# Arch Linux - Linux kernel rebuild script for Let's note CF-S10 series
# https://gist.github.com/mugifly/9582654/
# Required: perl 5.x
use strict;
use warnings;
use utf8;
use Cwd;
use File::Path;
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 / 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:
@mugifly
mugifly / Dockerfile
Created August 18, 2016 16:27
Dockerfile for Build and CI of Android Projects - Included: fb-adb command, disabling system animation
FROM java:8
MAINTAINER Masanori Ohgita
# NOTE: This Dockerfile was forked from following projects.
# https://github.com/denlabo/dockerfile-android-project - Modified by Ohgita on denLabo LLC
# https://github.com/gfx/docker-android-project - Authored by FUJI Goro (MIT License)
ENV DEBIAN_FRONTEND noninteractive
# Install dependencies
@mugifly
mugifly / git-branch-clean.pl
Last active August 20, 2016 13:29
Git branch cleaner script - Delete a branches that not exist on remote repository. (perl 5.x)
#! /usr/bin/env perl
# Git branch cleaner ( Delete a branches that not exist on remote repository)
# If you have not ran the 'git fetch --plune' command, please try it before this script.
# Useful case (maybe): If can't delete a branches using 'git fetch --plune' command.
#
# Usage: $ perl git-branch-clean.pl --help
use warnings;
use strict;
use utf8;
@mugifly
mugifly / start-netconsole-capture.sh
Created December 18, 2016 16:45
Netconsole capturing script
#!/bin/bash
ip=` ip --oneline --family inet address show dev wlp8s0 | cut -d' ' -f7 | cut -d '/' -f1`
echo "-- Watching on ${ip}:6666 --"
nc -u -l -p 6666