Skip to content

Instantly share code, notes, and snippets.

View ikemo3's full-sized avatar

Hideki Ikemoto ikemo3

  • Ehime, Japan
View GitHub Profile
@yuya-takeyama
yuya-takeyama / statdiff.sh
Created September 21, 2011 10:32
2 つのディレクトリ中のパーミッション, 所有者を一覧化し, お互いに差分が無いか出力する.
#!/bin/sh
#
# 2 つのディレクトリ中のパーミッション, 所有者を一覧化し,
# お互いに差分が無いか出力する.
#
# Author: Yuya Takeyama
if [ "$1" = "" -o "$2" = "" ]; then
echo "Usage: `basename $0` file1 file2"
exit 1
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active July 4, 2024 17:31
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@cabal95
cabal95 / vm-backup.sh
Created July 25, 2015 17:53
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1
@mizucopo
mizucopo / Dockerfile
Created March 20, 2016 11:04
ruby:alpine with nokogori
FROM ruby:alpine
MAINTAINER mizu <mizu.copo@gmail.com>
RUN set -x \
&& apk upgrade --no-cache \
&& apk add --no-cache --virtual build-dependencies \
build-base \
&& apk add --no-cache \
libxml2-dev \
libxslt-dev \
@hyuki0000
hyuki0000 / check.rb
Last active February 28, 2017 07:41
何か行動するときのチェックリストをチェックする簡単なRubyスクリプト
#!/usr/bin/env ruby
DIRECTORY = '/Users/USERNAME/.check'
def check(file)
File::open(file) do |f|
f.each_line do |line|
puts line
STDIN.gets.chomp
end
@twolfson
twolfson / README.md
Last active June 7, 2022 23:45
Capturing retina screenshots on a non-retina device via Xvfb

We are bootstrapping a startup and don't own any retina devices to capture high resolution screenshots. Thankfully, this is possible via Xvfb.

Convenience Node.js script here: https://gist.github.com/twolfson/4f7e7ec7d6969173d6a095f86e2d47c8

Here's how to get started manually:

  • Launch an Xvfb instance with retina-scale DPI
    • Xvfb :99 -screen 0 3840x2160x24 -dpi 240
    • We'll be using :99 as our $DISPLAY but any unused value will do
    • Note that we are using 2x our expected resolution for dimensions (1920x1080 * 2 -> 3840x2160)
@nota-ja
nota-ja / take-it-easy-its-just-a-pull-request.md
Last active April 29, 2023 05:39
おきらくプルリク生活のススメ

おきらくプルリク生活のススメ

この記事は 武蔵野 Advent Calendar の12日目の記事です。


なぜこんな記事を書いたか

この記事を書いた目的は,私の (しょぼい) pull-request (以下「プルリク」) 遍歴を振り返って,「こんなにしょぼくても大丈夫だから,みんな気軽にOSSにプルリクしよう」ということを呼びかけることにある。

@ggarcia24
ggarcia24 / pipeline.gdsl
Last active June 15, 2024 20:25
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')