#] root@web:~ 21:47:16 0 [# cat /usr/sbin/apacheAccessLog.sh #!/bin/bash filename="/var/log/apache2/access.log.1" hostname="localhost" username="apache" password="******" database="apache" sqltable="accessLog" mysql -h${hostname} -u${username} -p${password} ${database} << EOQ LOAD DATA LOCAL INFILE "${filename}" INTO TABLE $sqltable FIELDS TERMINATED BY '\t' EOQ
mysql> select * from accessLog where datetime > date_sub( now( ), interval 1 day) and status = 404; mysql> select count(*), substring( request, 1, 64 ), filename from accessLog where datetime > date_sub( now( ), interval 1 day) and status = 404 group by request, filename order by count(*) desc; mysql> select * from accessLog where datetime > date_sub( now( ), interval 1 day) and status not in( 401, 404 ); mysql> select count(*), substring( request, 1, 64 ), filename from accessLog where datetime > date_sub( now( ), interval 1 day) and status not in( 401, 404 ) group by request, filename order by count(*) desc; mysql> select filename, count(*) from accessLog where datetime > date_sub( now( ), interval 1 day ) and status <> 404 group by filename order by count(*) desc; mysql> select filename, count(*) from accessLog where datetime > date_sub( now( ), interval 1 day ) and status not in( 401, 404) group by filename order by count(*) desc; mysql> select substr( filename, 1, 29 ), count(*) from accessLog where datetime > date_sub( now( ), interval 1 day ) and status not in( 401, 404 ) and filename regexp '/var/www/html/us/kohlmeyer/[cekp]' group by substr( filename, 1, 29 ) order by count(*);
#] kemiko@box:~ 09:47:15 0 [# cat .xinitrc /usr/bin/xmodmap /home/kemiko/.xmodmap #] kemiko@box:~ 09:47:18 0 [# cat .xmodmap # swaps the "Esc" key for "Caps Lock" key...much better for VI editing, but can be a pain in other applications ! Swap caps lock and escape remove Lock = Caps_Lock keysym Escape = Caps_Lock keysym Caps_Lock = Escape add Lock = Caps_Lock #] kemiko@box:~ 09:47:20 0 [#
#] kemiko@box:~ 12:55:36 0 [# cat .inputrc set editing-mode vi set keymap vi-command set enable-bracketed-paste Off # fixes/changes full line paste to the shell "executing" the newline...BASH 4.4 and newer #] kemiko@box:~ 12:55:37 0 [#
#] kemiko@box:~ 09:49:10 0 [# cat .vimrc " color scheme to use color kemiko set paste set softtabstop=2 set expandtab " macro definitions...count right, down, and up let @x = "ywp^A" let @y = "YPj^A" let @z = "YP^A" #] kemiko@box:~ 09:50:15 0 [#
#] kemiko@box:~ 09:53:31 0 [# cat .vim/colors/kemiko.vim " local syntax file - set colors on a per-machine basis: " vim: tw=0 ts=2 sw=2 " Vim color file " Maintainer: Kent M Kohlmeyer " Last Change: 2018-09-05 hi clear set background=dark if exists("syntax_on") syntax reset endif let g:colors_name = "kemiko" highlight Comment term=bold ctermfg=darkgray highlight Constant ctermfg=14 cterm=none guifg=#00ffff gui=none highlight Identifier ctermfg=6 guifg=#00c0c0 highlight Statement ctermfg=3 cterm=bold guifg=#c0c000 gui=bold highlight PreProc ctermfg=10 guifg=#00ff00 highlight Type ctermfg=2 guifg=#00c000 highlight Special ctermfg=12 guifg=#0000ff highlight Error ctermbg=9 guibg=#ff0000 highlight Todo ctermfg=4 ctermbg=3 guifg=#000080 guibg=#c0c000 highlight Directory ctermfg=2 guifg=#00c000 highlight StatusLine ctermfg=11 ctermbg=12 cterm=none guifg=#ffff00 guibg=#0000ff gui=none highlight Normal guifg=#ffffff guibg=#000000 highlight Search ctermbg=3 guibg=#c0c000
#] kemiko@box:~ 10:16:51 0 [# cat ~/.ssh/config Host * ServerAliveInterval 600 ServerAliveCountMax 5 #] kemiko@box:~ 10:17:04 0 [#
#] kemiko@box:~ 09:49:07 0 [# cat .gdbinit # .gdbinit; 2024-12-09; Kent M Kohlmeyer (kemiko) # alias gdb='gdb --quiet' # show, info, help # b = break # d = delete # l = list # n = next # q = quit # r = run # ! = rerun history command #for suggestion/completion...even shows user defines # set prompt (gdb) set prompt \033[1m(gdb) \033[0m set height 36 set listsize 36 set pagination 0 # on|off set print array # on|off set print pretty set history filename ~/.gdbhist # on|off set history save # on|off set history expansion set history size 256 define clr shell clear end define pin shell printf "\033[%d;%dH" "$arg0" "$arg1" end #] kemiko@box:~ 09:49:10 0 [#
#] kemiko@box:~ 00:39:53 0 [# cat .bashrc #... umask 0002 LS_COLORS='di=1:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35:*.rpm=90' export LS_COLORS set -o vi bind -m vi-command 'Control-l: clear-screen' bind -m vi-insert 'Control-l: clear-screen' export EDITOR='/usr/bin/vi' export PAGER='/usr/bin/less -SX' PATH=${PATH}:/data/bin fnFileBase( ) { BASENAME=$(basename ${1}) echo ${BASENAME} | awk -F'.' '{print $1}' } fnFileExt( ) { BASENAME=$(basename ${1}) echo ${BASENAME##*.} } fnDate( ) { date +%Y%m%d } fnDateLog( ) { date +%Y-%m-%d } fnTime( ) { date +%H%M%S } fnTimeLog( ) { date +%H:%M:%S } fnAbsoluteValue( ) { if [ "${1}" -eq "${1}" ] 2>/dev/null then [ $1 -lt 0 ] && echo $((-$1)) || echo $1 else : fi } # return 1 = true and 0 = false fnInteger( ) { local integer="$1" if [ "${integer}" -eq "${integer}" ] 2>/dev/null then return 1; else return 0; fi } if [ -f ~/.defines ]; then . ~/.defines fi if [ -f ~/.aliases ]; then . ~/.aliases fi if [ -f ~/.functions ]; then . ~/.functions fi function fnPrompt { EXITSTATUS="$?" BOLD="\[\e[1m\]" RED="\[\e[1;31m\]" BLACK="\[\e[30;1m\]" GREEN="\[\e[32;1m\]" BLUE="\[\e[34;1m\]" YELLOW="\[\e[33;1m\]" WHITE="\[\e[37;1m\]" GRAY="\[\e[90;1m\]" OFF="\[\e[m\]" # 1. Define the non-printing title sequence inside the function TITLE_PROMPT='\[\e]0;\u@\h:\w\a\]' # Define or just use the string directly # 2. Define the visible part of the prompt PROMPT="${GRAY}#] ${RED}\u${GRAY}@${YELLOW}\h${GRAY}:${BLUE}\w ${WHITE}\t" # 3. Inject TITLE_PROMPT right before the PROMPT variable in the PS1 assignment if [ "${EXITSTATUS}" -eq 0 ] then PS1="${TITLE_PROMPT}${PROMPT} ${GREEN}0 ${GRAY}[#${OFF} " else PS1="${TITLE_PROMPT}${PROMPT} ${RED}1 ${GRAY}[#${OFF} " fi PS2="${BOLD}>${OFF} " } PROMPT_COMMAND=fnPrompt # PROMPT_COMMAND runs just milliseconds before your prompt appears #] kemiko@box:~ 00:39:59 0 [#
#] kemiko@box:/usr/local/bin 12:56:56 0 [# cat .aliases # .aliases; 2024/06/17; Kent M Kohlmeyer (kemiko) alias cp='cp -i' alias mv='mv -i' alias rm='rm -i' alias ls='ls -latr' alias grep='grep -Iind skip' alias www-data="chown -R www-data:www-data ." alias swpls='ls -latr .*.sw?' alias swpfnd='find . -name ".*.sw?"' alias backup='/usr/local/bin/backup.sh' alias du='du -h --max-depth=1 . | sort -h' alias job='fnJob' alias tsls='ls -l --time-style=+%Y-%m-%d@%H:%M' alias tssort='sort -k6,6' # tsls | tssort alias free='/usr/local/bin/free.sh' alias topc="top -o COMMAND" # sort by field "%COMMAND"...if already in top press 'C' alias topm="top -o %MEM" # sort by field "%MEM"...if already in top press 'M' alias topp="top -o %CPU" # sort by field "%CPU"...if already in top press 'P' alias topu="top -o USER" # sort by field "%USER"...if already in top press 'U' alias less='/usr/bin/less -SX' # --chop-long-lines, --no-init alias gdb='gdb -q' # -quiet #] kemiko@box:/usr/local/bin 12:56:57 0 [#
#] kemiko@box:/usr/local/bin 22:39:27 0 [# cat .defines # .defines; 2024/06/17; Kent M Kohlmeyer (kemiko) BOLD="\e[1m" BASE="\e[0m" BLK="\e[30;1m" RED="\e[31;1m" GRN="\e[32;1m" YLW="\e[33;1m" BLU="\e[34;1m" WHT="\e[37;1m" GRY="\e[90;1m" #] kemiko@box:/usr/local/bin 22:39:28 0 [#
#] kemiko@box:/usr/local/bin 11:22:03 0 [# cat .functions # .functions; 2024/06/17; Kent M Kohlmeyer (kemiko) fnFileExtension( ) { BASENAME=$(basename ${1}) echo ${BASENAME##*.} } fnFileBasename( ) { basename=$(basename ${1}) extension=$(fnFileExtension $basename) echo $basename | awk -F".$(echo $extension)" '{print $1}' } fnDate( ) { date +%Y%m%d } fnDateLog( ) { date +%Y-%m-%d } fnTime( ) { date +%H%M%S } fnTimeLog( ) { date +%H:%M:%S } fnAbsoluteValue( ) { if [ "${1}" -eq "${1}" ] 2>/dev/null then [ ${1} -lt 0 ] && echo $((-${1})) || echo ${1} fi } function fnPrompt { # In your initialization file (.bashrc) source this function and add "PROMPT_COMMAND=fnPrompt" EXITSTATUS="$?" BOLD="\[\e[1m\]" RED="\[\e[1;31m\]" BLACK="\[\e[30;1m\]" GREEN="\[\e[32;1m\]" BLUE="\[\e[34;1m\]" YELLOW="\[\e[33;1m\]" WHITE="\[\e[37;1m\]" GRAY="\[\e[90;1m\]" OFF="\[\e[0m\]" PROMPT="${GRAY}#] ${RED}\u${GRAY}@${YELLOW}\h${GRAY}:${BLUE}\w ${WHITE}\t" if [ "${EXITSTATUS}" -eq 0 ] then PS1="${PROMPT} ${GREEN}0 ${GRAY}[#${OFF} " else PS1="${PROMPT} ${RED}1 ${GRAY}[#${OFF} " fi PS2="${BOLD}>${OFF} " export PS1 PS2 } function fnJob( ) { # Awesome function for bringing a background job, by name NOT number, to the foreground... # I couldn't use an alias (issues with pipes, etc) or shell script ("jobs" command doesn't work) # An argument, jobs command string, must be entered..."-/+" work like with the "fg" command # The first "match" will be brought to the foreground # If there isn't a "match" in the background the argument entered will be opened with "vi" if [ ${#} -eq 0 ] then # Can't use the standard shell script "${0}" to get the function name printf '\e[1mUsage: %s <filename>\n' "${FUNCNAME[0]}\e[0m" return 1 fi jobNumber=$(jobs | "grep" "${1}" | cut -d] -f1 | cut -c2- | head -n 1) fileName=$("ls" | "grep" "${1}" | head -n 1) if [ "${jobNumber}" != "" ] then fg "${jobNumber}" elif [ "${fileName}" != "" ] then eval vi "${fileName}" else eval vi "${1}" fi } function fnDecodeURL( ) { echo "$@" \ | sed -E 's/%([0-9a-fA-F]{2})/\\x\1/g;s/\+/ /g' } function fnEncodeURL( ) { # Conform RFC 3986 echo "$@" \ | sed \ -e 's/ /%20/g' \ -e 's/:/%3A/g' \ -e 's/,/%2C/g' \ -e 's/\?/%3F/g' \ -e 's/#/%23/g' \ -e 's/\[/%5B/g' \ -e 's/\]/%5D/g' \ -e 's/@/%40/g' \ -e 's/!/%21/g' \ -e 's/\$/%24/g' \ -e 's/&/%26/g' \ -e "s/'/%27/g" \ -e 's/(/%28/g' \ -e 's/)/%29/g' \ -e 's/\*/%2A/g' \ -e 's/\+/%2B/g' \ -e 's/,/%2C/g' \ -e 's/;/%3B/g' \ -e 's/=/%3D/g' } #] kemiko@box:/usr/local/bin 11:22:04 0 [#
#] kemiko@web:/usr/local/bin 18:52:28 0 [# cat termTitle.sh #!/bin/bash #set -x # termTitle.sh; 2025/10/11; Kent M Kohlmeyer (kemiko) # Initialize title parts title="" # Set options U="${USER:-$(whoami)}" H="${HOSTNAME:-$(hostname -s)}" P="${PWD:-$(pwd)}" T=$(tty) # Strip the leading "/dev/" using pure Bash expansion T=${T##/dev/} args=("$@") # Check if arguments are empty (no positional parameters passed) if [ ${#args[@]} -eq 0 ] # Use ${#args[@]} for robust array size check then # Assign the default options as SEPARATE array elements #args=("-h" "-t" "-p") # Instead set the default title as... title="${U}@${H}:${P}" echo title=$title echo -ne "\033]0;${title}\007" exit 0 fi # Print the arguments for debugging (using quotes for best practice) #echo "Arguments to process: ${args[@]}" # Loop through all elements of the array correctly for arg in "${args[@]}" do case "$arg" in -h|--host) title+="${H}:" ;; -p|--pwd) title+="${P}:" ;; -t|--tty) title+="${T}:" ;; -u|--user) title+="${U}:" ;; *) title+="$arg:" ;; esac done # Trim trailing colons title=$(echo "$title" | sed 's/:*$//') echo title=$title # Set terminal title echo -ne "\033]0;${title}\007" #] kemiko@web:/usr/local/bin 18:52:35 0 [#
#] root@web:/usr/local/bin 18:52:35 0 [# #] kemiko@box:/usr/local/bin 08:51:35 0 [# cat backup.sh #!/bin/bash #set -x # backup.sh; 2017/07/18; Kent M Kohlmeyer (kemiko) # source environment file(s) . /usr/local/bin/.defines > /dev/null 2>&1 . /usr/local/bin/.functions > /dev/null 2>&1 if [ ${#} -eq 0 ] then printf "\e[1;29mUsage: %s <file>\e[0m\n" "${0}" exit 1 fi if [ ! -s ${1} ] then printf "\e[1;29mFile \"${1}\" does not exist with size!\e[0m\n" exit 1 fi dir=".backup" date=$(fnDate) file=$(basename ${1}) if [ -s ${file} ] then if [ ! -d ${dir} ] then mkdir ${dir} chmod 750 ${dir} fi cp -ip ${file} ${dir}/${file}.${date} chmod 440 ${dir}/${file}.${date} fi #] kemiko@box:/usr/local/bin 08:51:36 0 [#
#] kemiko@box:/usr/local/bin 20:56:51 0 [# cat integerTest.sh #!/bin/bash # integerTest.sh; 2025/09/21; Kent M Kohlmeyer (kemiko) if [ -n "${1}" ] && [ "${1}" -eq "${1}" ] 2>/dev/null then echo number else echo not a number fi #] kemiko@box:/usr/local/bin 20:57:12 0 [#
#] kemiko@box:/usr/local/bin 20:30:25 0 [# cat lines.sh #!/bin/bash #set -x # lines.sh; 2024/06/15; Kent M Kohlmeyer (kemiko) # display range of lines from a file # source defines . /usr/local/bin/.defines > /dev/null 2>&1 if [ ${#} -lt 3 ] then printf "${BOLD}Usage: $(basename ${0}) <file> <start line> <stop line>${BASE}\n" exit 1 fi if [ ! -s ${1} ] then printf "${BOLD}\"${1}\" is not a regular file with size!${BASE}\n" exit 1 fi if [ "${2}" -eq "${2}" ] 2>/dev/null && [ "${3}" -eq "${3}" ] 2>/dev/null then : else printf "${BOLD}\"${2}\" (start) and/or \"${3}\" (stop) is not an integer${BASE}\n" exit 1 fi if [ ${2} -le 0 ] || [ ${3} -le 0 ] then printf "${BOLD}\"${2}\" (start) and/or \"${3}\" (stop) can't be zero/negative${BASE}\n" exit 1 fi if [ ${3} -gt $(wc -l ${1} | cut -d' ' -f1) ] then printf "${BOLD}\"${3}\" (stop) shouldn't be greater than the file line count of \"$(wc -l ${1} | cut -d' ' -f1)\"${BASE}\n" exit 1 fi if [ "${2}" -gt "${3}" ] 2>/dev/null then printf "${BOLD}\"${2}\" (start) can't be greater than \"${3}\" (stop)${BASE}\n" exit 1 fi head -n ${3} ${1} | tail -n $(expr ${3} - ${2} + 1) #] kemiko@box:/usr/local/bin 20:30:26 0 [#
#] kemiko@box:/usr/local/bin 08:57:18 0 [# cat free.sh #!/bin/bash #set -x # 2024-07-26; free.sh; Kent M Kohlmeyer (kemiko) # This script shows memory usage in... # bytes, kibibytes, mebibytes, or gibibytes # Add seconds argument to pause until... # <enter> is pressed # don't echo key presses to screen stty -echo # don't show cursor tput civis trap 'tput cnorm; stty echo; exit 1' 0 1 2 15 # set defaults size=m seconds=86400 if [ ${#} -eq 0 ] then printf "\e[1mUsage: %s <b|k|m|g> [seconds]\e[0m\n" "${0}" exit 1 fi if [ ${1} != b ] && [ ${1} != k ] && [ ${1} != m ] && [ ${1} != g ] then printf "\e[1mArgument one, \"${1}\", is not \"b|k|m|g\"\e[0m\n" exit 1 else size=${1} fi # test if argument two is set if [ -z ${2+x} ] then : else # test if argument two is an integer if [ "${2}" -eq "${2}" ] 2>/dev/null then seconds=${2} else printf "\e[1mArgument two, \"${2}\", is not an integer\e[0m\n" exit 1 fi fi clear while [ 1 ] do printf "\e[1m%s\e[0m\n" "$(date '+%Y-%m-%d @ %H:%M:%S (%A)')" free -w${size} read -t ${seconds} done #] kemiko@box:/usr/local/bin 08:57:19 0 [#
#] kemiko@box:/tmp 23:47:18 0 [# cat glibc.c #include <stdio.h> #include <gnu/libc-version.h> int main( void ) { puts( gnu_get_libc_version ( ) ); return 0; } #] kemiko@box:/tmp 23:47:19 0 [#
#] kemiko@box:/usr/local/bin 09:13:01 0 [# cat highlight.sh #!/bin/bash #set -x # 2025-01-06; highlight.sh; Kent M Kohlmeyer (kemiko) # This script highlights pattern(s) in file(s) if [ ${#} -eq 0 ] then printf "\e[1mUsage: %s <regex> <file(s)>\e[0m\n" "${0}" exit 1 fi init=0 filesValid="" filesError="" errors=0 for file in "${@}" do echo file: ${file} if [ ${init} -eq 0 ] then init=1 else if [ -f ${file} ] then filesValid=$(printf "%s %s" "${filesValid}" "${file}") else errors=$(expr ${errors} + 1) filesError=$(printf "%s \"%s\"" "${filesError}" "${file}") fi fi done if [ ${errors} -gt 0 ] then printf "\e[1mError: %s file(s) are not valid...%s\e[0m\n" "${errors}" "${filesError}" exit ${errors} fi "egrep" -iIn --color=auto "${1}|$" ${filesValid} /dev/null exit 0 #] kemiko@box:/usr/local/bin 09:13:02 0 [#
#] root@web:/usr/local/bin 17:55:52 0 [# cat commentsRemoveWebPage.sh #!/bin/bash #set -x # 2024-11-23; commentsRemoveWebPage.sh; Kent M Kohlmeyer (kemiko) # Removes HTML and CStyle (JavaScript) comments # If running a large file this will take a lot of "time" # Usage: [time] cat <input file> | commentsRemoveWebPage.sh > <output file> scriptHead=0 scriptTail=0 commentSingle=0 commentMultiHead=0 commentMultiTail=0 commentHTMLHead=0 commentHTMLTail=0 if [ -t 0 ] then printf "\e[1mPlease supply stdin\e[0m\n" exit 1 fi # Setting "IFS='' (Field Splitting) prevents readline from # stripping leading and trailing whitespace from the line. # Use "read -r" to not interpret a backslash (\) character while IFS='' read -r line do echo "${line}" | "grep" '<script>' > /dev/null 2>&1 if [ ${?} -eq 0 ] then scriptHead=1 fi echo "${line}" | "grep" '</script>' > /dev/null 2>&1 if [ ${?} -eq 0 ] then scriptTail=1 fi if [ ${scriptHead} -eq 1 ] && [ ${scriptTail} -eq 1 ] then echo "${line}" scriptHead=0 scriptTail=0 elif [ ${scriptHead} -eq 1 ] then if [ ${#line} -eq 0 ] then echo "${line}" else echo "${line}" | "grep" '\/\*' > /dev/null 2>&1 if [ ${?} -eq 0 ] then commentMultiHead=$(expr ${commentMultiHead} + 1) fi echo "${line}" | "grep" '\*\/' > /dev/null 2>&1 if [ ${?} -eq 0 ] then commentMultiTail=1 fi if [ ${commentMultiHead} -eq 1 ] && [ ${commentMultiTail} -eq 1 ] then output=$(echo "${line}" | sed 's; *\/\*.*\*\/ *;;') if [ ${#output} -ne 0 ] then echo "${output}" fi commentMultiHead=0 commentMultiTail=0 elif [ ${commentMultiTail} -eq 1 ] then output=$(echo "${line}" | sed 's;.*\*\/ *;;') if [ ${#output} -ne 0 ] then echo "${output}" fi commentMultiHead=0 commentMultiTail=0 elif [ ${commentMultiHead} -ge 1 ] then if [ ${commentMultiHead} -eq 1 ] then output=$(echo "${line}" | sed 's; *\/\*.*;;') if [ ${#output} -ne 0 ] then echo "${output}" fi fi commentMultiHead=$(expr ${commentMultiHead} + 1) else commentSingle=0 echo ${line} | "grep" '\/\/' > /dev/null 2>&1 if [ ${?} -eq 0 ] then commentSingle=1 fi url=0 echo ${line} | "grep" ':\/\/' > /dev/null 2>&1 if [ ${?} -eq 0 ] then url=1 fi if [ ${commentSingle} -eq 1 ] && [ ${url} -ne 1 ] then output=$(echo "${line}" | sed 's; *\/\/.*;;') if [ ${#output} -ne 0 ] then echo "${output}" fi else echo "${line}" fi fi fi elif [ ${scriptTail} -eq 1 ] then echo "${line}" scriptHead=0 scriptTail=0 else echo "${line}" | "grep" '<!--' > /dev/null 2>&1 if [ ${?} -eq 0 ] then commentHTMLHead=$(expr ${commentHTMLHead} + 1) fi echo "${line}" | "grep" '\-\->' > /dev/null 2>&1 if [ ${?} -eq 0 ] then commentHTMLTail=1 fi if [ ${commentHTMLHead} -eq 1 ] && [ ${commentHTMLTail} -eq 1 ] then output=$(echo "${line}" | sed 's/ *<!--.*--> *//') if [ ${#output} -ne 0 ] then echo "${output}" fi commentHTMLHead=0 commentHTMLTail=0 elif [ ${commentHTMLTail} -eq 1 ] then output=$(echo "${line}" | sed 's/.*--> *//') if [ ${#output} -ne 0 ] then echo "${output}" fi commentHTMLHead=0 commentHTMLTail=0 elif [ ${commentHTMLHead} -ge 1 ] then if [ ${commentHTMLHead} -eq 1 ] then output=$(echo "${line}" | sed 's/ *<!--.*//') if [ ${#output} -ne 0 ] then echo "${output}" fi fi commentHTMLHead=$(expr ${commentHTMLHead} + 1) else echo "${line}" fi fi done #] root@web:/usr/local/bin 17:55:53 0 [#
#] root@web:/usr/local/bin 23:36:25 0 [# cat swap1Backup.sh #!/bin/bash # swap1Backup.sh; 2024/09/15; Kent M Kohlmeyer (kemiko) # backup all vi swap files with "backup.sh" script ls .*sw? | cut -c2- | awk -F'.sw' '{print $1}' | while read file do /usr/local/bin/backup.sh ${file} < /dev/tty done #] root@web:/usr/local/bin 23:36:29 0 [# cat swap2Recover.sh #!/bin/bash # swap2Recover.sh; 2024/09/15; Kent M Kohlmeyer (kemiko) # recover vi files with command switches ls .*sw? | cut -c2- | awk -F'.sw' '{print $1}' | while read file do echo ${file} vi -X -r ${file} -c "w!" -c "q!" < /dev/tty &&> /dev/null done #] root@web:/usr/local/bin 23:36:33 0 [# cat swap3Diff.sh #!/bin/bash # swap3Diff.sh; 2024/09/15; Kent M Kohlmeyer (kemiko) # diff command all vi recovered files # | grep "^<" or "^>" for viewing old vs new sparately date=$(date +%Y%m%d) ls .*sw? | cut -c2- | awk -F'.sw' '{print $1}' | while read file do echo ${file} diff .backup/${file}.${date} ${file} done #] root@web:/usr/local/bin 23:36:36 0 [# cat swap4Remove.sh #!/bin/bash # swap4Remove.sh; 2024/09/15; Kent M Kohlmeyer (kemiko) if [[ ${#} -eq 0 || (${1} != 'y' && ${1} != 'Y' && ${1} != 'n' && ${1} != 'N') ]] then printf "\e[1mUsage: ${0}("y" = prompt, "n" = no prompt)\e[0m\n" exit 1 fi ls .*sw? | while read file do if [[ ${1} == 'y' || ${1} == 'Y' ]] then rm -i ${file} < /dev/tty else \rm ${file} fi done #] root@web:/var/www/html/us/kemiko/notes/bin 23:36:41 0 [#
#] kemiko@box:~/src 19:42:47 0 [# cat itop.ec #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> static char SourceID[] = "itop.ec; 2016/12/03; Kent M Kohlmeyer"; /* This program displays the top processes the Informix engine is currently running. To "make" the executable with debugging symbols or not esql -G itop.ec -o itop OR esql itop.ec -o itop To Do: 1) catch SIGINT ctrl-c...fclose( fp ); AND pin( cursor, 0 ); #include <signal.h> static volatile int keepRunning = 1; void intHandler(int dummy) { keepRunning = 0; } // ... int main(void) { signal(SIGINT, intHandler); while (keepRunning) { // ... 2) Take argv[0] out of the output */ #define pin( row, col ) printf( "%c[%d;%dH", 27, ( row ), ( col ) ) #define SIDRECS 30 #define PIDRECS 1500 struct recordsid { int sid; int pid; char hostname[16+1]; char username[32+1]; char connected[25+1]; int ops; }; struct recordpid { int pid; int ppid; char command[64+1]; }; int compare( const void *a, const void *b ) { struct recordsid *orderA = (struct recordsid *)a; struct recordsid *orderB = (struct recordsid *)b; if( orderA->ops < orderB->ops ) { return 1; } else if( orderA->ops > orderB->ops ) { return -1; } else { return 0; } } int clear( int line ) { printf( "%c[%d;%df", 27, line, 0 ); printf( "%c[0J", 27 ); } void rtrim( char *string ) { int i; for( i = strlen( string ) - 1; i > 0; i-- ) { if( string[i] == ' ' ) { string[i] = '\0'; } else { break; } } } void lpad( char *string, int width ) { int i; int j; char buffer[15+1] = ""; strcpy( buffer, string ); for( i = 0; i < width - strlen( buffer ); i++ ) { string[i] = ' '; } for( j = 0; j < width - i; j++ ) { string[i+j] = buffer[j]; } string[j+i] = '\0'; } int main( int argc, char **argv ) { /* struct recordpid { int pid; int ppid; char command[64+1]; }; */ struct recordsid sidold[SIDRECS]; struct recordsid sidnew[SIDRECS]; struct recordsid siddelta[SIDRECS]; struct recordpid pidrec[PIDRECS]; memset( &sidold, '\0', sizeof( sidold ) ); memset( &sidnew, '\0', sizeof( sidnew ) ); memset( &siddelta, '\0', sizeof( siddelta ) ); EXEC SQL BEGIN DECLARE SECTION; int sid; int pid; char hostname[15]; char username[15]; char connected[25]; int ops; EXEC SQL END DECLARE SECTION; int i; int j; int k; int display; char line[128+1]; int looppid = 1; int loopppid = 1; //EXEC SQL END DECLARE SECTION; int argr = 15; int args = 5; //int argt = 0; int argb = 0; char system[16+1]; FILE *fp; char batch[64+1]; int loopmain = 0; int iops = 0; time_t seconds; struct tm *datetime; char datesystem[20]; int cursor = 0; int foundpid = 0; int foundppid = 0; sprintf( system, "%s", getenv( "SYSTEM_NAME" ) ); for( i = 1; i < argc; i++ ) { if( strstr( argv[i], "-h" ) ) { printf( "%c[1m", 27 ); printf( "\nUsage: %s -[hrs]\n\n", argv[0] ); printf( "-h ...help\n" ); printf( "-rX ...records to display (default is 15)\n" ); /* printf( "-s ....display SQL\n" ); */ printf( "-sX ...seconds to refresh (default is 5)\n\n" ); printf( "-b ...batch mode\n\n" ); printf( "%c[0m", 27 ); exit( 1 ); } if( strstr( argv[i], "-r" ) ) { sscanf( argv[i] + 2, "%d", &argr ); if( argr <= 0 || argr > 30 ) { argr = 30; } } /* if( strstr( argv[i], "-t" ) ) { argt = 1; } */ if( strstr( argv[i], "-s" ) ) { sscanf( argv[i] + 2, "%d", &args ); if( args < 0 || args > 60 ) { args = 5; } } if( strstr( argv[i], "-b" ) ) { sscanf( argv[i] + 2, "%d", &argb ); if( argb < 0 || argb > 60 ) { argb = 5; } } } if( argb ) { sprintf( batch, "%s.log", argv[0] ); if( (fp = fopen( batch, "w" )) == NULL ) { printf( "Can not open file %s\n", batch ); exit( 1 ); } /* else { fprintf( stdout, "HELLO" ); fflush( stdout ); } */ } else { clear( 0 ); } for( ; ; ) { memset( &sidnew, '\0', sizeof( sidnew ) ); cursor = 2; EXEC SQL WHENEVER SQLERROR STOP; EXEC SQL CONNECT to 'sysmaster'; EXEC SQL declare sysmastercursor cursor for SELECT FIRST 30 s.sid, pid, trim(hostname), trim(username), dbinfo('utc_to_datetime',connected), isreads+bufreads+bufwrites+pagreads+pagwrites INTO :sid, :pid, :hostname, :username, :connected, :ops FROM syssessions s, syssesprof p WHERE s.sid = p.sid ORDER BY 6 DESC; EXEC SQL open sysmastercursor; memset( &pidrec, '\0', sizeof( pidrec ) ); FILE *ps = popen( "ps -ef", "r" ); for( i = 0; fgets( line, sizeof( line ), ps ) != 0; i++ ) { if( i > 0 ) { pidrec[i].pid = atoi( &line[9] ); pidrec[i].ppid = atoi( &line[15] ); strcpy( pidrec[i].command, &line[48] ); } } pclose( ps ); for( i = 0; i < SIDRECS; i++ ) { EXEC SQL fetch sysmastercursor; if( strncmp( SQLSTATE, "00", 2 ) != 0 ) { break; } sidnew[i].sid = sid; sidnew[i].pid = pid; memcpy( &sidnew[i].hostname, &hostname, strlen( hostname ) + 1 ); memcpy( &sidnew[i].username, &username, strlen( username ) + 1 ); memcpy( &sidnew[i].connected, &connected, strlen( connected ) + 1 ); sidnew[i].ops = ops; } EXEC SQL close sysmastercursor; EXEC SQL free sysmastercursor; EXEC SQL disconnect current; memcpy( &siddelta, &sidnew, sizeof( struct recordsid ) * SIDRECS ); for( i = 0; i < SIDRECS; i++ ) { for( j = 0; j < SIDRECS; j++ ) { if( siddelta[i].sid == sidold[j].sid ) { siddelta[i].ops -= sidold[j].ops; /* This causes some rows to be off between hostname and username siddelta[i].hostname[10] = '\0'; siddelta[i].username[10] = '\0'; siddelta[i].connected[19] = '\0'; changed later before output */ } } } qsort( siddelta, SIDRECS, sizeof( struct recordsid ), compare ); if( !argb ) { clear( 2 ); //printf( "Host: %-29sDate: %-41sIops: %10d\n", system, "2016-12-19 20:01:14", iops ); printf( "\n" ); cursor++; } /* Output the records to screen or file */ for( i = 0, iops = 0; i < argr; i++ ) { if( siddelta[i].ops ) { if( strstr( siddelta[i].hostname, system ) ) { rtrim( siddelta[i].username ); lpad( siddelta[i].username, 12 ); rtrim( siddelta[i].hostname ); rtrim( siddelta[i].connected ); if( !argb ) { printf( "%c[1m%8d %7d%s@%-10s %22s %35d%c[0m\n",27,siddelta[i].sid,siddelta[i].pid,siddelta[i].username,siddelta[i].hostname,siddelta[i].connected,siddelta[i].ops,27 ); cursor += 2; } else { fprintf( fp, "%8d %7d%s@%-10s %22s %35d\n",siddelta[i].sid,siddelta[i].pid,siddelta[i].username,siddelta[i].hostname,siddelta[i].connected,siddelta[i].ops ); } /* find and print first parent */ for( j = 0, foundpid = 0, foundppid = 0, looppid = 1; j < PIDRECS && looppid == 1; j++ ) { if( siddelta[i].pid == pidrec[j].pid ) { foundpid = 1; if( !argb ) { printf( " %7d %7d %s", pidrec[j].pid, pidrec[j].ppid, pidrec[j].command ); cursor++; } else { fprintf( fp, " %7d %7d %s", pidrec[j].pid, pidrec[j].ppid, pidrec[j].command ); } /* find and print second parent */ for( k = 0, loopppid = 1; k < PIDRECS && loopppid == 1; k++ ) { if( pidrec[j].ppid == pidrec[k].pid ) { foundppid = 1; if( !argb ) { printf( " %7d %7d %s\n", pidrec[k].pid, pidrec[k].ppid, pidrec[k].command ); cursor++; } else { fprintf( fp, " %7d %7d %s\n", pidrec[k].pid, pidrec[k].ppid, pidrec[k].command ); } loopppid = 0; } } looppid = 0; } } if( !foundpid ) { if( !argb ) { printf( "\n\n" ); cursor++; } else { fprintf( fp, "\n\n" ); } } if( !foundppid ) { if( !argb ) { printf( "\n" ); cursor++; } else { fprintf( fp, "\n" ); } } } else // isn't going to have local PPIDs { rtrim( siddelta[i].username ); lpad( siddelta[i].username, 12 ); rtrim( siddelta[i].hostname ); rtrim( siddelta[i].connected ); if( !argb ) { printf( "%c[1m%8d %7d%s@%-10s %22s %35d%c[0m\n\n\n\n",27,siddelta[i].sid,siddelta[i].pid,siddelta[i].username,siddelta[i].hostname,siddelta[i].connected,siddelta[i].ops,27 ); cursor += 4; } else { fprintf( fp, "%8d %7d%s@%-10s %22s %35d\n\n\n\n",siddelta[i].sid,siddelta[i].pid,siddelta[i].username,siddelta[i].hostname,siddelta[i].connected,siddelta[i].ops ); } } iops += siddelta[i].ops; } else // make the screen and file fixed length { if( !argb ) { printf( "\n\n\n\n" ); cursor += 4; } else { fprintf( fp, "\n\n\n\n" ); } } } memcpy( &sidold, &sidnew, sizeof( struct recordsid ) * SIDRECS ); /* loopmain++; if( argb == loopmain ) { fclose( fp ); return( 0 ); } */ // printf( "Host: %-29sDate: %-41sIops: %10d\n", system, "2016-12-19 20:01:14", iops ); seconds = time( 0 ); datetime = localtime( &seconds ); sprintf( datesystem, "%04d-%02d-%02d %02d:%02d:%02d", datetime->tm_year + 1900, datetime->tm_mon + 1, datetime->tm_mday, datetime->tm_hour, datetime->tm_min, datetime->tm_sec ); //clear( ); if( argb ) { //chg fprintf( fp, "Host: %-29sDate: %-41sLoad: %10d\n", system, datesystem, iops ); fprintf( fp, "Host: %-31sDate: %-39sLoad: %10d\n", system, datesystem, iops ); fprintf( fp, "--------------------------------------------------------------------------------------------------\n" ); fflush( fp ); } else { pin( 0, 0 ); //chg fprintf( stdout, "Host: %-29sDate: %-42sLoad: %9d\n", system, datesystem, iops ); fprintf( stdout, "Host: %-31sDate: %-39sLoad: %10d\n", system, datesystem, iops ); pin( cursor, 0 ); fflush( stdout ); } loopmain++; if( argb == loopmain ) { fclose( fp ); return( 0 ); } sleep( args ); } } #] kemiko@box:~/src 19:42:51 0 [#
Alpha and Omega Semiconductor Limited, or AOS, is a designer, developer and global supplier of a broad range of power semiconductors, including a wide portfolio of Power MOSFET, IGBT and Power IC products. AOS has developed extensive intellectual property and technical knowledge that encompasses the latest advancements in the power semiconductor industry, which enables it to introduce innovative products to address the increasingly complex power requirements of advanced electronics. AOS differentiates itself by integrating its Discrete and IC semiconductor process technology, product design, and advanced packaging know-how to develop high performance power management solutions. AOS's portfolio of products targets high-volume applications, including portable computers, flat panel TVs, LED lighting, smart phones, battery packs, consumer and industrial motor controls and power supplies for TVs, computers, servers and telecommunications equipment. For more information, please visit www.aosmd.com. For investor relations, please contact So-Yeon Jeong at investors@aosmd.com.
CONTACT: Alpha and Omega Semiconductor Limited Investor Relations So-Yeon Jeong 408-789-3172 investors@aosmd.com
1. Filter for interactive SSH logins bash> grep sshd.\*Failed /var/log/auth.log | less 2. Filter for failed connections (i.e. no login attempted, could be a port scanner, etc) bash> grep sshd.\*Did /var/log/auth.log | less
![]() |
;)u | winky tongue |
![]() |
^^)u | silly tongue |
![]() |
;3* | kissy |
![]() |
(bb) | bear (brown) ... pairs well with "huggy" |
![]() |
(bp) | bear (panda) ... pairs well with "huggy" |
![]() |
(^^8)) | huggy |
![]() |
**^o^ | heart eyes |
![]() |
:(? | thought |
![]() |
:'( | sad |
![]() |
:8^v^ | embarrassed |
![]() |
^^8) | blush |
![]() |
:8| | rolling eyes |
![]() |
'><8 | very upset |
![]() |
^^)*** | three hearts (kisses) on face |
--shows base table information SELECT * FROM pg_catalog.pg_tables --WHERE -- tableowner = current_user --WHERE -- schemaname NOT IN ('public','pg_catalog','information_schema') --WHERE -- schemaname IN ('public','pg_catalog','information_schema') --ORDER BY -- schemaname DESC, tablename ; ┌────────────────────┬─────────────────────────┬────────────┬────────────┬────────────┬──────────┬─────────────┬─────────────┐ │ schemaname │ tablename │ tableowner │ tablespace │ hasindexes │ hasrules │ hastriggers │ rowsecurity │ ├────────────────────┼─────────────────────────┼────────────┼────────────┼────────────┼──────────┼─────────────┼─────────────┤ │ ... │ ... │ ... │ (NULL) │ t │ f │ f │ f │ │ public │ exampleTable │ dba │ (NULL) │ t │ f │ f │ f │ │ pg_catalog │ pg_aggregate │ postgres │ (NULL) │ t │ f │ f │ f │ │ ... │ ... │ ... │ (NULL) │ t │ f │ f │ f │ │ information_schema │ sql_features │ postgres │ (NULL) │ f │ f │ f │ f │ │ ... │ ... │ ... │ (NULL) │ t │ f │ f │ f │ └────────────────────┴─────────────────────────┴────────────┴────────────┴────────────┴──────────┴─────────────┴─────────────┘ (999 rows)
--shows "table catalog" and "table type", but not "table owner" compared to previous query SELECT * FROM information_schema.tables --WHERE -- table_schema = 'public' --WHERE -- table_schema NOT IN ('public','pg_catalog','information_schema') --WHERE -- table_schema IN ('public','pg_catalog','information_schema') ORDER BY table_schema DESC, table_name ; ┌────────────────┬────────────────────┬───────────────────────────────────────┬────────────┬──────────────────────────────┬──────────────────────┬───────────────────────────┬──────────────────────────┬────────────────────────┬────────────────────┬──────────┬───────────────┐ │ table_catalog │ table_schema │ table_name │ table_type │ self_referencing_column_name │ reference_generation │ user_defined_type_catalog │ user_defined_type_schema │ user_defined_type_name │ is_insertable_into │ is_typed │ commit_action │ ├────────────────┼────────────────────┼───────────────────────────────────────┼────────────┼──────────────────────────────┼──────────────────────┼───────────────────────────┼──────────────────────────┼────────────────────────┼────────────────────┼──────────┼───────────────┤ │ exampleCatalog │ public │ exampleTable │ BASE TABLE │ (NULL) │ (NULL) │ (NULL) │ (NULL) │ (NULL) │ YES │ NO │ (NULL) │ │ ... │ ... │ ... │ BASE TABLE │ (NULL) │ (NULL) │ (NULL) │ (NULL) │ (NULL) │ YES │ NO │ (NULL) │ │ ... │ pg_catalog │ pg_aggregate │ BASE TABLE │ (NULL) │ (NULL) │ (NULL) │ (NULL) │ (NULL) │ YES │ NO │ (NULL) │ │ ... │ information_schema │ administrable_role_authorizations │ VIEW │ (NULL) │ (NULL) │ (NULL) │ (NULL) │ (NULL) │ NO │ NO │ (NULL) │ │ ... │ ... │ ... │ BASE TABLE │ (NULL) │ (NULL) │ (NULL) │ (NULL) │ (NULL) │ YES │ NO │ (NULL) │ └────────────────┴────────────────────┴───────────────────────────────────────┴────────────┴──────────────────────────────┴──────────────────────┴───────────────────────────┴──────────────────────────┴────────────────────────┴────────────────────┴──────────┴───────────────┘ (999 rows)
CREATE VIEW tables AS SELECT table_catalog, table_schema, table_name, table_type FROM information_schema.tables WHERE table_schema NOT IN ('pg_catalog', 'information_schema') ;
SELECT * FROM tables ; ┌────────────────┬───────────────┬──────────────────┬─────────────┐ │ table_catalog │ table_schema │ table_name │ table_type │ ├────────────────┼───────────────┼──────────────────┼─────────────┤ │ exampleCatalog │ exampleSchema │ exampletable │ exampleType │ │ ... │ ... │ ... │ ... │ │ postgres │ public │ tables │ VIEW │ └────────────────┴───────────────┴──────────────────┴─────────────┘ (999 rows)
CREATE VIEW objects AS SELECT nsp.nspname AS SchemaName ,cls.relname AS ObjectName ,rol.rolname AS ObjectOwner ,CASE cls.relkind WHEN 'r' THEN 'TABLE' WHEN 'm' THEN 'MATERIALIZED_VIEW' WHEN 'i' THEN 'INDEX' WHEN 'S' THEN 'SEQUENCE' WHEN 'v' THEN 'VIEW' WHEN 'c' THEN 'TYPE' ELSE cls.relkind::text END AS ObjectType FROM pg_class cls JOIN pg_roles rol ON rol.oid = cls.relowner JOIN pg_namespace nsp ON nsp.oid = cls.relnamespace WHERE nsp.nspname NOT IN ('information_schema', 'pg_catalog') AND nsp.nspname NOT LIKE 'pg_toast%' ORDER BY nsp.nspname, cls.relname ;
--shows non system objects owned by current user SELECT nsp.nspname AS object_schema, cls.relname AS object_name, CASE cls.relkind WHEN 'r' THEN 'table' WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index' WHEN 'S' THEN 'sequence' WHEN 'v' THEN 'view' WHEN 'c' THEN 'type' ELSE cls.relkind::text END AS object_type, rol.rolname AS object_owner FROM pg_class cls JOIN pg_roles rol ON rol.oid = cls.relowner JOIN pg_namespace nsp ON nsp.oid = cls.relnamespace WHERE nsp.nspname NOT IN ('information_schema', 'pg_catalog') AND nsp.nspname NOT LIKE 'pg_toast%' AND rol.rolname = current_user ORDER BY nsp.nspname, cls.relname ; ┌───────────────┬─────────────────────┬─────────────┬──────────────┐ │ object_schema │ object_name │ object_type │ object_owner │ ├───────────────┼─────────────────────┼─────────────┼──────────────┤ │ public │ tables │ view │ postgres │ │ ... │ ... │ ... │ ... │ │ exampleSchema │ example │ table │ dba │ │ exampleSchema │ example_id_seq │ sequence │ dba │ │ exampleSchema │ example_pkey │ index │ dba │ └───────────────┴─────────────────────┴─────────────┴──────────────┘ (XXX rows)
SELECT r.usename AS grantor, e.usename AS grantee, nspname, privilege_type, is_grantable FROM pg_namespace JOIN LATERAL (SELECT * FROM aclexplode(nspacl) AS x) a ON true JOIN pg_user e ON a.grantee = e.usesysid JOIN pg_user r ON a.grantor = r.usesysid WHERE e.usename = current_user ; ┌──────────┬──────────┬────────────────────┬────────────────┬──────────────┐ │ grantor │ grantee │ nspname │ privilege_type │ is_grantable │ ├──────────┼──────────┼────────────────────┼────────────────┼──────────────┤ │ postgres │ postgres │ pg_catalog │ USAGE │ f │ │ postgres │ postgres │ pg_catalog │ CREATE │ f │ │ postgres │ postgres │ public │ USAGE │ f │ │ postgres │ postgres │ public │ CREATE │ f │ │ postgres │ postgres │ information_schema │ USAGE │ f │ │ postgres │ postgres │ information_schema │ CREATE │ f │ └──────────┴──────────┴────────────────────┴────────────────┴──────────────┘ (6 rows)
SELECT * FROM pg_stat_activity ; ┌───────┬───────────┬───────┬──────────┬──────────┬──────────────────┬─────────────┬─────────────────┬─────────────┬───────────────────────────────┬───────────────────────────────┬───────────────────────────────┬───────────────────────────────┬─────────┬────────┬─────────────┬──────────────┬─────────────────────────────────────────────────────────────────────────────┐ │ datid │ datname │ pid │ usesysid │ usename │ application_name │ client_addr │ client_hostname │ client_port │ backend_start │ xact_start │ query_start │ state_change │ waiting │ state │ backend_xid │ backend_xmin │ query │ ├───────┼───────────┼───────┼──────────┼──────────┼──────────────────┼─────────────┼─────────────────┼─────────────┼───────────────────────────────┼───────────────────────────────┼───────────────────────────────┼───────────────────────────────┼─────────┼────────┼─────────────┼──────────────┼─────────────────────────────────────────────────────────────────────────────┤ │ 12411 │ postgres │ 16459 │ 24655 │ dba │ psql │ 127.0.0.1 │ (NULL) │ 49568 │ 2024-11-28 13:39:41.091595-08 │ 2024-12-01 20:09:47.198842-08 │ 2024-12-01 20:09:47.198842-08 │ 2024-12-01 20:09:47.198847-08 │ f │ active │ (NULL) │ 4838 │ SELECT * FROM pg_stat_activity; │ │ 12411 │ postgres │ 23698 │ 10 │ postgres │ psql │ (NULL) │ (NULL) │ -1 │ 2024-11-30 11:51:07.192089-08 │ (NULL) │ 2024-11-30 11:51:58.141689-08 │ 2024-11-30 11:51:58.156049-08 │ f │ idle │ (NULL) │ (NULL) │ select table_name, ↵│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ table_schema as schema_name, ↵│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ pg_database_size(current_database()) as total_database_size, ↵│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ pg_total_relation_size(table_name) as total_table_size, ↵│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ pg_relation_size(table_name) as table_size, ↵│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ pg_indexes_size(table_name) as index_size ↵│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ from information_schema.tables ↵│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ where table_schema=current_schema() and table_name like 'table_%'↵│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ order by total_table_size; │ │ ... │ ... │ ..... │ ..... │ ........ │ .... │ ......... │ ......... │ ..... │ ............................. │ ............................. │ ............................. │ ............................. │ . │ ...... │ ...... │ ...... │ ...... │ │ 24732 │ xxxxxxx │ 1015 │ 10 │ postgres │ psql │ (NULL) │ (NULL) │ -1 │ 2024-11-27 20:21:49.750157-08 │ (NULL) │ 2024-11-27 20:21:58.891633-08 │ 2024-11-27 20:21:58.900124-08 │ f │ idle │ (NULL) │ (NULL) │ select * from xxx.ledger; │ └───────┴───────────┴───────┴──────────┴──────────┴──────────────────┴─────────────┴─────────────────┴─────────────┴───────────────────────────────┴───────────────────────────────┴───────────────────────────────┴───────────────────────────────┴─────────┴────────┴─────────────┴──────────────┴─────────────────────────────────────────────────────────────────────────────┘ (XXX rows)
SELECT pg_terminate_backend( pid );
"Debugging with GDB - Summary of GDB" - web.mit.edu/gnu/doc/html/gdb_1.html ... "Debugging with GDB - Summary of GDB" - web.mit.edu/gnu/doc/html/gdb_25.html ~~~ #] kemiko@box:~ 19:32:56 0 [# cat ~/.gdbinit # shit can be shortened...like "i b" is really "info breakpoints"... # which shows all breakpoints, etc # use tab completion # type ctrl-alt-j to toggle-editing-mode between Emacs and Vi # type ctrl-l to clear the screen # b = set breakpoint at current line # b [file:]<line> if <variable> <comparison> <value> = breakpoint at a line # c = continue (executing code) # clear = delete all breakpoints # define = user defines...see below # d = disable (breakpoints) # disable [integer] = disable all/certain breakpoint(s) # enable [integer] = enable all/certain breakpoint(s) # f = frame (show stack frame) # finish = finish executing current function # h [command] = help # i = info # i b = info breakpoints # i h = info handle (signals table) # l [line] = list (code) current/certain line # n = next (execute one line) # p [item] = print content of variable, memory location, or register # q = quit (gdb) # r = run (program) to breakpoint or end # return [value] = return from a function without execution # show [command] = show environment or a certain type/item # show commands = command history # show user = user defines # !! = rerun last command # !<integer> = rerun certain command in history # watch <expression/variable> = watch an expression/variable # set prompt to bold "(gdb) " set prompt \033[1m(gdb) \033[0m set height 36 set listsize 36 set pagination 0 # <Tab> for suggestion/completion...even shows user defines # on|off set print array # on|off set print pretty set history filename ~/.gdbhist # on|off set history save # on|off set history expansion set history size 256 define clr shell clear end define pin shell printf "\033[%d;%dH" "$arg0" "$arg1" end
Transmission Medium | Bandwidth | Range | Notes |
---|---|---|---|
Twisted Pair (Copper) | Up to 10 Gbps (Cat6/Cat7) | ~100 m | Common for Ethernet LANs and DSL. Susceptible to EMI. Cat5e: 1 Gbps, Cat7: up to 40 Gbps. |
Coaxial Cable | Up to 1 Gbps | ~500 m–1 km | Used for cable TV and broadband. Less EMI than twisted pair, higher attenuation than fiber. |
Fiber Optics | 10–100+ Gbps | 550 m–100 km | High bandwidth, low loss, EMI-immune. Ideal for long-distance, high-speed networks (e.g., backbones). |
Radio Waves (Wi-Fi) | Up to 9.6–46 Gbps (Wi-Fi 6/7) | 50–300 m | Short-range, local networks. Performance varies by frequency (2.4/5/6 GHz) and obstacles. |
Radio Waves (Cellular) | 2 Mbps–1 Gbps (3G/5G) | 1–10 km (per cell) | Varies by generation (3G: ~2 Mbps, 5G: up to 1 Gbps). Cell-based, depends on tower proximity. |
Microwave (Terrestrial) | 100–400 Mbps (up to 1 Gbps) | 50–100 km (LOS) | Line-of-sight required. Used for point-to-point links (e.g., cellular backhaul). Weather-sensitive. |
Microwave (Satellite) | 1 Mbps–1 Gbps | Global (via orbits) | High latency (20–600 ms) due to distance (e.g., GEO at ~35,786 km). Suitable for remote areas. |
Free-Space Optical (Li-Fi) | Up to 200 Gbps | ~1–2 km | High-speed, line-of-sight. Limited by weather (e.g., fog) and obstacles. Used in niche applications. |
Generation | Name | Technology | Key Features | Max Speed | Launch Year |
---|---|---|---|---|---|
0G | Pre-cellular | Analog radio | Car-based voice-only systems | ~2.4 kbps | 1946 |
1G | First Generation | Analog (AMPS, NMT, TACS) | Voice calls only, poor quality | ~2.4 kbps | 1979 |
2G | Second Generation | GSM, CDMA, TDMA | Digital voice, SMS, basic data | ~64 kbps | 1991 |
2.5G | GPRS | Packet-switched GSM | MMS, email, basic internet | ~115 kbps | 2000 |
2.75G | EDGE | Enhanced GPRS | Faster data, multimedia messaging | ~384 kbps | 2003 |
3G | UMTS, CDMA2000 | WCDMA, EV-DO | Mobile internet, video calls | ~2 Mbps | 2001 |
3.5G | HSPA | HSDPA, HSUPA | Improved mobile broadband | ~14.4 Mbps | 2006 |
3.75G | HSPA+ | Enhanced HSPA | Higher data rates | ~42 Mbps | 2008 |
3.95G | LTE (Pre-4G) | OFDMA | High-speed data, IP-based services | ~100 Mbps | 2009 |
4G | LTE Advanced | OFDMA, MIMO | HD streaming, VoLTE, gaming | ~1 Gbps | 2011 |
4.5G | LTE Advanced Pro | Carrier aggregation | Enhanced LTE, IoT support | ~3 Gbps | 2015 |
5G | NR (New Radio) | mmWave, Massive MIMO | Ultra-low latency, IoT, smart cities | ~10 Gbps | 2018 |
6G (Future) | TBD | THz bands, AI integration | Holographic calls, real-time digital twins | ~100 Gbps (expected) | ~2030 (est.) |
Generation of Computer | Time Period | Key Technology | Characteristics |
---|---|---|---|
First Generation | 1940–1956 | Vacuum Tubes | Large, power-intensive, slow, machine language |
Second Generation | 1956–1963 | Transistors | Smaller, faster, used assembly language |
Third Generation | 1964–1971 | Integrated Circuits | Compact, introduced keyboards and monitors |
Fourth Generation | 1971–Present | Microprocessors | Personal computers, GUIs, networking |
Fifth Generation | Present & Beyond | AI and Nanotechnology | Self-learning, natural language processing |
Sixth Generation | Emerging & Future | Quantum Computing | Qubits, superposition, future potential |
.thisReset { animation: none; animation-delay: 0; animation-direction: normal; animation-duration: 0; animation-fill-mode: none; animation-iteration-count: 1; animation-name: none; animation-play-state: running; animation-timing-function: ease; backface-visibility: visible; background: 0; background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position: 0 0; background-position-x: 0; background-position-y: 0; background-repeat: repeat; background-size: auto auto; border: 0; border-style: none; border-width: medium; border-color: inherit; border-bottom: 0; border-bottom-color: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-style: none; border-bottom-width: medium; border-collapse: separate; border-image: none; border-left: 0; border-left-color: inherit; border-left-style: none; border-left-width: medium; border-radius: 0; border-right: 0; border-right-color: inherit; border-right-style: none; border-right-width: medium; border-spacing: 0; border-top: 0; border-top-color: inherit; border-top-left-radius: 0; border-top-right-radius: 0; border-top-style: none; border-top-width: medium; bottom: auto; box-shadow: none; box-sizing: content-box; caption-side: top; clear: none; clip: auto; color: inherit; columns: auto; column-count: auto; column-fill: balance; column-gap: normal; column-rule: medium none currentColor; column-rule-color: currentColor; column-rule-style: none; column-rule-width: none; column-span: 1; column-width: auto; content: normal; counter-increment: none; counter-reset: none; cursor: auto; direction: ltr; display: inline; empty-cells: show; float: none; font: normal; font-family: inherit; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; height: auto; hyphens: none; left: auto; letter-spacing: normal; line-height: normal; list-style: none; list-style-image: none; list-style-position: outside; list-style-type: disc; margin: 0; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; max-height: none; max-width: none; min-height: 0; min-width: 0; opacity: 1; orphans: 0; /* minimum number of lines in a block container that must be left at the bottom of the page */ outline: 0; outline-color: invert; outline-style: none; outline-width: medium; overflow: visible; overflow-x: visible; overflow-y: visible; padding: 0; padding-bottom: 0; padding-left: 0; padding-right: 0; padding-top: 0; page-break-after: auto; page-break-before: auto; page-break-inside: auto; perspective: none; perspective-origin: 50% 50%; position: static; /* May need to alter quotes for different locales (e.g. fr) */ quotes: '\201C' '\201D' '\2018' '\2019'; right: auto; tab-size: 8; table-layout: auto; text-align: inherit; text-align-last: auto; text-decoration: none; text-decoration-color: inherit; text-decoration-line: none; text-decoration-style: solid; text-indent: 0; text-shadow: none; text-transform: none; top: auto; transform: none; transform-style: flat; transition: none; transition-delay: 0s; transition-duration: 0s; transition-property: none; transition-timing-function: ease; unicode-bidi: normal; vertical-align: baseline; visibility: visible; white-space: normal; widows: 0; /* minimum number of lines that must be left at the top of the second page */ width: auto; word-spacing: normal; z-index: auto; /* basic modern patch */ all: initial; all: unset; }
Item | Size | Unit | Calculation | Conversion | Price | Calculation | Price/Unit |
1st | 1.5 | lbs | 1.5 lbs x 16 oz | 24 oz | $3.69 | $3.69 / 24 oz | $0.153 / oz |
2nd | 7 | oz | none | 7 oz | $1.49 | $1.49 / 7 oz | $0.212 / oz |
Civilization | Time Period | Region | Key Contributions & Legacy |
---|---|---|---|
Mesopotamia | c. 3500–539 BCE | Middle East | Writing (cuneiform), law codes (Hammurabi), urban planning |
Ancient Egypt | c. 3100–30 BCE | Nile Valley, Africa | Hieroglyphics, pyramids, centralized monarchy, early medicine |
Indus Valley | c. 2600–1900 BCE | South Asia | Advanced sanitation, grid cities, trade networks |
Maya Civilization | c. 2000 BCE–1697 CE | Mesoamerica | Astronomy, calendar systems, pyramids, glyph writing |
Ancient China | c. 1600 BCE–1912 CE | East Asia | Paper, printing, compass, Confucianism, dynastic rule |
Ancient Greece | c. 800–146 BCE | Mediterranean | Democracy, philosophy, architecture, Olympic Games |
Roman Empire | 27 BCE–476 CE (West) | Europe, Mediterranean | Law, engineering, military strategy, Latin language |
Islamic Caliphates | c. 632–1258 CE | Middle East, North Africa | Algebra, medicine, architecture, preservation of classical texts |
Mongol Empire | 1206–1368 CE | Eurasia | Largest contiguous empire, trade (Silk Road), military innovation |
Ottoman Empire | 1299–1922 CE | Middle East, Europe | Architecture, legal systems, cultural synthesis |
Inca Empire | c. 1438–1533 CE | Andes, South America | Road systems, terrace farming, centralized economy |
British Empire | 1583–1997 CE | Global | Industrialization, global trade, parliamentary governance |
URL | Purpose |
---|---|
about:config |
advanced settings editor—modify hidden preferences |
about:support |
system info, troubleshooting, profile details |
about:preferences |
main settings UI (LibreWolf-hardened) |
about:preferences#privacy |
direct link to privacy settings |
about:preferences#search |
search engine configuration |
about:preferences#librewolf |
LibreWolf-specific settings panel |
about:profiles |
view and manage browser profiles |
about:networking |
inspect DNS, sockets, and network stats |
about:cache |
view browser cache contents |
about:memory |
analyze memory usage and GC behavior |
about:performance |
live tab performance metrics |
about:processes |
process-level breakdown (sandboxing, threads) |
about:logins |
saved passwords (if enabled) |
about:downloads |
download history |
about:certificate |
certificate viewer |
about:crashes |
crash reports (telemetry disabled in LibreWolf) |
about:policies |
enterprise policies (LibreWolf uses overrides.cfg) |
about:about |
meta-list of all available about pages |
URL | Purpose |
---|---|
about:preferences#librewolf |
exposes LibreWolf’s hardened defaults and toggles |
about:config |
pre-hardened with privacy/security tweaks from LibreWolf team |
about:preferences |
stripped of Firefox Sync, Pocket, and telemetry options |
about:addons |
manage extensions, themes, and plugins |
Name | Author |
---|---|
Chameleon | sereneblue |
nightTab | zombieFox |
Stylus | Stylus Team, Jeremy Schomery |
Terms of Service; Didn't Read | ToS;DR |
Firefox Multi-Account Containers | Firefox |
A desktop environment (DE) is a comprehensive suite of applications and tools that provide a graphical interface for users. It includes:
Examples of DEs include KDE, GNOME, and Xfce. These environments are designed to be user-friendly and require minimal setup.
A window manager (WM) is a more lightweight software component that manages the placement and appearance of application windows. It focuses on:
Examples of WMs include i3, Openbox, and Fluxbox. They can be used independently or alongside a desktop environment.
Feature | Desktop Environment | Window Manager |
---|---|---|
Complexity | More complex, includes many components | Simpler, focuses on window management |
Resource Usage | Generally higher resource usage | Lower resource usage |
User Experience | Integrated and user-friendly | Requires more setup and customization |
Customization | Limited to provided options | Highly customizable |
Both options have their advantages, and the choice depends on user needs and preferences.
The companies that own and operate the inherited, old copper wire local phone networks—known as Incumbent Local Exchange Carriers (ILECs)—are the ones who still hold the Baby Bell and GTE/Independent Telephone Company copper infrastructure.
Category Name | Telecom Term | Description | Examples |
I. Bell System Legacy | RBOCs / Baby Bells | The companies created from the 1984 breakup of AT&T (the Regional Bell Operating Companies). They own the original copper in the densest, most profitable areas. | AT&T (SBC/BellSouth) and Verizon (Bell Atlantic, plus acquired GTE areas). |
II. Independent Legacy | Major Independent ILECs | Large telephone companies that were never part of the original Bell System monopoly but had their own incumbent monopolies in rural and less-dense areas. | CenturyTel (now Lumen/Brightspeed), GTE (now part of Verizon/Frontier/Ziply), and Frontier's original markets. |
III. Modern ILEC Buyers | New ILEC/Spin-Offs | Companies formed recently to purchase, consolidate, and eventually upgrade large chunks of copper infrastructure from the two categories above. | Brightspeed (purchased assets from Lumen) and Ziply Fiber (purchased assets from Frontier/Verizon). |
Carrier Category | Remaining ILEC Copper Owner | Original Legacy Copper | States Where They Operate Copper |
The Big Two | AT&T (SBC/BellSouth) | Southwestern Bell, BellSouth, Pacific Telesis, Ameritech, etc. | Primarily the 22 original Baby Bell states (outside the former US West/Qwest area). |
The National ILEC | Lumen Technologies (FKA CenturyLink) |
Former US West/Qwest and CenturyTel ILEC territories. | Retains the copper network for the remaining 16 states (primarily the old US West/Qwest region). |
The Focused ILEC | Verizon | Former Bell Atlantic and some GTE territories (primarily in the Northeast and Mid-Atlantic). | Limited footprint; largely focused on their fiber build-out (FiOS) and wireless. |
New ILEC Buyers | Brightspeed | Former Lumen/CenturyLink copper assets. | 20 states, primarily the former CenturyTel footprint. |
Regional Players | Ziply Fiber | Former GTE/Frontier assets. | Pacific Northwest (OR, WA, ID, MT). |
Frontier Communications | Former Verizon assets (mainly in the South/Midwest/West) and other independents. | Select rural and suburban markets across many states. |
Frames per second (FPS) measures how many frames are rendered in one second. To convert milliseconds per frame (ms/frame) to FPS, use the inverse relationship, since there are 1,000 milliseconds in a second:
FPS = 1000 / ms per frame
Example: For 100 ms per frame, FPS = 1000 / 100 = 10 FPS.
Reasoning: If each frame takes 100 ms, you can fit 10 frames in 1,000 ms (1 second). Round to 2 decimals for precision, but whole numbers are common for simplicity. Lower ms = higher FPS (smoother); higher ms = lower FPS (choppier).
This formula is linear and direct—no advanced math needed. For a table, I selected common intervals (1-500 ms) to show the range from ultra-fast to slow.
ms per Frame | FPS |
---|---|
1 | 1000.00 |
8 | 125.00 |
16 | 62.50 |
33 | 30.30 |
50 | 20.00 |
100 | 10.00 |
167 | 6.00 |
250 | 4.00 |
333 | 3.00 |
500 | 2.00 |
PANES is a multifunctional and customizable programs/notes system to help organize your life. It can be used to create handing reference notes, to do lists, time your tasks, even play games, etc.
General Pane Operation:
Panes generally behave the way you’d expect if you are familiar with any GUI based operating system. Below you will find a description of general Pane operation(s).
Double click the title bar to maximize and center a pane.
In the upper left corner of the pane are 3 symbols which can close, minimize, or maximize the pane.
The “x” which will close the selected pane. The pane can be reopened using the Control Panel “Open” dropdown menu. See Open section below.
The “-“ sign will minimize the content of the pane leaving only the title bar showing. By default on page load content panes will be minimized.
The “+” sign will maximize the content of the pane showing the title bar and content at the current placement.
In the upper right corner of the pane are 3 symbols which can change the placement of the pane...left, center, or right.
The “<“ symbol will move the pane to the immediate far left of the window.
The “o” symbol will open and center the pane in the window. Clicking it after the panes is open and center will close and place back in the layout. This is the same functionality as double clicking the title bar
The “>” symbol will move the pane to the immediate far right of the window.
Right click anywhere on the page to get a quick menu.
About:
Double click on the footer or "CoNtRoL PaNeL" title bar to display the "About" pane. This includes informative information such as page reload time, page elapse load time, page update time, color choice details, current screen size, and visits.
CoNtRoL PaNeL:
Below are general descriptions of the CoNtRoL PaNeL features to help you customize and use this site.
Theme:
The developer has included a few predesigned themes that are pretty fantastic. Definitely try the “Pumpkin” theme as it is demonstrably the best. Leave the dropdown "blank/empty" if you want to retain other settings like Color, Paper, Layout, etc upon returning to this webpage. A "Theme" can be recreated without choosing its dropdown. Double click the "footer" or "CoNtRoL PaNeL" title bar to help with the colors.
Color:
Colors are customizable for the background, foreground, title bar, and border/controls. Simply choose the item from the dropdown menu next to "Colors" label (below the color sliders) and adjust to your liking.
"Background" changes the background color
"Foreground" changes the color of the title bar for all the panes.
"Title" changes the font color in the title bar for all the panes.
"Border" changes the border/controls color for all the panes.
Once you've achieved a color combination that is pleasing you can reopen the "About" pane (double click the footer) and take note of the rgb color settings.
Paper:
You can choose from a selection of inspiring and creative background photos depending on your mood. You can further customize those to your liking by adjusting the colors as described in the Color Selection section. Play around until you find something you like.
Layout:
Layout is a quick way to move the Panes into organization on the page.
"Cascade" puts all panes into a descending/diagional starting from upper left to lower right on the page.
"Horizontal" puts all panes into horizontal/row alignment across the page.
"Random" puts all panes into a randomly placement on the page.
"Vertical" puts all panes into vertical/column alignment down the page.
""All Minimize"" displays only the title bar hiding the content for all panes.
""All Maximize"" displays the title bar hiding and content for all panes.
""All Close"" hides all panes...putting in the "Open" dropdown.
""All Open"" displays all panes...emptying from the "Open" dropdown.
See if you can find what you’re looking for!
Sort:
Sort your panes by Creation, Position, Title, or Updated.
Find:
Find/search for case insensitive title/content of a pane. After entering some text hit "Enter" or click on "Find" to start the search. To clear the search...double click on "Find" or blank out the box and hit "Enter". Searching with "broken" English is best...meaning leave out unimportant words, but enter the words in a logical English manner.
Open:
Open will remain empty until a Pane has been closed using the “x” in the upper left corner. See the section on General Pane Operation. If you desire to reopen a pane this is the place to do it.
Edit:
The Edit functionality is the heart of the usefulness of the PANES page. Certain panes have editable and customizable text and links. Select which pane you’d like to customize and using standard HTML you can create lists and links. Title bars are customizable as well by changing the text at the top of the edit pane. Edits to the Panes are stored locally only on your machine. So feel free to edit and modify to your hearts content. No other users will see or be affected by edits you make.
Create:
Beyond editing existing panes you can create a new pane to edit by pressing this button.
Delete:
The Delete functionality can remove a pane, you have "Created", that you no longer want.
Storage:
Caution: It is best to do a "Save" before an "Init".
"Save" button...saves local storage to a file of your choice.
"Init" button...clears local storage. The page will return to its initial state as if you haven't visited before.