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 | |
SDCARD="$1" | |
RANDFILE="/tmp/rand10m" | |
TMPBIN="/tmp/tmp.bin" | |
MAGICWORD="--i-know-what-i-am-doing" | |
BS="10240" | |
COUNT="1024" |
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 | |
LEN=10 # video length in seconds | |
SLEEP=3 # sleep time in seconds | |
SAVEDIR="/tmp/camera" | |
CAMERA=$1 | |
# How to use thi script | |
[ -z "$CAMERA" ] && echo "Usage: $0 /dev/videoX ## where X is [0..n]" && exit |
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 | |
BASEDIR="/srv/repos/apt/debian" | |
CONFDIR="${BASEDIR}/conf" | |
DISTFILE="${CONFDIR}/distributions" | |
OPTIONS="${CONFDIR}/options" | |
DEBWORKDIR="/home/cj/work" | |
# DEBFILE="${DEBWORKDIR}/python_3.10.4-1_amd64.deb" | |
DEBFILE="python_3.10.4-1_amd64.deb" |
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 | |
REPODIR="/srv/repos/apt/debian" | |
CONF="/tmp/repos-$$.conf" | |
APACHECONFDIR="/etc/apache2/conf-available" | |
[ ! -d "${APACHECONFDIR}" ] && \ | |
echo "Apache2 conf directory is not available, is it installed?" && \ | |
exit |
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 bash | |
NAME="Chatchai Jantaraprim" | |
EMAIL="cj@cjv6.net" | |
[ -d ".gnupg" ] && echo "Directory .gnupg exist" && exit | |
# rm -rf .gnupg | |
mkdir -m 0700 .gnupg | |
touch .gnupg/gpg.conf |
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/bash | |
# ----- work space config ----- | |
WORKDIR="$(pwd)" | |
SRCDIR="${WORKDIR}/src" | |
BUILDDIR="${WORKDIR}/build" | |
LOGDIR="${WORKDIR}/log" | |
# ----- package config ----- | |
NAME="python" |
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/perl -w- | |
use strict; | |
use warnings; | |
use Crypt::PBKDF2; # libcrypt-pbkdf2-perl | |
use String::Random qw(random_string); # libstring-random-perl | |
use constant HASHCLASS => 'HMACSHA2'; | |
use constant ITERATION => 10000; |
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 | |
CUAD="/root/bin/can-user-access-dir" # Can this 'user' access this 'directory' | |
[ -z "$1" ] && echo "Usage: $0" && exit | |
USER=$1 | |
### Prepare working space ### | |
T=`mktemp -d --tmpdir=/tmp .XXXXX` |
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 | |
[ "`id -u`" != 0 ] && echo "Must be root to run this script" && exit -1 | |
[ -z "$2" -o "$3" ] && echo "Usage: $0 user directory" && exit -1 | |
USER="$1" | |
DIR="$2" | |
id "$USER" >& /dev/null || { | |
echo "User '$USER' not exist"; |
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 | |
# What need to be done | |
# 1. local binary script: ${REMOTE}-vnc | |
# | |
#| #!/bin/sh | |
#| | |
#| PORT=5998 | |
#| tmux new ssh -L${PORT}:localhost:${PORT} pi-01 bin/vnc-at-${PORT} \; \ | |
#| split -v "sleep 3; vncviewer -passwd $HOME/.vnc/pi-01-${PORT} localhost:${PORT}" \; \ |
NewerOlder