#] 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 * 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:/usr/local/bin 20:30:25 0 [# cat lines.sh #!/bin/bash #set -x # 2024-06-15; lines.sh; Kent M Kohlmeyer (kemiko) # display range of lines from a file if [ ${#} -lt 1 ] then printf "\e[1mUsage: $(basename ${0}) <file> <start line> <stop line>\e[0m\n" exit 1 fi if [ ! -s ${1} ] then printf "\e[1m\"${0}\" is not a regular file with size!\e[0m\n" exit 1 fi if [ "${2}" -eq "${2}" ] && [ "${3}" -eq "${3}" ] 2>/dev/null then : else printf "\e[1m\"${2}\" (start) and/or \"${3}\" (stop) is not an integer\e[0m\n" exit 1 fi if [ ${2} -le 0 ] || [ ${3} -le 0 ] then printf "\e[1m\"${2}\" (start) and/or \"${3}\" (stop) can't be negative\e[0m\n" exit 1 fi if [ ${3} -gt $(wc -l ${1} | cut -d' ' -f1) ] then printf "\e[1m\"${3}\" (stop) shouldn't be greater than the file line count of \"$(wc -l ${1} | cut -d' ' -f1)\"\e[0m\n" exit 1 fi if [ "${2}" -gt "${3}" ] 2>/dev/null then printf "\e[1m\"${2}\" (start) can't be greater than \"${3}\" (stop)\e[0m\n" exit 1 fi head -n ${3} ${1} | tail -n $(expr ${3} - ${2} + 1) #] kemiko@box:/usr/local/bin 20:30:25 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:18 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 http://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)
--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" - https://web.mit.edu/gnu/doc/html/gdb_1.html ... "Debugging with GDB - Summary of GDB" - https://web.mit.edu/gnu/doc/html/gdb_25.html ~~~ Documentation @ O1.txt:1774 ~~~ #] kemiko@box:~ 19:32:56 0 [# cat ~/.gdbinit # type ctrl-alt-j to toggle-editing-mode between Emacs and Vi # show, info, help # b = break # d = delete # f = frame # l = list # n = next # q = quit # r = run # ! = rerun command history # set prompt (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
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. By default on page load content panes will be minimized.
The “+” sign will maximize the content of the pane.
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 center the pane in the window.
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.
Colors:
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 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!
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.
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.
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.
Delete:
The Delete functionality can remove a pane which is no longer wanted.
New Pane (button):
Beyond editing existing panes you can create a new pane to edit by pressing this button.
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.