This file contains hidden or 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
# --zero-speed=1000000000 for 1000Mbps | |
# --zero-speed=100000000 for 100Mbps | |
cfgmaker --snmp-options=:::::2 --global "WorkDir: /usr/local/www/data/html/mrtg/172.16.1.1" --global "Options[_]: growright, bits" --global "Language: big5" --global 'AddHead[_]:<script type="text/javascript" src="//jal.tw/google_analytics.js"></script>' --zero-speed=1000000000 --show-op-down --if-filter='$if_type!=1 && $if_type!=53 && $if_type!=24 && $if_type!=131 && $if_type!=135 && $if_type!=136 && $if_type!=137 && $if_type!=142 && $if_type!=150 && $if_type!=217 && $if_type!=218 && $if_type!=222 && $if_type!=223' community_readonly@172.16.1.1 --output=172.16.1.1.cfg | |
# -i in-place edit, only work for GNU sed, not portable.(直接改原始檔案,僅支援 GNU sed,跨平台有可能會失效) | |
/usr/bin/sed -i '' -e 's/iso-8859-15/big5/g' */*/index.html | |
/usr/bin/sed -i '' -e '/Command line/d' */*/index.html | |
/usr/bin/sed -i '' -e '/Command-Line/d' */*/index.html | |
/usr/bin/sed -i '' -e '/commandline/d' */*/index.html | |
/usr/bin/sed -i '' -e '/HTTP-EQUIV="Expires"/d' */*/index |
This file contains hidden or 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 | |
name="shell-script" | |
now=`/bin/date` | |
echo "Starting at ${now}." | |
LOCKFILE="/var/run/${name}.lock" | |
if [ -f ${LOCKFILE} ] | |
then |
This file contains hidden or 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
Suite for nginx, apache2.4, dovecot, postfix | |
Tips: | |
Understand Cipher String Format | |
https://msdn.microsoft.com/en-us/library/windows/desktop/aa374757%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 | |
ALL:!DH:!kRSA:!SRP:!kDHd:!DSS:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK:!RC4:!ADH:!LOW@STRENGTH | |
Apache 2.4 |
This file contains hidden or 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
/* jal.180308 */ | |
參考資料: https://www.cloudflare.com/dns/dnssec/ecdsa-and-dnssec/ | |
curl -s http://www.internic.net/domain/root.zone | awk '$4 == "DS" { print $6}' | sort -n | uniq -c | |
63 5 (RSA/SHA-1) | |
525 7 (RSASHA1-NSEC3-SHA1) | |
2150 8 (RSA/SHA-256) | |
38 10 (RSA/SHA-512) | |
curl -s http://www.internic.net/domain/root.zone | awk '$4 == "DS" { print $1, $5, $6}' | uniq | awk '{print $3}' | sort | uniq -c |
This file contains hidden or 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
// This document showing how to upgrade some really old version's FreeBSD to latest via Internet. | |
// ================================================ | |
// Part 0: Before you start anything | |
// ================================================ | |
# reboot | |
// Make sure your server's OS and hardware are both fine. | |
// ================================================ | |
// Part 1: Reversion from stable to release version |
This file contains hidden or 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 | |
DATE=`/bin/date +%Y%m%d` | |
TIME=`/bin/date "+%Y-%m-%d %H:%M:%S"` | |
DDIR=`/usr/bin/readlink /home/hosts/www/jal.tw/html` | |
SDIR="/home/hosts/www/jal.tw" | |
BDIR="/root/shell/dump" | |
PASS="PleaseTellMe" | |
TITLE="jal.tw" | |
EMAIL="jal@jal" |
This file contains hidden or 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 | |
DATE=`/bin/date +%Y%m%d` | |
TIME=`/bin/date "+%Y-%m-%d %H:%M:%S"` | |
SDIR="/usr/local/etc" | |
DDIR="namedb" | |
BDIR="/home/backup" | |
PASS="IWISHYOUCANTELLME" | |
TITLE="jal.tw dns" | |
EMAIL="jal@jal" |
This file contains hidden or 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
Apache process size 1 | |
ps -ylC httpd --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}' | |
Apache process size 2 | |
wget https://raw.githubusercontent.com/pixelb/ps_mem/master/ps_mem.py | |
sudo python ps_mem.py | |
This file contains hidden or 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
1. Convert PEM to PKCS12 | |
openssl pkcs12 -export -out jal.tw.pfx -name tomcat -inkey jal.tw.key -in jal.tw.crt -CAfile jal.tw.CA.bundle -caname root | |
2. Import private key and certificate into keystore | |
# "changeit" is the password, you can modify it as your wish and make sure server.xml also too. | |
# keystoreFile="jal.tw.jks" keystorePass="changeit" | |
# deststorepass and destkeypass must be same. | |
# On Tomcat/Coyote don't chanege alias(tomcat), let tomcat can find it correctly. | |
keytool -importkeystore -deststorepass changeit -destkeypass changeit -destkeystore jal.tw.pkcs12.jks -srckeystore jal.tw.pfx -srcstoretype PKCS12 -srcstorepass changeit -alias tomcat -deststoretype PKCS12 |
This file contains hidden or 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
# This script is bundle in curl source code | |
# download scritp from https://github.com/curl/curl/tree/master/lib | |
wget https://raw.githubusercontent.com/curl/curl/master/lib/mk-ca-bundle.pl | |
chmod 700 mk-ca-bundle.pl | |
# Make sure system have perl | |
./mk-ca-bundle.pl | |
# You will get ca-bundle.crt that content all Root CA in pem format |
OlderNewer