This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* vim: set ts=4 sw=4 sts=4 et: */ | |
#include <blkid.h> | |
#include <stdio.h> | |
static void print_udev_format (FILE* fp, const char *name, const char *value) | |
{ | |
char enc[265], safe[256]; | |
*safe = *enc = 0; | |
if (!strcmp (name, "TYPE") || !strcmp (name, "VERSION")) { | |
blkid_encode_string (value, enc, sizeof(enc)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# \Author: Like Ma <likemartinma@gmail.com> | |
# \brief: It shows btrfs subvolume info and supports Python 2/3 | |
import sys | |
from re import compile as rcomp | |
from subprocess import Popen, PIPE, STDOUT | |
SUBVOL_CHECKER = rcomp( | |
r'^ID\s+(?P<id>\d+)\s+gen\s+(?P<gen>\d+)\s+' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ $# -lt 1 ]; then | |
echo "$0 <host:port|SSL certificate|SSL certificate request|private key>" >&2 | |
exit 1 | |
fi | |
src=$1 | |
if [ -f $1 ]; then | |
grep -q -- '-BEGIN CERTIFICATE-' $src && openssl x509 -in $src -text -noout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# vim: set ts=4 sw=4 sts=4 et: | |
from distutils.version import LooseVersion | |
from subprocess import Popen, PIPE | |
from re import compile as rcomp | |
from os import uname, system | |
from sys import exit | |
from argparse import ArgumentParser, ArgumentTypeError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
GLUSTER_IMAGE=gluster/gluster-centos | |
gluster_ip_addr() { | |
local name=$1 | |
docker inspect $1 | sed -n 's/.*"IPAddress":[[:blank:]]\+"\([^"]\+\)".*/\1/p' | sort -u | |
} | |
gluster_status() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
current_branch=`git rev-parse --abbrev-ref HEAD` | |
if [ -z "$current_branch" ]; then | |
echo "You are not in a git repository." >&2 | |
exit 1 | |
fi | |
branch=${1:-develop} | |
[ "$current_branch" = "$branch" ] && exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
current_branch=`git rev-parse --abbrev-ref HEAD` | |
if [ -z "current_branch" ]; then | |
echo "You are not in a git repository." >&2 | |
exit 1 | |
fi | |
git push ${1:--u} origin $current_branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# - Check glibc version | |
# CHECK_GLIBC_VERSION() | |
# | |
# Once done this will define | |
# | |
# GLIBC_VERSION - glibc version | |
# | |
MACRO (CHECK_GLIBC_VERSION) | |
EXECUTE_PROCESS ( | |
COMMAND ${CMAKE_C_COMPILER} -print-file-name=libc.so.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim syntax file | |
" Language: ACE log file | |
" Maintainer: Like Ma <likemartinma@gmail.com> | |
" Latest Revision: 2019-03-17 | |
if exists("b:current_syntax") | |
finish | |
endif | |
let s:cpo_save = &cpo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
get() { | |
echo "$SMART_INFO" | awk "/$1/ {print $2}" | |
} | |
device_number() { | |
printf "%u\n" 0x`stat -c $2 $1` | |
} |
OlderNewer