Skip to content

Instantly share code, notes, and snippets.

@kou1okada
kou1okada / README.md
Last active April 3, 2020 06:39
last4cygwin - show a listing of last logged in current user

last for cygwin

Show a listing of last logged in current user.

@kou1okada
kou1okada / mountbsd.sh
Last active March 17, 2020 08:46
mountbsd.sh: Mount diskimage with BSD disklabel
#!/usr/bin/env bash
source hhs.bash 0.2.0
function optparse_mountbsd ()
{
case "$1" in
-m|--mount-point) # <mountpoint>
# set mount point
nparams 1
@kou1okada
kou1okada / README.md
Last active January 4, 2020 10:05
Ubuntu setup helper
sed -E 's@//security@//archive@g;s@//archive@//jp.archive@g;s/$/ universe multiverse/g;s/deb cdrom/#\0/g' -i /etc/apt/sources.list

cat <<EOD | sudo tee /usr/local/bin/ezchroot.sh
#!/usr/bin/env bash

BINDS="dev proc run sys tmp"
for i in $BINDS; do
  mount --bind /$i $1/$i
done
@kou1okada
kou1okada / README.md
Last active September 17, 2019 08:23
Followbox with Pure JS
@kou1okada
kou1okada / CMakeLists.txt
Last active January 21, 2020 05:44
hello.cs: A sample project for building C# with GNU Make.
project(hello LANGUAGES)
# enable_language(CSharp) # only suport VS2010 or later.
# add_executable(hello.cs)
if (CYGWIN)
set(MSBUILD /cygdrive/c/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe)
execute_process(COMMAND cygpath -a -w "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE DOS_STYLE_SOURCE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
else (CYGWIN)
if (WIN32)
@kou1okada
kou1okada / lspkgs.sh
Last active January 11, 2022 11:52
lspkgs.sh - List Packages
#!/usr/bin/env bash
#
# lspkgs.sh - List Packages
# Copyright 2019 (c) Koichi OKADA. All rights reserved.
# This script is distributed under the MIT license.
#
function help ()
{
cat <<-EOD
@kou1okada
kou1okada / git-get-date
Created April 8, 2019 07:56
git-get-date
#!/usr/bin/env bash
#
# git-get-date
# Copyright (c) 2019 Koichi OKADA. All rights reserved.
# This script is distributed under the MIT license.
#
function usage ()
{
cat <<-EOD
@kou1okada
kou1okada / align_column.rb
Last active April 7, 2019 13:01
align_columns.rb
#!/bin/sh
exec ruby -x "$0" "$@"
#!ruby
# coding: utf-8
#
# align_column.rb
# Copyright (c) 2019 Koichi OKADA. All rights reserved.
# This script is destributed under the MIT license.
#
@kou1okada
kou1okada / vmps.sh
Last active January 11, 2022 11:52
vmps.sh - Report virtual memory status of a process.
#!/usr/bin/env bash
#
# vmps.sh - Report virtual memory status of a process.
# Copyright (c) 2019 Koichi OKADA. All right reserved.
# This script distributed under the MIT license.
#
function vmps () # <pid> [<delay>]
# Report virtual memory status of a process.
# Args:
@kou1okada
kou1okada / sorted_diff.sh
Last active March 6, 2019 03:58
sorted_diff.sh - Show differences for sorted inputs.
#!/usr/bin/env bash
#
# sorted_diff.sh - Show differences for sorted inputs.
# Copyright (c) 2019 Koichi OKADA. All right reserved.
# This script distributed under the MIT license.
#
# Note:
# This script is wastefull.
# Use the `join` command included in the coreutils.