Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# nm-dispatcher.d-rsyslog NetworkManager dispatcher script for Rsyslog
#
# Description:
# This script restart rsyslog when hostname is updated (ex. hostname via dhcp).
# Because new hostname is not applied until rsyslog restarted (ex. via logrotate).
#
# Installation:
# # install nm-dispatcher.d-rsyslog /etc/NetworkManager/dispatcher.d/99-rsyslog
#!/bin/bash
# Original version is written by Chris Kloiber <ckloiber@redhat.com>
# This fork version is modified by HONDA Hirofumi <h2onda@gmail.com>
# A quick hack that will create a bootable DVD iso or non-bootable
# source DVD iso of a Red Hat Linux Distribution. Feed it either a
# directory containing the downloaded iso files of a distribution,
# or point it at a directory containing the "RedHat", "isolinux",
# and "images" directories.
#!/bin/bash
OUTPUTDIR=.
MAXSIZE=2048
usage(){
echo Usage: $(basename $0) [-s maxsize] [-o outputdir] jpg_file [...]
echo -s: max resolution [default: 2048]
echo -o: output directory [defalut: ./ ]
}
@h2onda
h2onda / sample_getopts.sh
Last active September 30, 2015 14:58
getopts usage sample
#!/bin/bash
usage() {
echo "$(basename $0) [options] args"
}
while getopts 'p:fh' args "$@"
do
case $args in
p)
@h2onda
h2onda / sample_daemon.c
Created January 24, 2012 03:34
daemon program sample
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main(void)
{
/* exit session leader */
switch (fork()) {
case -1: