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; | |
my $DEBUG = 0; | |
my $RUNFILE = "/var/tmp/ftd-logmon.run"; | |
my $ALRT = "ALRT"; | |
$ALRT = "CJ" if ($DEBUG); |
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
PC is Dell Optiplex 7050 | |
- Two HDDs use as software raid | |
- System must use gpt, and also boot from EFI | |
- Debian Linux as base system | |
- Runing VirtualBox | |
- Windows-7 for ASRS as guest on VirtualBox | |
- Win7 should start automatically after system up, | |
so user won't confused with linux | |
- choose lightdm as DM |
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 | |
set -e -x -o pipefail | |
DIRNAME="$(dirname $0)" | |
DISK="$1" | |
: "${DEBIAN_RELEASE:=stretch}" | |
: "${DEBIAN_VERSION:=9.2.1}" | |
: "${DEBIAN_MIRROR:=http://ftp.debian.org}" |
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; | |
my $url = "https://public-dns.info/nameservers.txt"; | |
open CMD, "curl -s $url |" or die "Can't execute command : $!\n"; | |
while (<CMD>) { | |
next if /:/; |
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
Try 13466917 | |
real 4m14.519s | |
user 4m14.412s | |
sys 0m0.072s | |
Try 20996011 | |
real 8m33.265s | |
user 8m31.852s |
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 "Need root privileges" && exit | |
DOMAIN="DOMAIN" | |
DOMAINSID=`sudo net getdomainsid | grep $DOMAIN | awk '{ print $6 }'` | |
GID="513" | |
SID="${DOMAINSID}-${GID}" | |
SMB_TDB="smb.conf-tdb-backend" |
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
d-i debian-installer/locale string en_US.UTF-8 | |
d-i keyboard-configuration/xkb-keymap select us | |
# first ethernet interface for VirtualBox PC is enp0s3 # | |
d-i netcfg/choose_interface select enp0s3 | |
d-i netcfg/get_hostname string debian | |
d-i netcfg/get_domain string example.com | |
d-i netcfg/wireless_wep string |
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 | |
SSHOPTS="-q -o PasswordAuthentication=no -o KbdInteractiveAuthentication=no -o ChallengeResponseAuthentication=no -o StrictHostKeyChecking=no" | |
SSH="/usr/bin/ssh $SSHOPTS" | |
IP="127.0.0.1" | |
[ "$1" ] && IP="$1" | |
$SSH $IP |
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 | |
[ -z "$1" ] && echo "Usage: $0 https://www.google.com" && exit | |
URL="$1" | |
curl --insecure -v $URL 2>&1 |\ | |
awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }' |
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 | |
[ -z "$1" ] && echo "Usage: $0 www.example.com" && exit | |
SERVERNAME="$1" | |
echo |\ | |
openssl s_client \ | |
-showcerts \ | |
-servername $SERVERNAME \ |